Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Retrieve Soap header  RSS feed

 
Vijay Narula
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do I retrieve the user credentials and a bunches of other properties from the
soap header in the soap request at the skeleton service level java code generated from the WSDL?

Would this information stored in the MessageContext (I believed) be available at this level? thanks
 
Kumar Raja
Ranch Hand
Posts: 548
2
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vijay Narula wrote:How do I retrieve the user credentials and a bunches of other properties from the
soap header in the soap request at the skeleton service level java code generated from the WSDL?

Would this information stored in the MessageContext (I believed) be available at this level? thanks


You can get hold of SOAPMessageContext like below



But I have to admit that, I could not get this working. I'm getting ClassCastException
java.lang.ClassCastException: com.sun.xml.ws.server.EndpointMessageContextImpl cannot be cast to javax.xml.ws.handler.soap.SOAPMessageContext

But on googling on this topic, I do see that this is a valid casting, but not sure why it is failing for me.
 
Lingan Rajan
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vijay
I would configure a soap handler , retrieve the values , set them in the MessageContext and later retrieve in the Service Impl.

Lingan
 
Ren Unternaehrer
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kumar Raja wrote:
Vijay Narula wrote:How do I retrieve the user credentials and a bunches of other properties from the
soap header in the soap request at the skeleton service level java code generated from the WSDL?

Would this information stored in the MessageContext (I believed) be available at this level? thanks


You can get hold of SOAPMessageContext like below



But I have to admit that, I could not get this working. I'm getting ClassCastException
java.lang.ClassCastException: com.sun.xml.ws.server.EndpointMessageContextImpl cannot be cast to javax.xml.ws.handler.soap.SOAPMessageContext

But on googling on this topic, I do see that this is a valid casting, but not sure why it is failing for me.


Hy, I have the same problem now. Get the EndpointMessageContextImpl instaed of the SOAPMessage I would like to get. Did you get any further with this? The other question is if I would put my variables in the context in the handler which is the SOAPMessageConext, how do I retrieve them if I am not even able to retrieve the SOAPMessageContext? Thanks for any help on this.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!