Server did not recognize the value of HTTP Header SOAPAction

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 bakert+web@gmail.com – I wouldn’t wish my four hours on anyone!

68 thoughts on “Server did not recognize the value of HTTP Header SOAPAction

  1. Jim

    You can also get this if you call the wrong method. For example, you get error if you call sites.asmx for method GetAllSubWebCollection, instead of calling webs.asmx. Server did not recognize the value of HTTP Header SOAPAction: http://schemas.microsoft.com/sharepoint/soap/GetAllSubWebCollection.

  2. Anonymous

    I’ve to set mimeheaders to get rid of this error message. MimeHeaders mimeHeader = message.getMimeHeaders(); //change header’s attribute mimeHeader.setHeader(“Content-Type”, “text/xml”); mimeHeader.setHeader(“SOAPACTION”, “http://www.abc.com/ProcedureName”);

  3. Pingback: Exactly What You Write Makes a Lot of Difference - bluebones.net

  4. Pingback: Server did not recognize the value of HTTP Header SOAPAction | siddi khadar vali pothuganti

  5. Anonymous

    this worked for me: MimeHeaders mimeHeader = soapMessage.getMimeHeaders(); mimeHeader.setHeader(“SOAPACTION”, “https://xyz.123.com/xmlservices/GetBaked”); mimeHeader.setHeader(“Content-Type”, “text/xml; charset=utf-8″); mimeHeader.setHeader(“Connection”, “keep-alive”);

  6. Pingback: Server did not recognize the value of HTTP Header SOAPAction - C# Solution - Developers Q & A

  7. AB

    I have the same problem on a template (.xsn) that opens in InfoPath, so it’s not a web form. The problem occurs after I have moved the whole sub site to a new place. What to do now? The SharePoint site data connections’ URLs seem ok, but if I try to modify them (to verify that they are connected), Infopath is unable to connect to the site – even though the URL seems to be quite ok…

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>