Results 1 to 1 of 1

Thread: How to extract HTTPHeader from WebServiceTemplate.marshalSendAndReceive() Response

  1. #1
    Join Date
    Dec 2012
    Posts
    2

    Default How to extract HTTPHeader from WebServiceTemplate.marshalSendAndReceive() Response

    Hello, I am relatively new to Web Services and I want to know how to extract HTTP cookies from a soap request.
    I am using spring WS clent and XMLBeans to marshal / un-marshal. My code snippet:

    Code:
    SoapActionCallback sac = new SoapActionCallback(soapAction){
    	public void doWithMessage(WebServiceMessage msg){
    		SoapMessage smsg = (SoapMessage) msg;
    		smsg.setSoapAction(soapAction);
    	}
    };		
    LoginResponseDocument response = (LoginResponseDocument) webServiceTemplate.marshalSendAndReceive(requestPayload, sac);
    Responses:

    Code:
    System.out.println("responseXmlText: "+response.getLoginResponse().xmlText());
    System.out.println("responseLoginSuccess: "+response.getLoginResponse().validate());
    <xml-fragment><v200:LoginResult xmlns:v200="http://asp.net/ApplicationServices/v200">true</v200:LoginResult></xml-fragment>
    true

    QUESTION:
    How do I extract HTTPHeader/cookies (authentication ticket) from webServiceTemplate response as I do not see any HTTP context available. If not so, is there any workaround? An example would greatly help.

    Thank you.
    Last edited by heynoor; Dec 6th, 2012 at 09:09 PM. Reason: more clarity

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •