0
votes

I'm developing an aplication and when I imported the wsdl webservices with jaxws wsimport, this abstracted the complex types for Java classes. But it abstracted as classes just the body response and I need to get some data in the webservice response header, How can I get access to the webservice response header using jaxws on the client side?

Code:

    //Instance of Service   
    SessionCreateRQService sessionCreateService = new SessionCreateRQService();
    SessionCreatePortType requestSessionCreate = sessionCreateService.getSessionCreatePortType();

    //Get datas to request header 
    MessageHeader messageHeader = getMessageHeader(MESSAGE_ID, timestamp, URI_PartyId, Services.SessionCreateRQ ,Actions.SessionCreateRQ);
    Holder<MessageHeader> holderMessage = new Holder<MessageHeader>(messageHeader);

    //Get another datas to request header 
    Security security = getSecuritySessionCreateRQ();
    Holder<Security> holderSecurity = new Holder<>(security);

    //Get datas to quest body
    SessionCreateRQ body = new SessionCreateRQ();
    body.setPOS(getPOS());

    //Call the websevice and receiving the response.
    // ---->>>I need access the response webservice header here.<<-----
    SessionCreateRS sessionCreateRS = requestSessionCreate.sessionCreateRQ(holderMessage, holderSecurity, body);

Thank you.

1

1 Answers

0
votes

You need to add a handler in the client to do so

you can find more details here