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 6121513
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:47:34+00:00 2026-05-23T15:47:34+00:00

I have JAX-WS style web service client that was auto-generated with the NetBeans IDE.

  • 0

I have JAX-WS style web service client that was auto-generated with the NetBeans IDE.

The generated proxy factory (extends javax.xml.ws.Service) delegates proxy creation to the various Service.getPort methods. The application that I am maintaining instantiates the factory and obtains a proxy each time it calls the targetted service.

Creating the new proxy factory instances repeatedly has been shown to be expensive, given that the WSDL documentation supplied to the factory constructor, an HTTP URI, is re-retrieved for each instantiation.

We had success in improving the performance by caching the WSDL. But this has ugly maintenance and packaging implications for us.

I would like to explore the suitability of caching the proxy factory itself. Is it safe, e.g., can two different client classes, executing on the same JVM and targetting the same web service, safely use the same factory to obtain distinct proxy objects (or a shared, reentrant one)?

I’ve been unable to find guidance from either the JAX-WS specification nor the javax.xml.ws API documentation. The factory-proxy multiplicity is unclear to me. Having Service.getPort rather than Service.createPort does not inspire confidence.

  • 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-23T15:47:34+00:00Added an answer on May 23, 2026 at 3:47 pm

    you can 10000 ports in fraction of second, so it is a good idea to store service.
    It is also possible to store the wsdl local and change the endppoint later.

    example peopleWsdl & peopleEndpoint:
    file:/C:/Users/richard/Workspaces/OSB/SyllabusMailing/war/WEB-INF/wsdl/people/People_2_0.wsdl
    http://myserver:8011/domain/sem/People_2_0?wsdl

        private static DSSeMPeople service = null;  
    private DsSemPeoplePort getPort() throws Exception
    {   
        String wsdl = AppUtil.getWebXmlParameter( "peopleWsdl" );
        String endpoint = AppUtil.getWebXmlParameter( "peopleEndpoint" );
        if( wsdl==null || "".equals(wsdl) ) {
            wsdl = endpoint;
        }
    
        try { 
            if( service==null ) {
    
                log.info( "create peopleService from wsdl: " + wsdl );              
                log.info( "use peopleService endpoint: " + (endpoint==null?"(from wsdl)":endpoint) );
    
                URL url = new URL( wsdl );              
                service = new DSSeMPeople( url, new QName( "http://www.tudelft.nl/domain/sem/people_2_0/", "DS_SeM_People") );
            }
    
            DsSemPeoplePort port = service.getDsSemPeoplePort();
    
            // set endpoint
            if( endpoint!=null && !"".equals(endpoint) && !endpoint.equals(wsdl) ) {
    
                BindingProvider provider = (BindingProvider) port;
                provider.getRequestContext().put( BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpoint );
            }
    
            return port;
    
        } catch (Exception e) {
    
            String msg = "Failed to connect to people webservice. ";
            log.error( msg );
            throw new Exception( msg, e );
        }       
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a JAX-RPC (Java) web service that needs to return a complex polymorphic
I have a JAX-RPC web service that I am attempting to consume using Spring.
I have a JAX-RS web service (using jersey) that accepts a JAXB object as
I have a JAX-WS-driven web service whose WSDL we generate a web service client
I have a Spring application that uses JAX-WS to consume another web service. Everything
I have a project that contains both the ws client and service (JAX-WS). Is
I have a JAX-WS web service that has been running in a production environment
i have local WSDL file. i tried to create JAX-WS Web service client which
I have a CXF JAX-WS web service operation named diagnosticPing that accepts two params,
I have an AXIS2/JAX-WS web service using a code first implementation (yes I know,

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.