views:

5771

answers:

2
   [SoapRpcMethod(Action = "http://cyberindigo/TempWebService/InsertXML",
    RequestNamespace = "http://cyberindigo/TempWebService/Request",
    RequestElementName = "InsertXMLRequest",
    ResponseNamespace = "http://cyberindigo/TempWebService/Response",
    ResponseElementName = "InsertXMLResponse",
    Use = System.Web.Services.Description.SoapBindingUse.Literal)]

    [WebMethod]
    public string InsertXML(string Jobs)
    {
        return "Hi";
    }

The Problem when I am accessing it using XMLHttpRequest it gives following error Server did not recognize the value of HTTP Header SOAPAction: http://Cyberindigo/TempWebService/InsertXML

+1  A: 

I had similar issue. To debug the problem, I've run Wireshark and capture request generated by my code. Then I used XML Spy trial to create a SOAP request (assuming you have WSDL) and compared those two.

This should give you a hint what goes wrong.

ya23
Other tools you could use to do the same thing would be Fiddler and/or SoapUI.
joshua.ewer
+2  A: 

Seeing as nowhere on the internet can I find an explanation of this error I thought I’d share the fruits of my long search for this bug.

It means (at least in my case) that you are accessing a web service with SOAP and passing a SOAPAction parameter in the HTTP request that does not match what the service is expecting.

I got in a pickle because we moved a web service from one server to another and thus I changed the “namespace” (don’t get confused between web service namespaces and .net namespaces) in the calling C# file to match the new server. But the server doesn’t care about the actual web reality of http //yournamespace.com/blah it only cares that you send it what you have said you are expecting on the server. It doesn’t care if there’s actually anything there or not.

So basically the web service was moved from http ://foo.com/servicename to http ://bar.com/servicename but the “namespace” of the web service stayed as http ://foo.com/servicename because no one changed it.

And that only took about 4 hours to work out!

If you’re having a similar problem but can’t work what I’m saying here, feel free to mail me on [email protected] – I wouldn’t wish my four hours on anyone!

Sam
Source: http://bluebones.net/2003/07/server-did-not-recognize-http-header-soapaction/
Peter