Announcement Announcement Module
Collapse
No announcement yet.
How to extract HTTPHeader from WebServiceTemplate.marshalSendAndReceive() Response Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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, 09:09 PM. Reason: more clarity
Working...
X