Jai’s Weblog – Tech, Security & Fun…

Tech, Security & Fun…

  • Jaibeer Malik

    Jaibeer Malik
  • View Jaibeer Malik's profile on LinkedIn
  • Subscribe

  • Feedburner

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 29 other followers

  • Archives

  • Categories

  • Stats

    • 379,210
  • Live Traffic

Tips&Tricks: How to set web service url end point

Posted by Jai on October 11, 2013

A quick tip to change the url end point for a webservice. Keep the web service end point as configurable to be able to use it under different test/demo/live environments.

WebClientTestService service = new WebClientTestService() ;
String serviceEndPoint = "http://localhost/soap/testEndPoint";
Map<String, Object> context = ((BindingProvider)service).getRequestContext();
//Set service end point
context.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, serviceEndPoint);

Keep the service end point etc. configurations as system property or pick from properties file to make it configuration in the system to be able to use different test/demo/live environment without changes the client code.

One Response to “Tips&Tricks: How to set web service url end point”

  1. Thanks for your information. I have a question. What should if system is taking time during Service object creation.
    WebClientTestService service = new WebClientTestService() ;

    I want to set TIMEOUT during this time.

    How can di that? Please help if possible.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: