SOAP Client Port Confusion

前端 未结 1 493
广开言路
广开言路 2021-01-28 05:24

I\'m using wsimport to generate SOAP client classes. The problem, however is that while the server is running on port 8080, there is a proxy that makes it be reachable from the

相关标签:
1条回答
  • 2021-01-28 06:06

    If your client code gets the WSDL successfully then you can specify the endpoint address explicitly with something like this:

    ExampleService exampleService = new ExampleService();
    Example example = exampleService.getExamplePort();
    BindingProvider bindingProvider = (BindingProvider) example;
    bindingProvider.getRequestContext().put(
        BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
        "http://ws.someservice.com:80/soap/ExampleBean");
    

    That last line overrides the port URL in the WSDL, which is the internal one.

    I have more details on using wsimport here: http://shrubbery.homeip.net/c/display/W/Consuming+a+Web+Service+with+Java+6+and+JAX-WS

    0 讨论(0)
提交回复
热议问题