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

  • SEARCH
  • Home
  • 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 6539975
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:55:22+00:00 2026-05-25T10:55:22+00:00

I need to deploy the same web service for each customer. This @javax.jws.WebService uses

  • 0

I need to deploy the same web service for each customer. This @javax.jws.WebService uses Object as method arguments and return types (resulting in <xs:anyType/> in wsdl). Each instance of web service is deployed along with customer’s jar on the classpath. This jar has known structure and contains JAXB-annotated classes which client wants to handle via my service.

The problem is that when customer passes an instance of his class as method agrument, server-side JAXB context unmarshals it into some strange xerces dom node because (as I understand it) during the deployment time only @WebMethod and @WebService annotations were scanned which, as was already said, are all dealing with Object only.

Simply speaking, I need to hint JAXB at WEB-INF/lib/customer_classes_14586.jar which means taking some control over JAXBContext creation during JAX-WS deployment.

Is it possible at all?

Server-specific solutions are fine (glassfish 3.1 with metro ws stack)

UPDATE

I’ve missed one thing that might be important: I deploy these web services as OSGI bundles at runtime via web admin console. When I press deploy button new jar is programmatically built up from customer library, webservice class, wsdl and manifests. So I could interfere in build process and provide hinting information at this point of time if this helps.

  • 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-05-25T10:55:23+00:00Added an answer on May 25, 2026 at 10:55 am

    First option is @UsesJAXBContext annotation. More info here: Specify JAXB Packages in SLSB and JAX-WS

    I haven’t tested it cause when I found this annotation I’ve been already halfway towards other solution which might be helpful for others.

    The key is using @WebServiceProvider instead of @WebService, a bit low-level but simple:

    @WebServiceProvider(
      wsdlLocation = "WEB-INF/wsdl/injector.wsdl"
    )
    @ServiceMode(value = Service.Mode.PAYLOAD)
    public class InjectorService implements Provider<Source> {
      private Unmarshaller unmarshaller;
    
      @Override
      public Source invoke(Source request) {
        try {
          DOMResult requestDom = new DOMResult();
          Transformer trans = TransformerFactory.newInstance().newTransformer();
          trans.transform(request, requestDom);
          Node requestNode = requestDom.getNode();
          // Get the operation name node.
          Node operationNode = requestNode.getFirstChild();
          // Get the parameter node.
          Node parameterNode = operationNode.getFirstChild();
          // Unmarshal
          JAXBElement<Object> element = unmarshaller.unmarshal(parameterNode, Object.class);
          Object unmarshalled = element.getValue();          
    
          //  Handling customer object and response ......
        } catch (Exception e) {
          throw new RuntimeException("Endpoint error", e);
        }
      }
    
      protected Class[] getCustomerClasses() {
        // return customer classes somehow
      }
    
      @PostConstruct
      public void init() throws Exception {
        JAXBContext jbc = JAXBContext.newInstance(getCustomerClasses());
        unmarshaller = jbc.createUnmarshaller();
      }
    }
    

    That’s it. Customer classes can be obtained from classpath, bundle context or whatever.

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

Sidebar

Related Questions

I Need to deploy a web application on Stratos server. I went through this
I am trying to deploy a web service, written in VS2008 on a brand
I need to develop a WCF server (basically a web service which will eventually
I have 6 servers that i need to deploy my ASP.NET web application to.
I have 1 vs2008 solution that i need to deploy for 3 clients. Each
I need to deploy a webservice as part of a DotNetNuke 4.x module that
I need to deploy a production version of a web application. So far, I've
I need to deploy only the referenced classes in a very limited environment as
I need to deploy a set of configuration files to a hundred or more
I need to deploy a Windows Forms application using ClickOnce deployment. (VS2008, .NET 3.5)

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.