He estado en contacto con WebService durante mucho tiempo, pero no hay muchos tutoriales para usar ASP para llamar, y no es común convertir a JSON.
Primero defina los datos de SOAB, luego cree el objeto HTTP, luego envíelo usando POST y obtenga el código de estado de 200, lo que significa que la llamada es exitosa y luego continúa a la siguiente operación ...
Eche un vistazo al código de implementación específico
< & <jabón: envolvente xmlns: xsi = 'http: //www.w3.org/2001/xmlschemainstance' xmlns: xsd = 'http: //www.w3.org/2001/xmlschema' xmlns: sano = '' http://schemas.xmlsoap.org/soap/envelope/ '> strxml = strxml & <SOAP: BODY> STRXML = STRXML & <getCategories xmlns = 'http: //tempuri.org/'> strxml = strxml & <REQCODE> 30000001 </REQCODE> 'Parameter 1Strxml = strxml & <sign> SSSSSSSSS </Sign> 'Parámetro 2Strxml = strxml & </getCategories> strxml = strxml & </soap: body> strxml = strxml & </jabón: envolvente> set h = createObject (Microsoft.xmlhttp)' Enviar mensaje post h.open al url especificado CORREO, http://www.domain.com/webservice.asmx, falseh.setRequestHeader content-type, text/xml; .org/getCategoriessh.send (strxml) 'Muestre la información XML devuelta si H.Status = 200 luego Establezca xmldoc = server.CreateObject (msxml.domDocument) xmlDoc.load (H.Responsexml) jSontext = xmldoc.childnodes (1) .Text 'Convertir a JSON, llamar a JSON.min.asp establecer categorías = JSON.PARSE (JSontext) para i = 0 a categorías.length -1 Response.write (cstr (categorías.get (get ( i) .CategoryName)) 'Propiedad para j = 0 a categorías.get (i) .labels.length - 1' colección respuesta.write (cstr (categorías.get (i) .labels.get (j) .labelName))) SIGUIENTE <pre name = código class = vb> <script lenguaje = javascript runat = server> if (! Array.prototype.get) {array.prototype.get = function (prop) {return this [prop];}} use strict; if (! this.json) {json = { };} (function () {function f (n) {return n <10? '0'+n: n;} if (typeof date.prototype.tojson! == 'function') {date.prototype.tojson = función (clave) {return isfinite (this.ValueOf ())? this.getUtutClyEar ()+'-'+f (this.getUtUtcMonth ()+1)+'-'+f (this.getutcdate ())+'t'+f (esto .getUtTours ())+':'+f (this.getUtcMinutes ())+':'+f (this.getUtcSeconds ())+'z': null;}; string.prototype.tojson = número.prototype. tOjson = boolean.prototype.tojson = function (key) {return this.ValueOf ();};} var cx =/[/?/?/?-/?/?/?/?/?-/?/?-/?/?-/?/?-/?/?-/?/?-/?] /g, escapable =/[//// x00-/x1f/x7f-/x9f/?/?-/?/?/?/?/?/?-/?-/?/?-/?/?/?/? -/?/? , '/n': '// n', '/f': '// f': '// f', '/r': '// r', '': '//', '/// /':' /// '}, Rep; Function Quote (String) {Escapable.lastIndex = 0; return escapaz.test (string)? ''+string.replace (escapable, function (a) {var c = meta [a]; return typeOf c === 'string'? C: '// u'+('0000 '+A.CharCodeat (0) .ToString (16)). Slice (-4);})+' ':' '+String+' '';} function Str (Key, Holder) {Var I, K, V, V, longitud, mente = gap, parcial, valor = holder [key]; if (value && typeof value === 'objeto' && typeof value.ToJson === 'function') {value = value.ToJson (key);} if (typeof Rep ==== 'function') {value = rep.call (Holder, Key, Value);} Switch (typeoF valor) {case'string ': return quote (valor); case'number': return isfinite (valor)? string (valor): 'null'; case'boolean ': case'null': return String (valor); case'Object ': if (! Value) {return'null';} gap+= indent; parcial = []; if (object.prototype.ToString.apply (valor) === '[Object Array] ') {longitud = valor.length; for (i = 0; i <longitud; 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 ==== 'Object') {longitud = Rep.length; for (i = 0; i <longitud; i+= 1) { k = rep [i]; if (typeof k === 'String') {v = str (k, valor); if (v) {parcial.push (quote (k)+(gap? ':': ':')+v);}}} } else {para (k en valor) {if (object.hasownproperty.call (valor, k)) {v = str (k, valor); if (v) {parcial.push (quote (k)+(gap? ': ':': ')+v);}}}}} v = parcial.length === 0?' {} ': gap?' {/n '+gap+parcial.join (',/n '+ GAP)+'/n'+Mind+'}': '{'+parcial.Join (',')+'}'; gap = Mind; return v;}} if (typeof json.stringify! == ' ') {Json.stringify = function (valor, reemplazar, espacio) {var i; gap =' '; indent =' ''; if (typeof space === 'number') {for (i = 0; i <space ; ';}} else if (typeof space ===' string ') {indent = space;} rep = replacer; if (replacer && typeof replacer! ==' function '&& (typeof replacer! ==' object '|| replacer replacer .length! == 'number')) {Throw New Error ('Json.Stringify');} return str ('', {'': valor});};} if (typeof json.parse! == ' función ') {json.parse = function (text, reviver) {var j; función Walk (Holder, Key) {Var K, V, Value = Holder [Key]; if (value && typeOf Value === 'Object') {for (k en valor) {if (object.hasownproperty.call (value, k) ) {v = walk (valor, k); if (v! == undefined) {valor [k] = v;} else {delete valor [k];}}}} return reviver.call (tithener, key, 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. reemplazar (/// (?: [//// bfnrt] | u [0-9a-fa-f] {4})/g, '@'). reemplazar (/[^/// n/r] *| verdadero | falso | nulo |-?/d+(?: /./ d*)? (?: [ee] [+/-]?/d+)?/g, ']'). reemplazar (/(( ?:^|: |,) (?:/s*/[)+/g, ''))) {j = eval ('('+text+')'); return typeof reviver === 'function'? walk ({'': j}, ''): j;} throw new syntaxError ('json.parse');};}} ()); </script> set xmlDoc = NothipElse Response.Write H.Status & Response.Write H.StatusTextend if%> Adjunto: json.min.asp <script language = javascript runat = server> if (! Array.prototype.get) {array.prototype.get = function (prop) {return this [prop];}} use 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.getUtutClyEar ()+'-'+f (this.getUtUtcMonth ()+1)+'-'+f (this.getutcdate ())+'t'+f (esto .getUtTours ())+':'+f (this.getUtcMinutes ())+':'+f (this.getUtcSeconds ())+'z': null;}; string.prototype.tojson = número.prototype. tOjson = boolean.prototype.tojson = function (key) {return this.ValueOf ();};} var cx =/[/?/?/?-/?/?/?/?/?-/?/?-/?/?-/?/?-/?/?-/?/?-/?] /g, escapable =/[//// x00-/x1f/x7f-/x9f/?/?-/?/?/?/?/?/?-/?-/?/?-/?/?/?/? -/?/? , '/n': '// n', '/f': '// f': '// f', '/r': '// r', '': '//', '/// /':' /// '}, Rep; Function Quote (String) {Escapable.lastIndex = 0; return escapaz.test (string)? ''+string.replace (escapable, function (a) {var c = meta [a]; return typeOf c === 'string'? C: '// u'+('0000 '+A.CharCodeat (0) .ToString (16)). Slice (-4);})+' ':' '+String+' '';} function Str (Key, Holder) {Var I, K, V, V, longitud, mente = gap, parcial, valor = holder [key]; if (value && typeof value === 'objeto' && typeof value.ToJson === 'function') {value = value.ToJson (key);} if (typeof Rep ==== 'function') {value = rep.call (Holder, Key, Value);} Switch (typeoF valor) {case'string ': return quote (valor); case'number': return isfinite (valor)? string (valor): 'null'; case'boolean ': case'null': return String (valor); case'Object ': if (! Value) {return'null';} gap+= indent; parcial = []; if (object.prototype.ToString.apply (valor) === '[Object Array] ') {longitud = valor.length; for (i = 0; i <longitud; 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 ==== 'Object') {longitud = rep.length; for (i = 0; i <longitud; i+= 1) { k = rep [i]; if (typeof k === 'String') {v = str (k, valor); if (v) {parcial.push (quote (k)+(gap? ':': ':')+v);}}} } else {para (k en valor) {if (object.hasownproperty.call (valor, k)) {v = str (k, valor); if (v) {parcial.push (quote (k)+(gap? ': ':': ')+v);}}}}} v = parcial.length === 0?' {} ': gap?' {/n '+gap+parcial.join (',/n '+ GAP)+'/n'+Mind+'}': '{'+parcial.Join (',')+'}'; gap = Mind; return v;}} if (typeof json.stringify! == ' ') {Json.stringify = function (valor, reemplazar, espacio) {var i; gap =' '; indent =' ''; if (typeof space === 'number') {for (i = 0; i <space ; ';}} else if (typeof space ===' string ') {indent = space;} rep = replacer; if (replacer && typeof replacer! ==' function '&& (typeof replacer! ==' object '|| replacer replacer .length! == 'number')) {Throw New Error ('Json.Stringify');} return str ('', {'': valor});};} if (typeof json.parse! == ' función ') {json.parse = function (text, reviver) {var j; función Walk (Holder, Key) {Var K, V, Value = Holder [Key]; if (value && typeOf Value === 'Object') {for (k en valor) {if (object.hasownproperty.call (value, k) ) {v = walk (valor, k); if (v! == undefined) {valor [k] = v;} else {delete valor [k];}}}} return reviver.call (tithener, key, 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. reemplazar (/// (?: [//// bfnrt] | u [0-9a-fa-f] {4})/g, '@'). reemplazar (/[^/// n/r] *| verdadero | falso | nulo |-?/d+(?: /./ d*)? (?: [ee] [+/-]?/d+)?/g, ']'). reemplazar (/(( ?:^|: |,) (?:/s*/[)+/g, ''))) {j = eval ('('+text+')'); return typeOf Reviver === 'function'?