首先定义SOAP数据,然后创建HTTP对象,然后使用POST提交,获取状态码为200,就说明调用成功,再进行下一步操作……
看一下具体实现的代码吧
<!--#Include virtual="/Include/json.min.asp"--> <% Dim strxml Dim str '定义soap消息 strxml = "<" 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 = strxml & "<reqcode>30000001</reqcode>" '参数1 strxml = strxml & "<sign>ssssss</sign>" '参数2 strxml = strxml & "</GetCategories>" strxml = strxml & "</soap:Body>" strxml = strxml & "</soap:Envelope>" Set h = createobject( "Microsoft.XMLHTTP") '向指定的URL发送Post消息 h.open "POST", "http://www.domain.com/WebService.asmx", False h.setRequestHeader "Content-Type", "text/xml; charset=utf-8" h.setRequestHeader "Content-Length",LEN(strxml) h.setRequestHeader "SOAPAction", "http://tempuri.org/GetCategories" h.send (strxml) '显示返回的XML信息 If h.Status = 200 Then Set 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 to categories.Length -1 Response.Write(CStr(categories.get(i).CategoryName)) '属性 for j = 0 to categories.get(i).Labels.Length - 1 '集合 Response.Write(CStr(categories.get(i).Labels.get(j).LabelName)) next next <pre name="code" class="vb"><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"\x00-\x1f\x7f-\x9f\"':'\\"','\\':'\\\\'},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==='string'"':'"'+string+'"';} function str(key,holder){var i,k,v,length,mind=gap,partial,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)"\\\/bfnrt]|u[0-9a-fA-F]{4})/g,'@').replace(/"[^"\\\n\r]*"|true|false|null|-" " Response.Write h.StatusTextEnd if%>
<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"\x00-\x1f\x7f-\x9f\"':'\\"','\\':'\\\\'},rep;function quote(string){escapable.lastIndex=0;return escapable.test(string)"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==='string'"':'"'+string+'"';} function str(key,holder){var i,k,v,length,mind=gap,partial,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)"\\\/bfnrt]|u[0-9a-fA-F]{4})/g,'@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']').replace(/(?:^|:|,)(?:\s*\[)+/g,''))){j=eval('('+text+')');return typeof reviver==='function'?walk({'':j},''):j;} throw new SyntaxError('JSON.parse');};}}()); </script>
华山资源网 Design By www.eoogi.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
华山资源网 Design By www.eoogi.com
暂无评论...
更新日志
2024年09月23日
2024年09月23日
- 华少翌.2005-华少翌【中唱艺能】【WAV+CUE】
- 群星《十二女声Ⅱ》[WAV/CUE/分轨][527MB]
- 大自然音乐系列《漫步在山裡》[WAV/CUE/分轨][502.8MB]
- 大自然音乐系列《星光夜语》[WAV/CUE/分轨][453.3MB]
- 史依弘《史依弘交响乐京剧演唱专辑HQ》头版限量编号[WAV+CUE]
- 曼丽2020《女人三十风继续吹》HQCD[WAV+CUE]
- 曼丽2021《女人三十2雾之恋》HQCD[WAV+CUE]
- 隔壁老樊.2019-我曾【好听音乐】【FLAC分轨】
- 高林生.1993-牵挂你的人是我【白天鹅】【WAV+CUE】
- 洪卓立.2012-找个懂我的女孩(国专)【英皇娱乐】【WAV+CUE】
- 曼丽2022《女人三十3晚秋》HQCD[WAV+CUE]
- 曼丽2018《女人三十4冬天》HQCD[WAV+CUE]
- 柏菲-《好歌30年壹》限量开盘母带ORMCD[低速原抓WAV+CUE]
- 大自然音乐系列《水舞》[WAV/CUE/分轨][424.3MB]
- 大自然音乐系列《星光夜语》[WAV/CUE/分轨][453.3MB]