• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Handler: how to send information to ejbs ?

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    I have tested it and it works.

    Thanks.

    Olivier
     
    Don't get me started about those stupid light bulbs.
    reply
      Bookmark Topic Watch Topic
    • New Topic