Skip to main content

Changing ENDPOINT_ADDRESS_PROPERTY

2 replies [Last post]
fuerte
Offline
Joined: 2004-11-22
Points: 0

Using NetBeans 5 beta, I added a web service client to my test project, and it works:

<br />
        try {<br />
            WicomTMI.TMI tMI = new WicomTMI.TMI_Impl();<br />
            WicomTMI.TMISoap tMISoap = tMI.getTMISoap();<br />
            System.out.printf("getLogPath: %s\n", tMISoap.getLogPath());<br />
        } catch(javax.xml.rpc.ServiceException ex) {<br />
            // TODO handle ServiceException<br />
        } catch(java.rmi.RemoteException ex) {<br />
            // TODO handle remote exception<br />
        }<br />

But how do I change the web service URL? I see that it is defined here:
<br />
    public TMISoap_Stub(HandlerChain handlerChain) {<br />
        super(handlerChain);<br />
        _setProperty(ENDPOINT_ADDRESS_PROPERTY, "http://dskpesonha/TMI/TMI.asmx");<br />
    }<br />

There is no _setProperty in TMI interface. NetBeans has JAX RPC 1.6 it seems. I wonder if there is any workaround, and if this has been fixed in later versions?

Thanks, Harri

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
jitu
Offline
Joined: 2003-06-14
Points: 0

The TMISoap_Stub object is javax.xml.rpc.Stub, so you can set the ENDPOINT_ADDRESS_PROPERTY. The port object can be cast to TMISoap_Stub.

fuerte
Offline
Joined: 2004-11-22
Points: 0

Yes, thanks, I figured that out eventually. Unfortunately the interface is a bit useless, and casting is ugly.