soapheader - How to get Soap Header at server side with Spring WS Client -
i new web service development. developing web service using spring ws. need add soap header in request below code add header in request @ client side.
getwebservicetemplate() .sendsourceandreceivetoresult(source, new webservicemessagecallback(){ public void dowithmessage(webservicemessage message) throws ioexception, transformerexception{ saajsoapmessage soapmessage = (saajsoapmessage) message; soapheaderelement messageid = soapmessage.getsoapheader().addheaderelement(new qname("http://www.w3.org/2005/08/addressing", "messageid", "wsa")); messageid.settext("test security token"); } },result);
how header out of request in server side class?
i have used eclipse axis plugin generate wsdl class skeleton. using spring 2.
i got solution. code have written in method of bindingimpl of server skeleton :
messagecontext messagecontext = messagecontext.getcurrentcontext(); soapheader header = (soapheader) messagecontext.getcurrentmessage().getsoapheader(); header.getchildelements();
it give list of soapheaderelement. , can take element name , value.
thank of you... :)
Comments
Post a Comment