This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Handler: how to send information to ejbs ?

 
Olivier Mocquais
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have developed a handler which extracts xml information from the soap message.

I want to send this information to the ejb which implements a web service.

Maybe I can store this information (the xml fragment stored as a string) in the context.

Is it possible ?

How does the ejb find the information in the context ?

Thanks for your help.

Olivier
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
javax.xml.rpc.handler.MessageContext
javax.xml.rpc.handler.soap.SOAPMessageContext

  • Save the bean's sessionContext in the bean's setSessionContext(SessionContext ctx) method.
  • In the handler: In the handleRequest(MessageContext msgCtx) method you are handed a MessageContext. Store your info in an Object and save it with msgCtx.setProperty(String name, Object value);
  • In the bean: SOAPMessageContext msgCtx = (SOAPMessageContext) sessionContext.getMessageContext();
  • Then use msgCtx.getProperty(String name) to retrieve the info.

  •  
    Olivier Mocquais
    Greenhorn
    Posts: 8
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    I have tested it and it works.

    Thanks.

    Olivier
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic