Gloria Santin
Gloria Santin

Reputation: 2136

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

I need to write a SOAP request to a web service. It is not working and I am narrowed it down to how I am defining the namespace in the .setRequestHeader "SoapAction" function or the actual SoapRequest string.

The request header requires the parameter [namespace]/[method] of the web service.

I have the web service code and in the .cs file the namespace is PagingService. The wsdl for the service is:

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

When I run a console application and access the vbscript, it returns the wsdl when I do a 'GET' and 'Send()' using the httpRequest object. So, I think this is fine. I have to set the namespace with the method name in the setRequestHeader function:

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

Is this the correct way to set the namespace/method in the second parameter of this function? If this is correct, my SoapRequest string must be wrong. It requires the urn of the web service. How do I determine that?

Upvotes: 1

Views: 7377

Answers (1)

Gloria Santin
Gloria Santin

Reputation: 2136

To determine the SOAPAction of a web service method: 1. Open the WSDL 2. Find the method that you want to call 3. In my WSDL, the soap action was an attribute of the method. It looked like this:

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

The namespace is http://tempuri.org/IPaging The method is: TestMethod

Upvotes: 2

Related Questions