dev@jax-ws.java.net

Re: BindingProvider.getEndpointReference(...)

From: Doug Kohlert <Doug.Kohlert_at_Sun.COM>
Date: Mon, 09 Oct 2006 12:00:45 -0700

Atcually,
This method is not only used to check what the proxy/dispatch is talking
to. It can be used as an EPR factory for any endpoint, especially in
the dispatch case. You could do the following in some type of EPR
registry application.

Service service = Service.create(wsdlDoclocation, serviceName);
service.addPort(portName, .SOAPBinding.SOAP11HTTP_BINDING, endpointAddress);

Dispatch dispatch = service.createDispatch(portName, Source,
Service.Mode.PAYLOAD);
EndpointReference epr = dispatch.getEndpointReference(refParams);

Also, there could be some out-of-band agreement that certain reference
parameters be used. By simply calling
BindingProvider.getEPR() you are not modifying the EPR for the current
proxy/dispatch, you are simply getting an EPR for it that can be used
elsewhere.

Kohsuke Kawaguchi wrote:

>
> Maybe I'm speaking too late, but BindingProvider has the following
> method:
>
> public <T extends EndpointReference> T getEndpointReference(
> Class<T> clazz, Element... referenceParameters);
>
> ... but I don't understand the semantics of this. Specifically the
> reference parameters.
>
> The reference parameters are what the service gives to clients. From
> client's point of view, it's really just a cookie that doesn't make
> any sense. It's only understood by the service when it sends them to
> the service.
>
> As I understand it, BindingProvider is a client-side interface. It's
> the base interface for dispatches and proxies. So as a client
> programmer, I don't understand why I'm asked to pass in reference
> parameters, which is something only the server knows (If this is a
> server-side interface, I could see why.)
>
> This is a method that a developer uses to check what this
> proxy/dispatch is talking to, right? It should be just:
>
> public EndpointReference getEndpointReference();
> public <T extends EPR> T getEndpointReference(Class<T>);
>