To try it out, you could get EPR from proxy and use it for Dispatch.
EndpointReference epr = ((BindingProvider) proxy).getEndpointReference();
service.createDispatch(epr, ...);
To see the xml fragment you could use epr.writeTo(...)
Jitu
Andreas Loew wrote:
> All,
>
> sorry, there's another open issue (from June 21st) for which I did not
> receive any replies:
>
> Can someone please provide (or point to) an example (XML fragment or
> code) of how to pass a proper W3CEndpointReference into the
>
> service.createDispatch(EndpointReference, ...)
>
> method?
>
> I cannot figure out how the EPR must look like in order *NOT* to
> receive the following stack trace:
>
> Caused by: javax.xml.ws.WebServiceException: EPR does nt have
> EndpointName in the Metadata
> at
> com.sun.xml.ws.client.WSServiceDelegate.getPortNameFromEPR(WSServiceDelegate.java:527)
>
> at
> com.sun.xml.ws.client.WSServiceDelegate.addPortEpr(WSServiceDelegate.java:468)
>
> at
> com.sun.xml.ws.client.WSServiceDelegate.createDispatch(WSServiceDelegate.java:372)
>
> at javax.xml.ws.Service.createDispatch(Service.java:437)
>
> Thanks again & best regards,
>
> Andreas
>