Question: Missing SOAPAction Header

Aug 27, 2012 at 11:26 AM

Hi, second post and unfortunately a bit more urgent ...

I'm struggling with getting the library up and running. This is one of the requests I make: 

// Fetch the workspaces
var Workspaces = [];
$().SPServices({
    operation: "GetAllSubWebCollection",
    webURL: "http://mycompany.com/sites/myteamsite",
    async: false,
    completefunc: function (xData, Status) {
        $(xData.responseXML).find ("Webs > Web").each (function () {
            var web = $(this);
            console.log (web.attr('Title'));
            Workspaces.push(web.attr('Title'));
        });
    }
});

However, the server returns:
<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.Soap11ServerProtocolHelper.RouteRequest()
   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>

I've done some research and it appears to have something to do with the configuration of the firewall:

Even when the sysadmin lifted the firewall, the error didn't seem to go away. I've also tried some different configurations (asynchronous/synchronous calls, etc.), but to no avail. Is it possible it has something to do with the library? Or is somebody else able to confirm the issue with the firewall? I'm forced to use IE8, so I'm a bit limited in my debugging capabilities ...

Thanks in advance anyway; I'm sure I must have overlooked something silly, but I'm really starting to run out of ideas ...

Aug 27, 2012 at 12:47 PM

Update

Never mind; I found out that this is a bug in the WSops configuration object ...

For anyone else who might have the same problem: changing

WSops.GetAllSubWebCollection = [WEBS, false];

to

WSops.GetAllSubWebCollection = [WEBS, true];

Solves the issue.

Coordinator
Sep 11, 2012 at 2:40 PM

samvv:

The operations which only read should have needs_SOAPAction set to false; writes require true. I'm not sure what's unique about your environment, but this has worked in every case I know of. Glad you figured it out for your own situation, though.

Sorry for the delayed response, but I was on holiday. 

M.

Sep 11, 2012 at 11:04 PM

sympmarc:

No problem, I should have been more carefull before posting anything: apparently the server I was targeting used SharePoint 2003 instead of 2007!

Apologies,

Sam

Coordinator
Sep 12, 2012 at 1:03 AM

No worries!

M.