我需要向Web服务编写SOAP请求。 它不起作用,我将其缩小到如何在.setRequestHeader" SoapAction"中定义命名空间。函数或实际的SoapRequest字符串。
请求标头需要Web服务的参数[namespace] / [method]。
我有网络服务代码,在.cs文件中,命名空间为PagingService
。
该服务的wsdl是:
http://<server>:<port>/PagingService/PagingService.Paging.svc?WSDL.
当我运行控制台应用程序并访问vbscript时,它会在我执行&#39; GET&#39;时返回wsdl。和&#39;发送()&#39;使用httpRequest对象。所以,我认为这很好。 我必须在setRequestHeader函数中使用方法名设置名称空间:
httpRequest.setRequestHeader "SOAPAction", "PagingService/TestMethod"
这是在此函数的第二个参数中设置名称空间/方法的正确方法吗?
如果这是正确的,我的SoapRequest字符串必定是错误的。
它需要urn
的Web服务。我如何确定?
答案 0 :(得分:1)
确定Web服务方法的SOAPAction: 1.打开WSDL 2.找到要调用的方法 在我的WSDL中,soap动作是该方法的一个属性。 它看起来像这样:
<wsdl:operation name="TestMethod">
<soap12:operation soapAction="http://tempuri.org/IPaging/TestMethod" style="document"/>
命名空间为http://tempuri.org/IPaging
方法是:TestMethod