1 Reply Latest reply on Jan 26, 2011 9:50 PM by Anil Saldanha

    federation.api.wstrust how to set Soap version?

    Gordon Young Newbie

      Hi all,

       

      I am working on integrating with a Microsoft implementation of WS-Trust STS provider. With WSTrustClient()  am I able to set the soap version?

      The WCF service expects v 1.2 judging by the error:

       

      HTTP status code 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'.

       

      Thank you,

       

      ~Gordon

        • 1. federation.api.wstrust how to set Soap version?
          Anil Saldanha Master

          Sorry for the late reply.   WSTrustClient uses the JAXWS dispatch call.  I am guessing that is what makes the content type to be text/xml.

           

          the WCF endpoint is probably looking for SOAP based clients.

           

          Try with SOAPConnection from the SAAJ API.

           

          Something like:

          MessageFactory messageFactory = MessageFactory.newInstance();

          SOAPMessage soapMessage = messageFactory.createMessage();

          //Create the SOAPMessage somehow

          SOAPConnectionFactory connectFactory = SOAPConnectionFactory.newInstance();

          SOAPConnection connection = connectFactory.createConnection();

          //Send it across the wire

          URL url = new URL(endpoint);

          SOAPMessage response = connection.call(soapMessage, url);

           

          I am neither a fan nor an expert of Web Services.