如何确定 Web 服务的命名空间和 URN?

How can you determine the namespace and URN of a web service?

我需要向 Web 服务写入 SOAP 请求。 它不起作用,我将其缩小到如何在 .setRequestHeader "SoapAction" 函数或实际的 SoapRequest 字符串中定义名称空间。

请求header需要网络服务的参数[命名空间]/[方法]。

我有 Web 服务代码,在 .cs 文件中命名空间是 PagingService。 服务的 wsdl 是:

http://<server>:<port>/PagingService/PagingService.Paging.svc?WSDL.

当我 运行 一个控制台应用程序并访问 vbscript 时,它 returns wsdl 当我使用 httpRequest 'GET' 和 'Send()' object.所以,我认为这很好。 我必须在 setRequestHeader 函数中使用方法名称设置命名空间:

httpRequest.setRequestHeader "SOAPAction", "PagingService/TestMethod"

在这个函数的第二个参数中设置 namespace/method 的方法是否正确? 如果这是正确的,我的 SoapRequest 字符串一定是错误的。 它需要网络服务的urn。我如何确定?

确定 Web 服务方法的 SOAPAction: 1.打开WSDL 2.找到你要调用的方法 3. 在我的 WSDL 中,soap 动作是方法的一个属性。 它看起来像这样:

<wsdl:operation name="TestMethod">
<soap12:operation soapAction="http://tempuri.org/IPaging/TestMethod" style="document"/>

命名空间是http://tempuri.org/IPaging 方法是:TestMethod