Class DualProtocolSaajSoapMessageFactory

java.lang.Object
swiss.trustbroker.wstrust.service.DualProtocolSaajSoapMessageFactory
All Implemented Interfaces:
org.springframework.ws.soap.SoapMessageFactory, org.springframework.ws.WebServiceMessageFactory

public class DualProtocolSaajSoapMessageFactory extends Object implements org.springframework.ws.soap.SoapMessageFactory
Workaround to support both SOAP 1.1 and 1.2.
This class determines the SOAP version via content-type header and dispatches to a SaajSoapMessageFactory configured for the matching SOAP version.
The SOAP version from the inbound is stored in a thread local for use in the outbound (where we have no information). If no outbound is sent due to an exception, the thread local is not cleared, but it is always set on the inbound. SOAP 1.2 is used for an outbound without previous inbound.
  • Constructor Details

    • DualProtocolSaajSoapMessageFactory

      public DualProtocolSaajSoapMessageFactory(@Qualifier("wsTrustSoapClient11") org.springframework.ws.soap.saaj.SaajSoapMessageFactory messageFactorySoap11, @Qualifier("wsTrustSoapClient12") org.springframework.ws.soap.saaj.SaajSoapMessageFactory messageFactorySoap12)
  • Method Details

    • setSoapVersion

      public void setSoapVersion(org.springframework.ws.soap.SoapVersion version)
      Specified by:
      setSoapVersion in interface org.springframework.ws.soap.SoapMessageFactory
    • createWebServiceMessage

      public org.springframework.ws.soap.saaj.SaajSoapMessage createWebServiceMessage()
      Specified by:
      createWebServiceMessage in interface org.springframework.ws.soap.SoapMessageFactory
      Specified by:
      createWebServiceMessage in interface org.springframework.ws.WebServiceMessageFactory
    • createWebServiceMessage

      public org.springframework.ws.soap.saaj.SaajSoapMessage createWebServiceMessage(InputStream inputStream) throws IOException
      Specified by:
      createWebServiceMessage in interface org.springframework.ws.soap.SoapMessageFactory
      Specified by:
      createWebServiceMessage in interface org.springframework.ws.WebServiceMessageFactory
      Throws:
      IOException
    • toString

      public String toString()
      Overrides:
      toString in class Object