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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T17:21:44+00:00 2026-05-16T17:21:44+00:00

Using code that was generated with wsimport , can the service endpoint be overridden

  • 0

Using code that was generated with wsimport, can the service endpoint be overridden without having to regenerate the code?

I have written a simple java webservice, following are the steps:

  1. I compile the java class and generate a war file
  2. Deploy the war file to my app server (tomcat)
  3. Access the WSDL via the URL e.g. localhost:8080/service/helloservice?wsdl
  4. use the URL with wsimport.bat to generate client classes for example: wsimport http://localhost:8080/service/helloservice?Wsdl
  5. I use those classes in my client app to call the service

The problem is that is the service is deployed on an app server running on port other than 8080, the communication between client and service never happens. I am trying to know what is the best way to create stubs that does not have server and port hardcoded in the stub used by the client.

  • 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-16T17:21:45+00:00Added an answer on May 16, 2026 at 5:21 pm

    Your client can set the end-point in the service “port” at runtime via the BindingProvider interface.

    Consider the JAX-WS client in this JAX-WS tutorial. Another way to write this code would be:

    HelloService service = new HelloService();
    Hello port = service.getHelloPort();
    BindingProvider bindingProvider = (BindingProvider) port;
    bindingProvider.getRequestContext().put(
          BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
          "http://foo:8086/HelloWhatever");
    String response = port.sayHello(name);
    

    Caveat: I haven’t downloaded the tutorial code and tested this code against it.

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

Sidebar

Related Questions

I have some code that is using SyncEnumerator. As you can see here ,
I have a Windows form that's generated using code (including buttons and what not).
I have some link buttons that I'm using CSS3 gradient code that I generated
I have some code using Lucene that leaves the default conjunction operator as OR,
I have a WCF web service using wsHttpBinding that I am consuming from a
I have written some custom R code that wraps a third-party binary. One of
As weird as it may sound, the code that generated pdf using Prawn gem
We have some code that was generated, mostly likely by svcutil from an XML
I'm using svcutil to generate proxy code for the following web service endpoint which
Using Java 1.6 wsimport I generated source from a WSDL for a web service.

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.