First of all, thanks for such a great module! I've successfully created my own SOAP webservice using the soap_server and services modules. It's all working great except for one thing, which not all soap clients are able to cope with. The problem is there is more than one "Content-Type" header created, and they have conflicting definitions.
The nuSOAP library creates a text/xml Content-Type header, however Drupal also creates a Content-Type header of type text/html in _drupal_bootstrap_full(). As the nuSOAP library doesn't use the drupal_set_header() function to set the header, the header set by Drupal during bootstrap isn't overridden by soap_server and so we end up with two different definitions. Some of the clients connecting in just look at the first Content-Type definition, which will always be text/html as that's set first during bootstrap.
The attached patch adds in a call to drupal_set_header() which allows both of the defined Content-Type lines to be of type text/xml. It doesn't prevent the header being sent twice, but it is at least one step closer and fixes the problem for all of my soap clients.
Cheers,
Stella
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 583506_soap_server_headers.patch | 538 bytes | ilo |
| soap_server_xml_content_type_header.patch | 432 bytes | stella |
Comments
Comment #1
ilo commentedOh, I just got confused with other issue regarding soap headers, and now I realize they are totally different. Thanks stella, didn't notice the header stuff.
Comment #2
stella commentedthough, i think the patch might need a bit more work, as iirc it produces the wrong content-type header on the list of services page.
Comment #3
ilo commentedI didn't get that error, but I got other when requesting for the html content on services/soap (a list of services description).
Ok, limiting the header to only post requests on services/soap endpoint (clearly a soap request). Wsdl request (http://host/services/soap&wsdl) returns appropiate content type, but charset in use is: charset=ISO-8859-1 (corresponding to charset encoding of the returned xml).
Other implementation would be to check if soap_server() returns xml and only set the header there.. not sure which one applies better, because anyway we will have two content type headers.
Comment #4
ilo commentedCommitted to DRUPAL-6--1.
Thanks stella for the report and the detective task :)