FaqWebServiceLocationJa

接続するWeb サービスの場所を実行時に変更するには

JAX-WS クライアント (Java EE 5)

    ...
    //get an instance of port
    test.CounterService port = service.getCounterServicePort();
    //change the wsdl location
    ((BindingProvider) port).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "http://new.server.com/some/path/toWs?wsdl");
    ...

JAX-RPC クライアント (J2EE 1.4)

    ...
    //get an instance of port
    test.CounterService port = service.getCounterServicePort();
    //change the wsdl location
    ((javax.xml.rpc.Stub) port)._setProperty(javax.xml.rpc.Stub.ENDPOINT_ADDRESS_PROPERTY, "http://new.server.com/some/path/toWs?wsdl")
    ...

---

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo