I guess you're working with JWSDP 1.x to be using ENDPOINT_ADDRESS_PROPERTY?
When you set up the endpoint address, you are just setting a property in one
of the stub objects. No comms takes place. It's only when you call a method
that your code attempts to contact the server, so you can't actually verify
the server when setting the address.
If you move to JAX-WS 2.x it uses a different model for establishing the
connection, which includes reading the WSDL at the time the connection object
is created. So you will catch an exception at this point if the server details
are wrong. It's also easier to code, because you simply pass the service URL
to the service proxy class' constructor.
HTH
Rick Jones
Quoting Daniel Saavedra <dsaavedra_at_visual-tools.com>:
> Hi All,
>
> I'm implementing a webservice client that sets the endpoint address with
> the ENDPOINT_ADDRESS_PROPERTY after creating a Service Stub that points
> to the localhost. I have no problems when the IP and port are correctly
> set up. I even set the "com.sun.xml.ws.request.timeout" property to a
> certain timeout, so I get SocketTimeoutException when my Server doesn't
> reply on the specified time.
>
> However, when the IP and port are wrongly choosen, so no Server is up in
> that address, I get no Exception when changing the
> ENDPOINT_ADDRESS_PROPERTY. Moreover, when a Service method is executed
> the timeout doesn't correspond to the one set with
> "com.sun.xml.ws.request.timeout" but it last around three minutes and
> throws a ConnectionException. I guess this is because my client is
> unable to establish any TCP connection with the Server (as there is no
> server in that ip address).
>
> So my question is if there is any property I could change to set a
> different timeout for the connection instead of the three minutes. Also,
> I would like to know if there's any way to force the change of
> ENDPOINT_ADDRESS_PROPERTY to throw an Exception when no server is
> available in that address.
>
> Thanks,
>
> Daniel.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jax-ws.dev.java.net
> For additional commands, e-mail: users-help_at_jax-ws.dev.java.net
>
>