Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Reading soap header  RSS feed

 
akhil achuthan
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Im in need to read some info from SOAP header as well... What I have is a POJO class with @WebService and @Soap declaration and a few @WebMethod methods. In this case how will i read the soap header the web service takes me directly to my methods...

If this type of web service cannot be used, then please tell me what the alternative is???

Thanks
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The first result I got in a Google search for "jax-ws accessing SOAP headers" was highly relevant. It looked like it contained all the information necessary to implement this.
 
akhil achuthan
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Got it..... The link was really useful....


Our web service class has to look like.. The hashmap in the 'myTestMethod' method will have all the header details.......

@WebService(serviceName = "MyService")
@SOAPBinding(style = SOAPBinding.Style.RPC)
public class TestWebServiceClass
{
@Resource
WebServiceContext ctx;

@WebMethod
public void myTestMethod(){
HashMap map = ctx.getMessageContext().get("javax.xml.ws.http.request.headers");
// implementation code
}
}


 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!