0

I try to do something with SharePoint 2010 SOAP and get HTTP 415 for any POST to MY_SERVER/_vti_bin/Lists.asmx while MY_SERVER/_vti_bin/ListData.svc works well. Simple call to MY_SERVER/_vti_bin/Lists.asmx from browser is also OK.

Can anyone advice how to troubleshot the problem. I have no access to the server (e.g. to check whether some folder or file exists).

The complete code is (C++ cpprest API)

http_client_config config;
config.set_credentials(credentials(U("Login"), U("Password")));
http_client client(web::uri::encode_uri(U("http://server:port/site")), config);

http_request request(methods::POST);
request.set_request_uri(web::uri::encode_uri(U("/_vti_bin/lists.asmx")));

request.set_body(U("\
    <?xml version=\"1.0\" encoding=\"utf-8\"?>\
    <soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">\
        <soap:Body>\
            <GetListCollection xmlns=\"http://schemas.microsoft.com/sharepoint/soap/\" />\
        </soap:Body>\
    </soap:Envelope>"),
    U("application/soap+xml"));

client.request(request);
2

first point of call is to note the error that your getting.

404 means its sending back a not found exception.

so now you know that the service is returning a message that it cant find somthing, the next step is to make sure that /_vti_bin/ListData.asmx actually exists? you can check by going to the site through the url in your browser!

MY_SERVER/_vti_bin/ListData.asmx 

ok so if you get a 404 error on the page than its true that sharepoint cant find it as it doesnt exist.

if it does exist than check to make sure that your web api is up and running, you can do this by a quick check to make sure the stadard list service is up and running by going to the following url:

MY_SERVER/_vti_bin/lists.asmx

whats the outcome? if it does exist but your getting a 404 than i presume that your custom asmx is not configured correctly as it should of shown up if you directly whent to it using the browser. If it is up and not showing you a 404 on the browser and within the code you can check and connect to that asmx webservice than can you post some of the code that its doing so we can see where it could be going wrong?

  • Thank you for response. Yes, I've checked those cases and added it to question. Also I was mistaken - I use standard lists.asmx – andrii Dec 17 '14 at 10:23
  • After changing to List.asmx I get HTTP 415 "Unsupported media type". CPPREST automatically adds "; charset=utf-8" to "application/soap+xml" and creates header for body length. Should I somehow describe the response format? – andrii Dec 17 '14 at 10:34
1

I found a problem!

For SOAP 1.1 (namespaces "soap") it's needed to use "text/xml" content type, while for SOAP 1.2 (namespaces "soap12") - "application/soap+xml"

Thank you, ali Sharepoint for guiding me to the troubleshoot way, particularly looking at the same address through the browser

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.