나는 오랫동안 WebService와 접촉했지만 ASP를 사용하는 튜토리얼은 많지 않으며 JSON으로 전환하는 것은 일반적이지 않습니다.
먼저 SOAP 데이터를 정의한 다음 HTTP 객체를 작성한 다음 Post를 사용하여 제출 한 다음 200의 상태 코드를 얻은 다음 호출이 성공한 다음 다음 작업으로 진행 함을 의미합니다.
특정 구현 코드를 살펴보십시오
<!-#포함 virtual =/include/json.min.asp-> <%dim stxmldim str'definition soap message stxml = <? xml 버전 = '1.0'alcoding = 'utf-8'?> strxml = strxml & <soap : 봉투 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> stxml = stxml & <getCategories xmlns = 'http : //tempuri.org/'> stxml = stxml & <reqcode> 30000001 </reqcode> '매개 변수 1strxml = strxml & <sign> sssssssss> '매개 변수 2stxml = stxml & </getCategories> strxml = strxml & </soap : body> strxml = strxml = stxml = set h = createobject (microsoft.xmlhttp)'지정된 메시지 보내기 h.open 우편, http://www.domain.com/webservice.asmx, falseh.setrequestheader content-type, 텍스트/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 categors = json.parse (jsontext)를 categorys.length -1 response.write (cstrories.get (crate.get)에 전화하십시오. i) .categoryName)) 'j = 0 to categors.get (i) .labels.length.length -1'collection response.write (cstrouse.get.get.labels.get (j) .labelname). 다음으로 <pre name = code class = vb> <스크립트 language = javaScript runat = server> if (! array.prototype.get) {array.prototyp.get = function (prop) {return this [prop];}} strict; if (! this.json) {json = {{json = { };} (function () {function f (n) {return n <10? '0'+n : n;} if (typeof date.prototyp.tojson! == 'function') {date.prototype.tojson = 함수 (키) {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, 탈출 가능 =/[/// x00-/x1f/x7f-/x9f/?/?-/?/?/?/?/?-/?-/?-/?/? -/?/?-/?-/?/?-/?]/g, 갭, 들여 쓰기, 메타 = { '/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+' ';} 함수 str (key, holder) {var i, k, v, 길이, 마인드 = 갭, 부분, 값 = 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 값) {case'String ': return Quote (value); case'Number': return isfinite (value)? 문자열 (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; for (i = 0; i <length; i+= 1) {partial [i] = str (i, value) ||'null ';} v = partial.length = == 0? '[]': gap? '[/n'+gap+partial.join ( ',/n'+gap)+'/n'+mind+']': '['+partial.join ( ',')+']' '; gap = mind; return v;} if (rep && repof rep ==='object ') {length = rep.length; for (i = 0; i <길이; i+= 1) { 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 '+ 갭)+'/n'+mind+'}': '{'+partial.join ( ',')+'}'; gap = mind; return v;}} if (json.stringify! == '함수 ') {json.stringify = function (값, 대체기, 공간) {var i; gap =' '; indent =' '; if (typeof space ==='숫자 ') {for (i = 0; i <space ; i+= 1) {indent+= ' ';}} else if (typeof space ==='string ') {indent = space;} rep = replacer; if (replacer && typeof replacer! =='function '&& (typeof replacer! =='Object '|| typeof replacer .length! == 'number')) {새 오류 ( '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 {value value [k];}}} return 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 (텍스트. 대체 (/// (? : [/// bfnrt] | u [0-9a-fa-f] {4})/g, '@'). 교체 (/[/[^// n/r] *| true | false | null |-?/d+(? : /./ d*)? (? : [ee] [+/-]?/d+)?/g, ']). ? :^| : |,) (? :/s*/[)+/g, ')))) {j = eval ('( '+text+') '); return reviver 형식 === 'function'? walk ({ '': j}, '') : j;} 새 구문 서러 ( 'json.parse');};}}} ()); </script> set xmldoc = NotheElse response.write h.status & response.write h.statustextend if%> 첨부 파일 : json.min.asp <script language = javaScript runat = server> if (! array.prototype.get) {array.prototype.get = function (prop) {this [prop];}} retud this [thrict; 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.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, 탈출 가능 =/[/// x00-/x1f/x7f-/x9f/?/?-/?/?/?/?/?-/?-/?-/?/? -/?/?-/?-/?/?-/?]/g, 갭, 들여 쓰기, 메타 = { '/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+' ';} 함수 str (key, holder) {var i, k, v, 길이, 마인드 = 갭, 부분, 값 = 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 값) {case'String ': return Quote (value); case'Number': return isfinite (value)? 문자열 (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; for (i = 0; i <length; i+= 1) {partial [i] = str (i, value) ||'null ';} v = partial.length = == 0? '[]': gap? '[/n'+gap+partial.join ( ',/n'+gap)+'/n'+mind+']': '['+partial.join ( ',')+']' '; gap = mind; return v;} if (rep && repof rep ==='object ') {length = rep.length; for (i = 0; i <길이; i+= 1) { 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 '+ 갭)+'/n'+mind+'}': '{'+partial.join ( ',')+'}'; gap = mind; return v;}} if (json.stringify! == '함수 ') {json.stringify = function (값, 대체기, 공간) {var i; gap =' '; indent =' '; if (typeof space ==='숫자 ') {for (i = 0; i <space ; i+= 1) {indent+= ' ';}} else if (typeof space ==='string ') {indent = space;} rep = replacer; if (replacer && typeof replacer! =='function '&& (typeof replacer! =='Object '|| typeof replacer .length! == 'number')) {새 오류 ( '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 {value value [k];}}} return 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 (텍스트. 대체 (/// (? : [/// bfnrt] | u [0-9a-fa-f] {4})/g, '@'). 교체 (/[/[^// n/r] *| true | false | null |-?/d+(? : /./ d*)? (? : [ee] [+/-]?/d+)?/g, ']). ? :^| : |,) (? :/s*/[)+/g, ')))) {j = eval ('( '+text+') '); return reviver 타입 === 'function'? walk ({ '': j}, '') : j;} 새 구문 서러 ( 'json.parse');};}}} ()); </script>