开发者

How to change endpoints on web service

开发者 https://www.devze.com 2023-04-01 22:58 出处:网络
I am working on calling web service client. Currently, I am connecting to the test environment. In order to connect to production environment I have to connect to production environment. My process in

I am working on calling web service client. Currently, I am connecting to the test environment. In order to connect to production environment I have to connect to production environment. My process in terms of connecting to the test environment is as follows.

  1. Copy WSDL to local directory
  2. Run wsdl2java to generate domain objects and other annotated classes. There is one with @WebServiceClient and a couple with @WebService
  3. From there I am just using the generated objects to call these classes.

What I don't get is where I would change the endpoints for the service call once we go to produc开发者_C百科tion environment.


I believe wsdl2Java generate a Proxy class with setEndpointAddress() where you could change the target URL. This method should be located in the generated ServiceLocator.


Also, if you check the Service constructor, on the generated code I have, one of the constructors take in a URL as it's arguments.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号