Search code examples
jakarta-eesoapsaaj

SOAP Namespace with http URI


During an upgrade of a 3rd party SOAP API, the vendor has changed their responses to return

<env:Envelope xmlns:env='https://schemas.xmlsoap.org/soap/envelope/'>...

instead of previously

<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>... 

Note the change from http to https.

Is this valid in any way?

Background: Our Java client code tries to check for a SOAPFault via a call through com.sun.xml.messaging.saaj.soap.MessageImpl.getSOAPBody().hasFault() (saaj-impl-1.3.jar) which fails because the JavaEE standard specifies URI_NS_SOAP_ENVELOPE as the http URI. When the API's https response is returned, the URIs don't match and

Jan 16, 2017 3:47:05 PM com.sun.xml.messaging.saaj.soap.SOAPPartImpl lookForEnvelope
SEVERE: SAAJ0513: Unable to create envelope from given source because the namespace was not recognized

is returned.

As a workaround, could the SAAJ library behaviour be overridden to force use the http SOAP URI?

Thank you.


Solution

  • According to the SOAP 1.1 specification:

    The SOAP envelope has the namespace identifier "http://schemas.xmlsoap.org/soap/envelope/"

    Therefore the message is not a valid SOAP message. Since SAAJ is designed to follow the SOAP specifications, it won't be able to process that message.