Click here to Skip to main content
14,769,975 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
For a customer I must implement a SOAP webservice according to their WSDL. I do not know what framework they will use to call the service, but it's not .Net.

I have generated the code for the code for the webservice with wsdl.exe (using the 'serverinterface' parameter) and put it into an asmx webpage. For now the web methods have no real implementation. They simply return the expected return values and nothing else. The service seems to work, so far, so good.

The problems come with a simple test client. It's a console application with a web reference to the service. Whenever I try to call a web method, I will get a SOAP exeption. I would post it here, but it's perfect German and contains a lot of information which I would not like to post here.

Essentially it says that each web method must have a unique value for 'SOAPaction'. The customer's WSDL contains only empty strings for the SOAPaction fields, so I must assume that this is correct and as they expect it. As I understand, the SOAPaction field has become more optional in SOAP 1.1 or SOAP 1.2.

As I can't change the service, how can I get the test client to call it without any values for the SOAPactions?

What I have tried:

I have tried to generate the service's code with every suitable option of WSDL.exe. The only option that I have not tried yet will be to specify to use SOAP 1.1 or SOAP 1.2 directly. That may be worth another try. What I hope for is some kind of setting that tells the client not to use the SOAPAction parameter in its calls, but I have no idea what exactly to do to get there.

Edit: I have disallowed the SOAP 1.1 protocol in the service's web.config. Now I can call web methods without any SOAP exceptions and do indeed get a response. The only strange thing still is that the property that I set in the response object to confirm that the right web method was called is null. Debugging into the service also does not work yet.
Posted
Updated 23-Nov-20 23:56pm
v2
Comments
Jörgen Andersson 24-Nov-20 5:35am
   
A SOAPAction is a URI identifying the "intent". But there are no restrictions on the format of the URI or that it's even real. So it's basically an identifier that has to be unique for every endpoint.
There are circumstances where you don't need it though, but to answer if that's the case we have to little info.
More info here: https://www.w3.org/TR/wsdl.html
CodeWraith 24-Nov-20 6:13am
   
Thanks. As it seems now, only SOAP 1.2 allows you to forget about SOAPactions or leave them empty. I still get weird response values, but that may be due to the declaration of these objects. They were generated from the customer's WSDL after all. At least the client and the server now agree on how to call the web methods.
Jörgen Andersson 24-Nov-20 6:15am
   
I would ask the customer if they had a reason to leave them empty, or if they just didn't care, in which case you can set them to whatever.
CodeWraith 24-Nov-20 6:28am
   
I have a documentation from the customer's interface. Maybe I will find something in there that helps me make sense of the response objects. Leaving the only property (another object or structure) at null, no matter what I put into it on the server side, defeats the purpose of a response object.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900