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.