Estou em contato com o WebService há muito tempo, mas não há muitos tutoriais para usar o ASP para ligar, e não é comum converter para o JSON.
Primeiro, defina os dados do SOAP, depois crie o objeto HTTP, depois envie -os usando o POST e obtenha o código de status de 200, o que significa que a chamada é bem -sucedida e depois prossiga para a próxima operação ...
Dê uma olhada no código de implementação específico
<!-#incluir virtual =/incluir/json.min.asp-> <%dim strxmldim str'Definition Soap mensagem strxml = <? Xml versão = '1.0' coding = 'utf-8'?> Strxml = strxml & <SOAP: envelope xmlns: xsi = 'http: //www.w3.org/2001/xmlschema-instance' xmlns: xsd = 'http: //www.w3.org/201/xmlschema' xmlnns: ' http://schemas.xmlsoap.org/soap/envelope/ '> strxml = strxml & <SOAP: Body> strxml = strxml & <getCategories xmlns = 'http: //tempuri.org/'> strxml = strxml & <reqcode> 30000001 </reqcode> parâmetro 1strxml = strxml & <Sign> SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSNS 'Parâmetro 2strxml = strxml & </getCategories> strxml = strxml & </Soap: body> strxml = strxml & </Soap: envelope> set h = createObject (microsoft.xmlhttp)' envia mensagem postagem h.open para url especificado PUBLICAR, http://www.domain.com/webservie.asmx, falseh.setRequestHeader content-type, text/xml; .org/getCategoriessh.send (strxml) 'mostre as informações XML retornadas se h.status = 200 então defina xmldoc = server.createObject (msxml.domdocument) xmldoc.load (h.Responsexml) JSontext = xmldoc.childnodes (1) .Text 'Converta em json, ligue para JSON.MIN.ASP Categorias de conjunto = json.parse (jSontext) para i = 0 a categorias.Length -1 Response.Write (categorias.get.get ( i) .categoryName)) 'propriedade para j = 0 a categorias.get (i) .labels.length - 1' Resposta de coleção.write (cstr (categories.get (i) .labels.get (j) .labelname)) próximo próximo <pré -nome = código de código = vb> <script idioma = javascript runat = server> if (! Array.prototype.get) {array.prototype.get = function (prop) {return this [prop];}} use strict; if (! this.json) {json = {{ };} (function () {função f (n) {return n <10? '0'+n: n;} if (typeof date.prototype.tojson! == 'function') {date.prototype.tojson = função (chave) {return isfinite (this.valueof ())? this.getUtclyear ()+'-'+f (this.getUtcmonth ()+1)+'-'+f (this.getutcdate ())+'t'+f (this .getutchours ())+':'+f (this.getUtcminutes ())+':'+f (this.getutcSeconds ())+'z': null;}; string.prototype.tojson = number.prototype. tojson = boolean.prototype.tojson = function (key) {return this.valueof ();};} var cx =/[/?/?/?-/?/?/?/?/?-/?/?-/?/?-/?/?-/?/?-/?/?-/?] /g, escapável =///// x00-/x1f/x7f-/x9f/?/?-/?/?/?/?/?/?-/?-/?-/?/?/? -/?/?-/?/?-/?/?-/?]/g, gap, indent, meta = {'/b': '// b', '/t': '// t' , '/n': '// n', '/f': '// f': '// f', '/r': '// r', '': '//', '/' /':' /// '}, representante; escapável.test (string)? ''+string.replace (escapável, function (a) {var c = meta [a]; retorno tipo de c === 'string'? c: '// u'+('0000 '+a.charcodeat (0) .ToString (16)). Slice (-4);})+' ':' '+string+' ';} função str (chave, suporte) {var i, k, v, comprimento, mente = gap, parcial, value = titular [key]; if (value && typeof value === 'object' && typeof value.tojson === 'function') {value = value.tojson (key);} if (typeof Rep === 'function') {value = Rep.Call (titular, chave, value);} switch (typeof value) {case'String ': Return Quote (Value); case'Number': return isfinite (value)? string (value): 'null'; case'boolean ': case'null': retornar String (value); case'Object ': if (! Value) {return'null';} gap+= indent; parcial = []; if (object.prototype.tostring.apply (value) === '[object Array] ') {length = value.Length; para (i = 0; i <comprimento; i+= 1) {parcial [i] = str (i, value) ||' null ';} v = parcial.Length = == 0? '[]': Gap? '[/N'+gap+parcial.join (',/n'+gap)+'/n'+Mind+']': '['+parcial.join ( ',')+']'; gap = Mind; return v;} if (rep && typeof Rep === 'objeto') {length = Rep.Length; para (i = 0; i <comprimento; i+= 1) { k = rep [i]; if (typeof k === 'string') {v = str (k, value); if (v) {parcial.push (quote (k)+(gap? ':': ':')+v);}}} } else {for (k no valor) {if (object.HasownProperty.call (value, k)) {v = str (k, value); if (v) {parcial.push (quote (k)+(gap? ': ':': ')+v);}}}}} v = parcial.length === 0?' {} ': gap?' {/n '+gap+parcial.join (',/n '+ gap)+'/n'+Mind+'}': '{'+parcial.join (',')+'}'; gap = mence; return v;}} if (typeof json.stringify! == 'função ') {Json.stringify = function (valor, substituto, espaço) {var i; gap =' '; indent =' '; if (typeof space ==' número ') {for (i = 0; i <espaço i+= 1) {indent+= ' ';}} else if (typeof space ===' string ') {indent = space;} rep = replacer; if (replacer && typeof replacer! ==' function '&& (typeof replacer! ==' object '|| typeof replacer .Length! == 'Número')) {TOME NOVO ERRO ('JSON.STRINGIFY');} Return str ('', {'': value});};} if (typeof json.parse! == ' function ') {json.parse = function (texto, reviver) {var j; function Walk (titular, key) {var k, v, value = holder [key]; if (value && typeof value === 'object') {for (k em value) {if (object.hasownProperty.call (value, k) ) {v = Walk (valor, k); if (v! == indefinido) {value [k] = v;} else {excluir valor [k];}}}} retornar Reviver.call (titular, chave, valor);} cx.LastIndex = 0; if (cx.test (text)) {text = text.replace (cx, function (a) {return '// u'+(' 0000 '+a.charcodeat (0) .ToString (16)). Slice (-4);});} if (/^[/] ,: {}/s]*$/. Test (texto. Substitua (/// (?: [//// bfnrt] | u [0-9a-fA-f] {4})/g, '@'). Substitua (/[^/// N/R] *| true | false | null |-?/d+(?: /./ d*)? (?: [ee] [+/-]?/d+)?/g, ']'). substituir (/(((( ?:^|: |,) (?:/s*/[)+/g, ''))) {j = avaliar ('('+text+')'); retornar typeof Reviver === 'Função'? Walk ({'': j}, ''): j;} lança new syntaxError ('json.parse');};}} ()); </script> set xmldococ = NOTEELSE Response.Write H.Status & Response.Write H.Statustextend Se%> Anexo: json.min.asp <idioma do script = javascript runat = server> if (! Array.prototype.get) {array.prototype.get = function (prop) {return this [prop];}} use strict; if (! this.json) {json = {};} (function () {função f (n) {return n <10? '0'+n: n;} if (typeof date.prototype.tojson! == 'function') {date.prototype. tojson = function (key) {return isfinite (this.valueof ())? this.getUtclyear ()+'-'+f (this.getUtcmonth ()+1)+'-'+f (this.getutcdate ())+'t'+f (this .getutchours ())+':'+f (this.getUtcminutes ())+':'+f (this.getutcSeconds ())+'z': null;}; string.prototype.tojson = number.prototype. tojson = boolean.prototype.tojson = function (key) {return this.valueof ();};} var cx =/[/?/?/?-/?/?/?/?/?-/?/?-/?/?-/?/?-/?/?-/?/?-/?] /g, escapável =///// x00-/x1f/x7f-/x9f/?/?-/?/?/?/?/?/?-/?-/?-/?/?/? -/?/?-/?/?-/?/?-/?]/g, gap, indent, meta = {'/b': '// b', '/t': '// t' , '/n': '// n', '/f': '// f': '// f', '/r': '// r', '': '//', '/' /':' /// '}, representante; escapável.test (string)? ''+string.replace (escapável, function (a) {var c = meta [a]; retorno tipo de c === 'string'? c: '// u'+('0000 '+a.charcodeat (0) .ToString (16)). Slice (-4);})+' ':' '+string+' ';} função str (chave, suporte) {var i, k, v, comprimento, mente = gap, parcial, value = titular [key]; if (value && typeof value === 'object' && typeof value.tojson === 'function') {value = value.tojson (key);} if (typeof Rep === 'function') {value = Rep.Call (titular, chave, valor);} switch (typeof value) {case'String ': Return Quote (Value); case'Number': return isfinite (value)? string (value): 'null'; case'boolean ': case'null': retornar String (value); case'Object ': if (! Value) {return'null';} gap+= indent; parcial = []; if (object.prototype.tostring.apply (value) === '[object Array] ') {length = value.Length; para (i = 0; i <comprimento; i+= 1) {parcial [i] = str (i, value) ||' null ';} v = parcial.Length = == 0? '[]': Gap? '[/N'+gap+parcial.join (',/n'+gap)+'/n'+Mind+']': '['+parcial.join ( ',')+']'; gap = Mind; return v;} if (rep && typeof Rep === 'objeto') {length = Rep.Length; para (i = 0; i <comprimento; i+= 1) { k = rep [i]; if (typeof k === 'string') {v = str (k, value); if (v) {parcial.push (quote (k)+(gap? ':': ':')+v);}}} } else {for (k no valor) {if (object.HasownProperty.call (value, k)) {v = str (k, value); if (v) {parcial.push (quote (k)+(gap? ': ':': ')+v);}}}}} v = parcial.length === 0?' {} ': gap?' {/n '+gap+parcial.join (',/n '+ gap)+'/n'+Mind+'}': '{'+parcial.join (',')+'}'; gap = mence; return v;}} if (typeof json.stringify! == 'função ') {Json.stringify = function (valor, substituto, espaço) {var i; gap =' '; indent =' '; if (typeof space ==' número ') {for (i = 0; i <espaço i+= 1) {indent+= ' ';}} else if (typeof space ===' string ') {indent = space;} rep = replacer; if (replacer && typeof replacer! ==' function '&& (typeof replacer! ==' object '|| typeof replacer .Length! == 'Número')) {TOME NOVO ERRO ('JSON.STRINGIFY');} Return str ('', {'': value});};} if (typeof json.parse! == ' function ') {json.parse = function (texto, reviver) {var j; function Walk (titular, key) {var k, v, value = holder [key]; if (value && typeof value === 'object') {for (k em value) {if (object.hasownProperty.call (value, k) ) {v = Walk (valor, k); if (v! == indefinido) {value [k] = v;} else {excluir valor [k];}}}} retornar Reviver.call (titular, chave, valor);} cx.LastIndex = 0; if (cx.test (text)) {text = text.replace (cx, function (a) {return '// u'+(' 0000 '+a.charcodeat (0) .ToString (16)). Slice (-4);});} if (/^[/] ,: {}/s]*$/. Test (texto. Substitua (/// (?: [//// bfnrt] | u [0-9a-fA-f] {4})/g, '@'). Substitua (/[^/// N/R] *| true | false | null |-?/d+(?: /./ d*)? (?: [ee] [+/-]?/d+)?/g, ']'). substituir (/(((( ?:^|: |,) (?:/s*/[)+/g, ''))) {j = avaliar ('('+text+')'); retornar typeof Reviver === 'Função'? Walk ({'': j}, ''): j;} lança nova syntaxerror ('json.parse');};}} ()); </sCript>