Web Service Adding an Additional Slash to a SOAPAction

I am using SoapUI to test the .NET web service that will be used by the Java client application.

When I connect my web service to SoapUI, but update my WSDL location and call one of the pre-installed test scripts, the web service crashes using the following code

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Body> <soap:Fault> <faultcode>soap:Client</faultcode> <faultstring>System.Web.Services.Protocols.SoapException: Server did not recognize the value of HTTP Header SOAPAction: urn:mycode:us:gu:das:supplierengagement:v02:SupplierEngagement:/AppointSupplier. at System.Web.Services.Protocols.Soap11ServerProtocolHelper.RouteRequest() at System.Web.Services.Protocols.SoapServerProtocol.RouteRequest(SoapServerMessage message) at System.Web.Services.Protocols.SoapServerProtocol.Initialize() at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean&amp; abortProcessing) </faultstring> <detail/> </soap:Fault> </soap:Body> </soap:Envelope> 

As you can see from the above error, the problem is that the SOAPAction parameter has an extra slash.

I use the following class attribute:

 <WebService(Namespace:= "urn:mycode:us:gu:das:supplierengagement:v02:SupplierEngagement:AppointSupplier")> 

and the following method call attribute:

 <WebMethod(MessageName:="appointSupplierRq")> 

Of these .Net adds a slash.

It should be possible to remove the slash that will be automatically generated.

+6
source share
2 answers

From a code review, creating test samples, etc., I don't see a problem. Yes, I see an additional slash that you mention in your post, but this is by design. Thus, the ASMX service notes that the method inside the class must be executed.

There is now something out of sync from your SOAP message and your WebService \ WebMethod attributes. Your SOAP header action should be

urn:mycode:us:gu:das:supplierengagement:v02:SupplierEngagement:AppointSupplier/appointSupplierReq

not

urn:mycode:us:gu:das:supplierengagement:v02:SupplierEngagement:/AppointSupplier

This makes me think that you did not update the SOAP UI project for the new generated WSDL. Try creating a new project in the SOAP user interface by specifying the WSDL file of the ASMX web service, for example.

http://<web host>/SupplierEngagement.asmx?wsdl

And run the testing methods. If this does not solve the problem, send (how to edit) the full class for the asmx of the SupplierEngagement file (you can omit the contents of the method), since we are really interested in the full setup.

0
source

I had a similar problem, which finally was related to server-side permissions, which provided a slash error, but other steps can be taken to diagnose the problem.

Can the SoapAction from SOAP REQUEST be changed by the interaction between .NET and JAVA or a network / substructure proxy

0
source

Source: https://habr.com/ru/post/958312/


All Articles