delphisoapdelphi-xe2remobjects

Suppress RemObjects SOAP error "content type was not expected"


Trying to make a simple client that consumes a web service using RemObjects SDK, imported the WSDL, all good, however, when I try to execute a method that returns a string, I get the following error:

Project Project1.exe raised exception class EIdHTTPProtocolException with message 'HTTP/1.1 415 Cannot process the message because the content type 'text/xml; charset=utf-8' was not the expected type 'application/soap+xml; charset=utf-8'.'.

Don't know why this exception is raised, but I need to bypass it.


Solution

  • The content type application/soap+xml indicates that the Web Service uses SOAP 1.2.

    The media type for SOAP 1.2 has changed from text/xml used in SOAP 1.1 to application/soap+xml.

    (From http://hadleynet.org/marc/whatsnew.html#S3.7.1)

    The error message indicates that that your SOAP client library uses SOAP 1.1 instead of SOAP 1.2. (A WSDL does not indicate which SOAP version is used by the server, so 'manual' configuration is required.)

    Verify if your client library supports SOAP 1.2 (which was introduced around 2001), and activate it.