Forum Discussion

francisco_garci's avatar
francisco_garci
Occasional Contributor
9 years ago
Solved

Getting SOAPAction error

Hi,

 

I'm trying to execute methods from our web services using javascript, but I'm getting the error on the response:

 

<script>// function writeContent(){ var c = document.getElementById("container"); c[("innerText" in c) ? "innerText" : "textContent"] = document.getElementById("dataIsland").innerHTML; }window.onload = writeContent; // </script> soap:ClientSystem.Web.Services.Protocols.SoapException: Unable to handle request without a valid action parameter. Please supply a valid soap action. at System.Web.Services.Protocols.Soap12ServerProtocolHelper.RouteRequest() at System.Web.Services.Protocols.SoapServerProtocol.RouteRequest(SoapServerMessage message) at System.Web.Services.Protocols.SoapServerProtocol.Initialize() at System.Web.Services.Protocols.ServerProtocol.SetContext(Type type, HttpContext context, HttpRequest request, HttpResponse response) at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing)

<?xml version="1.0"?>
<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: Unable to handle request without a valid action parameter. Please supply a valid soap action.
   at System.Web.Services.Protocols.Soap12ServerProtocolHelper.RouteRequest()
   at System.Web.Services.Protocols.SoapServerProtocol.RouteRequest(SoapServerMessage message)
   at System.Web.Services.Protocols.SoapServerProtocol.Initialize()
   at System.Web.Services.Protocols.ServerProtocol.SetContext(Type type, HttpContext context, HttpRequest request, HttpResponse response)
   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>
 
I tried using the following line: 
 
 XmlHttpRequest.setRequestHeader("SOAPAction", "http://skywards.com/Mercator.CRIS.WS/GetCorporateProfile");
 
but if I add the line, I get the following error:
 
<script>// function writeContent(){ var c = document.getElementById("container"); c[("innerText" in c) ? "innerText" : "textContent"] = document.getElementById("dataIsland").innerHTML; }window.onload = writeContent; // </script> soap:ClientSystem.Web.Services.Protocols.SoapException: Server did not recognize the value of HTTP Header SOAPAction: http://skywards.com/Mercator.CRIS.WS/GetCorporateProfile. 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.ServerProtocol.SetContext(Type type, HttpContext context, HttpRequest request, HttpResponse response) at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing)
<?xml version="1.0"?>
<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: http://skywards.com/Mercator.CRIS.WS/GetCorporateProfile.
   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.ServerProtocol.SetContext(Type type, HttpContext context, HttpRequest request, HttpResponse response)
   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>
 
Can you guys please help out?
  • Alex,

     

    I rechecked my code, and I noticed it was making the requests to a wrong WSDL. Thank you for your help. Lets close this one.

4 Replies

  • francisco_garci's avatar
    francisco_garci
    Occasional Contributor

    Alex,

     

    I rechecked my code, and I noticed it was making the requests to a wrong WSDL. Thank you for your help. Lets close this one.

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     

    Basically, the error means that the web service did not recognize the requested action and replied with some error text to the client.

    If the web service is the same as in the http://community.smartbear.com/t5/Functional-Web-Testing/Cannot-assign-an-object-to-a-variant-array-in-a-Web-Service/td-p/102637 thread, then I could take a look. Otherwise, again, either the url of th web service or the contents of the WebServices folder of the test project is needed.

  • francisco_garci's avatar
    francisco_garci
    Occasional Contributor

    Hi Alex,

     

    This is a whole different WSDL, so let me elaborate so you can get the whole picture. We have a Web Service Aplication server, which contains 3 different WSDLs and I currently have two issues with 2 of them:

     

    - First issue, the web methods that use arrays, wont create objects inside each entry of the array. I used the code that Test Complete generates.

     

    - Second issue, the web methods of one WSDL in particular, when the request is sent, the response contains a SOAP fault error that asks for a SOAP Action. The code used to construct, send and recieve the response is the same I use for the other 2 WSDLs tests.

     

    For this thread in particular, my issue is with the SOAP Fault error asking for a SOAP Action. I can share with you the URL of the 3 WSDLs so you can take a look and identify either something that is missing from my code or other issues. I know this is maybe something hard to solve, but I currently have tried everything and I cant seem to find a solution. Please let me know how can I share the WSDLs with you.

     

    Thanks in advance.