We have a .NET 2.0 web service (.ASMX file). This web service is being called by a Java client and they are not passing in a SoapAction header.
This causes our web service to fail with the error: : “Server did not recognize the value of HTTP Header SOAPAction: .”
There is no chance that I can convince the development team in charge of the calling Java client to include a SoapAction header.
Is there anyway to resolve this problem on my end?
Can I prevent .NET from throwing this error when the SoapAction is missing? Can I direct the call to the correct WebMethod programmatically?
Something like this psuedo-code,
if (Header.SoapAction == String.Empty) then MyWebMethod();
According to the SOAP 1.1 specification this is required of HTTP clients.
Source http://www.w3.org/TR/2000/NOTE-SOAP-20000508/#_Toc478383528
From a quick Google it seems this is a common issue with Java and Axis, but there is some debate whether it is required. Could this help you convince the Java developers that they need to implement the header?
Edit:
The correct URI for your
SoapActionhttp header is defined in the WSDL document.Goto http://mydomain.com/myservice.asmx?wsdl
Look for the wsdl:operation element for the method you are calling, it should have a child element soap:operation which has a attribute called soapaction, the URI in there is the one you should use. In a webservice i tested it looks like the namespace followed by / and the method name as follows.