Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8877229
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T19:24:57+00:00 2026-06-14T19:24:57+00:00

I need to dynamically assign EntityManagers to my beans at runtime based on the

  • 0

I need to dynamically assign EntityManagers to my beans at runtime based on the contents of a soap header. My plan is to extract the info from the header with a SOAPHandler and then store it in the request scope. I have a method @Producer that I envisage accessing this request scope, examining the stored variable, and returning the appropriate entitymanager.

(The EntityManagers refer to different DB’s with the same structure, but different data).

MY PROBLEM IS THIS: How do I access the request context to store the name (on the SOAPHandler side) and then, again, retrieve the request context to retrieve the name?

Any help appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T19:24:59+00:00Added an answer on June 14, 2026 at 7:24 pm

    To answer my own question:

    Stick it in the SOAPMessageContext, as follows:

    context.put(“VARIABLE_KEY”, whateverIWantObject );

    context.setScope(“VARIABLE_KEY”, Scope.APPLICATION);

    (The Scope.APPLICATION is important).

    In the service layer you can then get the message context from the web service context, which you can inject in; the message context will then have your object:

    @Resource WebServiceContext webContext;

    ObjectType theObject =
    (ObjectType) webContext.getMessageContext().get(“VARIABLE_KEY”);

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We need to dynamically create (i.e. during runtime, via code-behind) UserControls and position them
I have a variable from which I need to dynamically generate nodes <xsl:template match=banner_discount_1
We need to dynamically spin up EC2 instances for new customers, and assign them
I need to dynamically populate a table footer from a JSON data source. Here
I need to create a CSS stylesheet class dynamically in JavaScript and assign it
If I need to assign a click function dynamically, is there a way to
we have a problem [cit.] I need to assign a callback dynamically within a
I need to loop through Components and assign an event handler (for example Dynamically
I have an HTML button that I need to dynamically assign to an AS3
I am trying to use batch scripting to create and assign variables dynamically based

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.