Hi Shannon,

Application usage of ServiceDelegateAccessor and the CXF-specific
ServiceImpl was just a stop-gap for CXF 2.0.x as we were still stuck
on JAX-WS 2.0.

It was only in JAX-WS 2.1 that a standard JAX-WS API was introduced to
allow an EPR-specific proxy be created via Service.getPort(). Support
for JAX-WS 2.1 is available in CXF from version 2.1 onwards.

What version of CXF are you using? If 2.0.x, you'll need to upgarde.
If you're already on 2.1.x or 2.2.x, then just switch over to the
standard API[1].

An example of the standard API usage can be seen in the
corba/bank_ws_addressing demo[2].

Cheers,
Eoghan


[1] 
http://java.sun.com/javase/6/docs/api/javax/xml/ws/Service.html#getPort(javax.xml.ws.EndpointReference,%20java.lang.Class,%20javax.xml.ws.WebServiceFeature...)
[2] 
http://svn.apache.org/viewvc/cxf/trunk/distribution/src/main/release/samples/corba/bank_ws_addressing/src/cxf/client/Client.java?view=markup



2009/4/28 Shannon Hastings <[email protected]>:
> I am trying to use ERP¹s to maintain some state from client to server.  When
> I use the client code generated from cxf wsdl2java I notice there is a
> method for creating a port that accepts a javax EndpointReference.  However,
> when I use the JaxWS client factory I cannot seem to find anyway to set the
> EPR of the type javax EndpointReference.   I can only find a method that
> accepts a cxf EPR data type which his not compatible with the standard jaxws
> standard EndpointReference data type.
>
> For example, I create (or retrieve from a service) an javax EPR:
>     W3CEndpointReference epr = <new EPR from somewhere>;   //standard EPR
> data type now used with JAXB
>
> Then I use the cxf generated client and the ServiceDelegateAccesspr to use
> that EPR to create a client/port:
>     ServiceImpl test = ServiceDelegateAccessor.get(new
> TestServiceService());     TestService testService =
> test.getPort(epr,TestService.class);
>
> However, now I want to use JaxWS factories to create this client using the
> following code:
>        ClientProxyFactoryBean factory = new JaxWsProxyFactoryBean();
> factory.getClientFactoryBean().setEndpointReference(epr);  //this line does
> not compile because the EPR is not compatible with the signature
>        TestService ts = (TestService) factory.create();
>
>
> Any insight on this would be helpful.
>
>
>
> Thanks
> Shannon
>
>

Reply via email to