私は長い間ウェブサービスと連絡を取りましたが、ASPを使用するためのチュートリアルは多くありません。
まず、SOAPデータを定義し、次にHTTPオブジェクトを作成し、POSTを使用して送信し、200のステータスコードを取得します。つまり、コールが成功し、次の操作に進みます...
特定の実装コードをご覧ください
<! - #include virtual =/include/json.min.asp-> <%dim strxmldim str'definition soap message strxml = <?xml version = '1.0' encoding = 'utf-8'?> strxml = strxml &<SOAP:Envelope XMLNS:XSI = 'http://www.w3.org/2001/xmlschema-instance' xmlns:xsd = 'http://www.w3.org/2001/xmlschema' xmlns:soap = ' http://schemas.xmlsoap.org/soap/envelope/ '> strxml = strxml& <soap:body> strxml = strxml&<getcategories xmlns = 'http://tempuri.org/'> strxml&<reqcode> 300001 </reqcode> 'パラメーター1strxml = strxml&<標識> ssss 'パラメーター2STRXML = STRXML&</getCategories> strxml = strxml&</soap:body> strxml&strxml&strxml&strxml&soap:envelope> set h = createObject(microsoft.xmlhttp)役職、 http://www.domain.com/webservice.asmx、falseh.setRequestheader Content-Type、Text/XML; .org/getCategoriessh.send(strxml) 'h.status = 200の場合、返されたxml情報を表示しますxmldoc = server.createobject(msxml.domdocument)xmldoc.load(h.responsexml) jsontext = xmldoc.childnodes(1).text 'jsonに変換し、json.min.asp set categories = json.parse(jsontext)for i = 0 for i = categories.length -1 respons.write(categries.get( i).categoryName)) 'j = 0 to categories.get(i).labels.length -1' collection response.write(cctories.get(i).labels.get(j).labelname)) 'プロパティ次は<pre name = code class = vb> <スクリプト言語= javascript runat = server> if(!array.prototype.get){array.prototype.get(prop){return this [prop];}} strict; if(!this.json){json = {{ };}(function(){function f(n){return n <10? '0'+n:n;} if(typeof date.prototype.tojson!== 'function'){date.prototype.tojson = function(key){return isfinite(this.valueof())?this.getutceliear()+' - '+f(this.getutcmonth()+1)+' - '+f(this.getutcdate())+'t'+f(this .getutchours())+':'+f(this.getutcminutes())+':'+f(this.getCseconds())+'z':null;}; string.prototype.tojson = number.prototype。 tojson = boolean.prototype.tojson = function(key){return this.valueof();};} var cx =/[/?/?/? - /?/?/?/?/?/?/?/? - /?/? - /?/? - /?] /g、Escapable =/[//// x00-/x1f/x7f-/x9f/?/? - /?/?/?/?/?/? - /?/?/?/?/?/? - /?/? - /?/? - /?/?]/?]/g、gap、indent、meta = {'/b': '// b'、 '/t': '// t' 、 '/n': '// n'、 '/f': '// f': ':' // f '、'/r ':' // r '、' ':' // '、'/ /':' /// '}、rep; function quote(string){escapable.lastindex = 0; return Escapable.test(string)? ''+string.replace(escapable、function(a){var c = meta [a]; return typeof c === 'string'?c: '// u'+( '0000 '+A.CharCodeat(0).ToString(16))。スライス(-4);})+' ':' '+string+' ';} function str(key、holder){var i、k、v、長さ、マインド=ギャップ、部分、value = holder [key]; if(value && typeof value === 'object' && typeof value.tojson === 'function'){value = value.tojson(key);} if(typeof rep === 'function'){value = rep.call(holder、key、value);} switch(typeof value){case'string ':return quote(value); case'number':return isfinite(value)?string(value): 'null'; case'boolean ':case'null':return string(value); case'object ':if(!value){return'null';} gap+= indent; partial = []; if(object.prototype.tostring.apply(value)=== '[object array] '){length = value.length; == 0? '[]':gap? '[/n'+gap+partial.join( '、/n'+gap)+'/n'+mind+']': '['+partial.join( '、')+']; gap = mind; return v;} if(rep && typeof rep ===' obje。 k = rep [i]; if(typeof k === 'string'){v = str(k、value); if(v){partial.push(quote(k)+(gap? ':': ':')+v);}}}}} } else {for(k in value){if(object.hasownproperty.call(value、k)){v = str(k、value); if(v){partial.push(quote(k)+(gap? ': ':': ')+v);}}}}} v = partial.length === 0?' {} ':gap?' {/n '+gap+partial.join('、/n '+ gap)+'/n'+mind+'}': '{'+partial.join( '、')+'}'; gap = mind; return v;}} if(typeof json.stringify!== '関数'){json.stringify = function(value、fallinger、space){var i; gap =' '; indent =' '; if(typeof space ===' number '){for(i = 0; i <space ; i+= 1){indent+= ' '; .length!== 'number')){throw new error( 'json.stringify');} return str( ''、{'':value});};} if(typeof json.parse!== ' function '){json.parse = function(text、reviver){var j; function walk(Holder、key){var k、v、value = holder [key]; if(value && typeof value === 'object'){for(k in value){if(object.hasownproperty.call(value、k)) ){v = walk(value、k); if(v!== undefined){value [k] = v;} else {delete value [k];}}}} return Reviver.Call(Holder、Key、Value);} cx.lastindex = 0; if(cx.test(text)){text = text.Replace(cx、function(a){return '// u'+( ' 0000 '+A.CharCodeat(0).ToString(16))。スライス(-4);});} if(/^[/]、:{}/s]*$/。test(text(text。交換(///(?:[//// bfnrt] | u [0-9a-fa-f] {4})/g、 '@')。 *| true | false | null | - ?/d+(?:/./ d*)?(?:[ee] [+/-]?/d+)?/g、 ']')。 ?:^|:|、)(?:/s*/[)+/g、 '')){j = eval( '('+text+')'); return typeof reviver === 'function'?walk({'':j}、 ''):j;} new syntaxerror( 'json.parse');};}}(); </script> set xmldoc = noteelse respons.write h.status&respons.write h.statustextend if>添付ファイル:json.min.asp <スクリプト言語= javascript runat = server> if(!array.prototype.get){array.prototype.get = function(prop){return this [prop];}} strict; if(!this.json){json = {};}(function(){function f(n){return n <10? '0'+n:n;} if(typeof date.prototype.tojson!== 'function'){date.prototype。 tojson = function(key){return isfinite(this.valueof())?this.getutceliear()+' - '+f(this.getutcmonth()+1)+' - '+f(this.getutcdate())+'t'+f(this .getutchours())+':'+f(this.getutcminutes())+':'+f(this.getCseconds())+'z':null;}; string.prototype.tojson = number.prototype。 tojson = boolean.prototype.tojson = function(key){return this.valueof();};} var cx =/[/?/?/? - /?/?/?/?/?/?/?/? - /?/? - /?/? - /?] /g、Escapable =/[//// x00-/x1f/x7f-/x9f/?/? - /?/?/?/?/?/? - /?/?/?/?/?/? - /?/? - /?/? - /?/?]/?]/g、gap、indent、meta = {'/b': '// b'、 '/t': '// t' 、 '/n': '// n'、 '/f': '// f': ':' // f '、'/r ':' // r '、' ':' // '、'/ /':' /// '}、rep; function quote(string){escapable.lastindex = 0; return Escapable.test(string)? ''+string.replace(escapable、function(a){var c = meta [a]; return typeof c === 'string'?c: '// u'+( '0000 '+A.CharCodeat(0).ToString(16))。スライス(-4);})+' ':' '+string+' ';} function str(key、holder){var i、k、v、長さ、マインド=ギャップ、部分、value = holder [key]; if(value && typeof value === 'object' && typeof value.tojson === 'function'){value = value.tojson(key);} if(typeof rep === 'function'){value = rep.call(holder、key、value);} switch(typeof value){case'string ':return quote(value); case'number':return isfinite(value)?string(value): 'null'; case'boolean ':case'null':return string(value); case'object ':if(!value){return'null';} gap+= indent; partial = []; if(object.prototype.tostring.apply(value)=== '[object array] '){length = value.length; == 0? '[]':gap? '[/n'+gap+partial.join( '、/n'+gap)+'/n'+mind+']': '['+partial.join( '、')+']; gap = mind; return v;} if(rep && typeof rep ===' obje。 k = rep [i]; if(typeof k === 'string'){v = str(k、value); if(v){partial.push(quote(k)+(gap? ':': ':')+v);}}}}} } else {for(k in value){if(object.hasownproperty.call(value、k)){v = str(k、value); if(v){partial.push(quote(k)+(gap? ': ':': ')+v);}}}}} v = partial.length === 0?' {} ':gap?' {/n '+gap+partial.join('、/n '+ gap)+'/n'+mind+'}': '{'+partial.join( '、')+'}'; gap = mind; return v;}} if(typeof json.stringify!== '関数'){json.stringify = function(value、fallinger、space){var i; gap =' '; indent =' '; if(typeof space ===' number '){for(i = 0; i <space ; i+= 1){indent+= ' '; .length!== 'number')){throw new error( 'json.stringify');} return str( ''、{'':value});};} if(typeof json.parse!== ' function '){json.parse = function(text、reviver){var j; function walk(Holder、key){var k、v、value = holder [key]; if(value && typeof value === 'object'){for(k in value){if(object.hasownproperty.call(value、k)) ){v = walk(value、k); if(v!== undefined){value [k] = v;} else {delete value [k];}}}} return Reviver.Call(Holder、Key、Value);} cx.lastindex = 0; if(cx.test(text)){text = text.Replace(cx、function(a){return '// u'+( ' 0000 '+A.CharCodeat(0).ToString(16))。スライス(-4);});} if(/^[/]、:{}/s]*$/。test(text(text。交換(///(?:[//// bfnrt] | u [0-9a-fa-f] {4})/g、 '@')。 *| true | false | null | - ?/d+(?:/./ d*)?(?:[ee] [+/-]?/d+)?/g、 ']')。 ?:^|:|、)(?:/s*/[)+/g、 '')){j = eval( '('+text+')'); return typeof reviver === 'function'?walk({'':j}、 ''):j;} new syntaxerror( 'json.parse');};}}(); </script>