You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Bharath Thippireddy <BT...@primavera.com> on 2008/05/05 20:07:07 UTC

WS-Addressing CXF Client API Problem

I am trying to use the CXF Addressing Feature and i see the following 
exception while constructing the client object.Is this the right way to 
get ws-addressing running on the JAXWS client?

         ClientProxyFactoryBean factory = new ClientProxyFactoryBean();
        factory.setServiceClass(AuthenticationService.class);
        factory.setAddress(Authentication_SERVICE_URL);
        factory.getFeatures().add(new WSAddressingFeature());
        AuthenticationService client = 
(AuthenticationService)factory.create();

Exception in thread "main" java.lang.IllegalArgumentException: 
com.primavera.ws.p6.authentication.AuthenticationService is not an 
interface
        at java.lang.reflect.Proxy.getProxyClass(Proxy.java:362)
        at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:581)
        at org.apache.cxf.frontend.ClientProxyFactoryBean.create(
ClientProxyFactoryBean.java:105)
        at com.primavera.wsclient.WSAddressingClient.main(
WSAddressingClient.java:25)

thanks and regards,
Bharath

Re: Couple of questions with CXF 2.1

Posted by Daniel Kulp <dk...@apache.org>.
On May 7, 2008, at 12:58 PM, Bharath Thippireddy wrote:

> Thanks Dan.We will give that a try by migrating to 2.1.
>
> I have a couple of questions/issues before we do that.
>
> 1)With CXF version 2.0.3 ,we see that the CXF Parser treats the  
> spaces/new
> line charaters between the soap message elements as text nodes.Is  
> this an
> encoding problem ?.Is it reported as a bug earlier.

I believe that per spec, they HAVE to be treated that way.   In 2.0.5  
and earlier we DIDN'T do that for the whitespace between the  
<soap:body> element and the first child element and that caused all  
kinds of problems with ws-security as signatures have to include that  
whitespace as part of the signature.

In anycase, I guess the question is: how is that a problem?

> 2)Is CXF 2.1 compatable with the single spring.jar file that comes  
> with
> Spring 2.0.4 instead of having 4 different jars.

Should work fine.    The only issue MIGHT be if any of the spring  
stuff pulls in hibernate/cglib in which case you will need to do some  
tweeking to get a good version of asm to be used.

Dan



>
> thanks and regards,
> Bharath
>
> Daniel Kulp <dk...@apache.org> wrote on 05/06/2008 05:23:16 PM:
>
>>
>> Any chance of upgrading to CXF 2.1?   The ws-addressing stuff is
>> "built in" to JAX-WS 2.1 and thus is more standard and, in general, a
>> bit easier to configure.
>>
>>
>> In your case, however, you probably need to do:
>>
>>      WSAddressingFeature wsa = new WSAddressingFeature();
>>     wsa.setUsingAddressingAdvisory(true);
>>      factory.getFeatures().add(wsa);
>>
>> That will force the ws-adressing stuff to on.  By default, it looks  
>> in
>> the wsdl for addressing policies.  If not there, it won't send the
>> headers.     The above will force it on.
>>
>>
>> Dan
>>
>>
>> On May 6, 2008, at 10:38 AM, Bharath Thippireddy wrote:
>>
>>> Hi Willem,
>>>
>>> com.primavera.ws.p6.authentication.AuthenitcationService is a class
>>> generated by the java2wsdl tool cxf provides.
>>> I am trying to get the cxf addressing work with our application
>>> deployed
>>> on the tomcat.I am following the CXF documentation ,and see the
>>> exception
>>> below.
>>>
>>> http://cwiki.apache.org/CXF20DOC/ws-addressing.html
>>>
>>> thanks and regards,
>>> Bharath
>>>
>>> Willem Jiang <wi...@gmail.com> wrote on 05/05/2008 08:45:43  
>>> PM:
>>>
>>>> Hi Bharath,
>>>>
>>>> Does the com.primavera.ws.p6.authentication.AuthenticationService
>>>> be an
>>>> interface class?
>>>> If not , the ClientProxyFactoryBean can't create a proxy for you.
>>>>
>>>> Willem
>>>> Bharath Thippireddy wrote:
>>>>> I am trying to use the CXF Addressing Feature and i see the
>>>>> following
>>>>> exception while constructing the client object.Is this the right  
>>>>> way
>>> to
>>>>> get ws-addressing running on the JAXWS client?
>>>>>
>>>>>       ClientProxyFactoryBean factory = new
>>> ClientProxyFactoryBean();
>>>>>      factory.setServiceClass(AuthenticationService.class);
>>>>>      factory.setAddress(Authentication_SERVICE_URL);
>>>>>      factory.getFeatures().add(new WSAddressingFeature());
>>>>>      AuthenticationService client =
>>>>> (AuthenticationService)factory.create();
>>>>>
>>>>> Exception in thread "main" java.lang.IllegalArgumentException:
>>>>> com.primavera.ws.p6.authentication.AuthenticationService is not an
>>>>> interface
>>>>>      at java.lang.reflect.Proxy.getProxyClass(Proxy.java:362)
>>>>>      at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:581)
>>>>>      at org.apache.cxf.frontend.ClientProxyFactoryBean.create(
>>>>> ClientProxyFactoryBean.java:105)
>>>>>      at com.primavera.wsclient.WSAddressingClient.main(
>>>>> WSAddressingClient.java:25)
>>>>>
>>>>> thanks and regards,
>>>>> Bharath
>>>>>
>>>>
>>>>
>>
>> Daniel Kulp
>> dkulp@apache.org
>> http://www.dankulp.com/blog
>>
>>
>>
>>

Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog




Couple of questions with CXF 2.1

Posted by Bharath Thippireddy <BT...@primavera.com>.
Thanks Dan.We will give that a try by migrating to 2.1.

I have a couple of questions/issues before we do that.

1)With CXF version 2.0.3 ,we see that the CXF Parser treats the spaces/new 
line charaters between the soap message elements as text nodes.Is this an 
encoding problem ?.Is it reported as a bug earlier.


2)Is CXF 2.1 compatable with the single spring.jar file that comes with 
Spring 2.0.4 instead of having 4 different jars.

thanks and regards,
Bharath

Daniel Kulp <dk...@apache.org> wrote on 05/06/2008 05:23:16 PM:

> 
> Any chance of upgrading to CXF 2.1?   The ws-addressing stuff is 
> "built in" to JAX-WS 2.1 and thus is more standard and, in general, a 
> bit easier to configure.
> 
> 
> In your case, however, you probably need to do:
> 
>        WSAddressingFeature wsa = new WSAddressingFeature();
>       wsa.setUsingAddressingAdvisory(true);
>        factory.getFeatures().add(wsa);
> 
> That will force the ws-adressing stuff to on.  By default, it looks in 
> the wsdl for addressing policies.  If not there, it won't send the 
> headers.     The above will force it on.
> 
> 
> Dan
> 
> 
> On May 6, 2008, at 10:38 AM, Bharath Thippireddy wrote:
> 
> > Hi Willem,
> >
> > com.primavera.ws.p6.authentication.AuthenitcationService is a class
> > generated by the java2wsdl tool cxf provides.
> > I am trying to get the cxf addressing work with our application 
> > deployed
> > on the tomcat.I am following the CXF documentation ,and see the 
> > exception
> > below.
> >
> > http://cwiki.apache.org/CXF20DOC/ws-addressing.html
> >
> > thanks and regards,
> > Bharath
> >
> > Willem Jiang <wi...@gmail.com> wrote on 05/05/2008 08:45:43 PM:
> >
> >> Hi Bharath,
> >>
> >> Does the com.primavera.ws.p6.authentication.AuthenticationService 
> >> be an
> >> interface class?
> >> If not , the ClientProxyFactoryBean can't create a proxy for you.
> >>
> >> Willem
> >> Bharath Thippireddy wrote:
> >>> I am trying to use the CXF Addressing Feature and i see the 
> >>> following
> >>> exception while constructing the client object.Is this the right way
> > to
> >>> get ws-addressing running on the JAXWS client?
> >>>
> >>>         ClientProxyFactoryBean factory = new
> > ClientProxyFactoryBean();
> >>>        factory.setServiceClass(AuthenticationService.class);
> >>>        factory.setAddress(Authentication_SERVICE_URL);
> >>>        factory.getFeatures().add(new WSAddressingFeature());
> >>>        AuthenticationService client =
> >>> (AuthenticationService)factory.create();
> >>>
> >>> Exception in thread "main" java.lang.IllegalArgumentException:
> >>> com.primavera.ws.p6.authentication.AuthenticationService is not an
> >>> interface
> >>>        at java.lang.reflect.Proxy.getProxyClass(Proxy.java:362)
> >>>        at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:581)
> >>>        at org.apache.cxf.frontend.ClientProxyFactoryBean.create(
> >>> ClientProxyFactoryBean.java:105)
> >>>        at com.primavera.wsclient.WSAddressingClient.main(
> >>> WSAddressingClient.java:25)
> >>>
> >>> thanks and regards,
> >>> Bharath
> >>>
> >>
> >>
> 
> Daniel Kulp
> dkulp@apache.org
> http://www.dankulp.com/blog
> 
> 
> 
> 

Re: WS-Addressing CXF Client API Problem

Posted by Daniel Kulp <dk...@apache.org>.
Any chance of upgrading to CXF 2.1?   The ws-addressing stuff is  
"built in" to JAX-WS 2.1 and thus is more standard and, in general, a  
bit easier to configure.


In your case, however, you probably need to do:

       WSAddressingFeature wsa = new WSAddressingFeature();
      wsa.setUsingAddressingAdvisory(true);
       factory.getFeatures().add(wsa);

That will force the ws-adressing stuff to on.  By default, it looks in  
the wsdl for addressing policies.  If not there, it won't send the  
headers.     The above will force it on.


Dan


On May 6, 2008, at 10:38 AM, Bharath Thippireddy wrote:

> Hi Willem,
>
> com.primavera.ws.p6.authentication.AuthenitcationService is a class
> generated by the java2wsdl tool cxf provides.
> I am trying to get the cxf addressing work with our application  
> deployed
> on the tomcat.I am following the CXF documentation ,and see the  
> exception
> below.
>
> http://cwiki.apache.org/CXF20DOC/ws-addressing.html
>
> thanks and regards,
> Bharath
>
> Willem Jiang <wi...@gmail.com> wrote on 05/05/2008 08:45:43 PM:
>
>> Hi Bharath,
>>
>> Does the com.primavera.ws.p6.authentication.AuthenticationService  
>> be an
>> interface class?
>> If not , the ClientProxyFactoryBean can't create a proxy for you.
>>
>> Willem
>> Bharath Thippireddy wrote:
>>> I am trying to use the CXF Addressing Feature and i see the  
>>> following
>>> exception while constructing the client object.Is this the right way
> to
>>> get ws-addressing running on the JAXWS client?
>>>
>>>         ClientProxyFactoryBean factory = new
> ClientProxyFactoryBean();
>>>        factory.setServiceClass(AuthenticationService.class);
>>>        factory.setAddress(Authentication_SERVICE_URL);
>>>        factory.getFeatures().add(new WSAddressingFeature());
>>>        AuthenticationService client =
>>> (AuthenticationService)factory.create();
>>>
>>> Exception in thread "main" java.lang.IllegalArgumentException:
>>> com.primavera.ws.p6.authentication.AuthenticationService is not an
>>> interface
>>>        at java.lang.reflect.Proxy.getProxyClass(Proxy.java:362)
>>>        at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:581)
>>>        at org.apache.cxf.frontend.ClientProxyFactoryBean.create(
>>> ClientProxyFactoryBean.java:105)
>>>        at com.primavera.wsclient.WSAddressingClient.main(
>>> WSAddressingClient.java:25)
>>>
>>> thanks and regards,
>>> Bharath
>>>
>>
>>

Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog




Re: WS-Addressing CXF Client API Problem

Posted by Bharath Thippireddy <BT...@primavera.com>.
The ws-addressing sample works.But when i try the same code in my jax-ws 
client,it doesnt send the addressing headers to the server(tomcat).I do 
not see them on the TCPMonitor either.Not sure if this is a bug like we 
had with cxf soap with attachment clients earlier(dropping the 
attachment).

                BindingProvider bp = (BindingProvider)port;

            // get Message Addressing Properties instance
            AddressingBuilder builder = AddressingBuilder.
getAddressingBuilder();
            AddressingProperties maps = builder.newAddressingProperties();

            // set MessageID property
            AttributedURIType messageID =
                WSA_OBJECT_FACTORY.createAttributedURIType();
            messageID.setValue("urn:uuid:" + System.currentTimeMillis());
            maps.setMessageID(messageID);

            // associate MAPs with request context
            Map<String, Object> requestContext =  bp.getRequestContext();
           requestContext.put(CLIENT_ADDRESSING_PROPERTIES, maps);



thanks and regards,
Bharath
Bharath Thippireddy <BT...@primavera.com> wrote on 05/06/2008 
10:38:55 AM:

> Hi Willem,
> 
> com.primavera.ws.p6.authentication.AuthenitcationService is a class 
> generated by the java2wsdl tool cxf provides.
> I am trying to get the cxf addressing work with our application deployed 

> on the tomcat.I am following the CXF documentation ,and see the 
exception 
> below.
> 
> http://cwiki.apache.org/CXF20DOC/ws-addressing.html
> 
> thanks and regards,
> Bharath
> 
> Willem Jiang <wi...@gmail.com> wrote on 05/05/2008 08:45:43 PM:
> 
> > Hi Bharath,
> > 
> > Does the com.primavera.ws.p6.authentication.AuthenticationService be 
an 
> > interface class?
> > If not , the ClientProxyFactoryBean can't create a proxy for you.
> > 
> > Willem
> > Bharath Thippireddy wrote:
> > > I am trying to use the CXF Addressing Feature and i see the 
following 
> > > exception while constructing the client object.Is this the right way 

> to 
> > > get ws-addressing running on the JAXWS client?
> > >
> > >          ClientProxyFactoryBean factory = new 
> ClientProxyFactoryBean();
> > >         factory.setServiceClass(AuthenticationService.class);
> > >         factory.setAddress(Authentication_SERVICE_URL);
> > >         factory.getFeatures().add(new WSAddressingFeature());
> > >         AuthenticationService client = 
> > > (AuthenticationService)factory.create();
> > >
> > > Exception in thread "main" java.lang.IllegalArgumentException: 
> > > com.primavera.ws.p6.authentication.AuthenticationService is not an 
> > > interface
> > >         at java.lang.reflect.Proxy.getProxyClass(Proxy.java:362)
> > >         at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:581)
> > >         at org.apache.cxf.frontend.ClientProxyFactoryBean.create(
> > > ClientProxyFactoryBean.java:105)
> > >         at com.primavera.wsclient.WSAddressingClient.main(
> > > WSAddressingClient.java:25)
> > >
> > > thanks and regards,
> > > Bharath
> > > 
> > 
> > 

Re: WS-Addressing CXF Client API Problem

Posted by Bharath Thippireddy <BT...@primavera.com>.
Hi Willem,

com.primavera.ws.p6.authentication.AuthenitcationService is a class 
generated by the java2wsdl tool cxf provides.
I am trying to get the cxf addressing work with our application deployed 
on the tomcat.I am following the CXF documentation ,and see the exception 
below.

http://cwiki.apache.org/CXF20DOC/ws-addressing.html

thanks and regards,
Bharath

Willem Jiang <wi...@gmail.com> wrote on 05/05/2008 08:45:43 PM:

> Hi Bharath,
> 
> Does the com.primavera.ws.p6.authentication.AuthenticationService be an 
> interface class?
> If not , the ClientProxyFactoryBean can't create a proxy for you.
> 
> Willem
> Bharath Thippireddy wrote:
> > I am trying to use the CXF Addressing Feature and i see the following 
> > exception while constructing the client object.Is this the right way 
to 
> > get ws-addressing running on the JAXWS client?
> >
> >          ClientProxyFactoryBean factory = new 
ClientProxyFactoryBean();
> >         factory.setServiceClass(AuthenticationService.class);
> >         factory.setAddress(Authentication_SERVICE_URL);
> >         factory.getFeatures().add(new WSAddressingFeature());
> >         AuthenticationService client = 
> > (AuthenticationService)factory.create();
> >
> > Exception in thread "main" java.lang.IllegalArgumentException: 
> > com.primavera.ws.p6.authentication.AuthenticationService is not an 
> > interface
> >         at java.lang.reflect.Proxy.getProxyClass(Proxy.java:362)
> >         at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:581)
> >         at org.apache.cxf.frontend.ClientProxyFactoryBean.create(
> > ClientProxyFactoryBean.java:105)
> >         at com.primavera.wsclient.WSAddressingClient.main(
> > WSAddressingClient.java:25)
> >
> > thanks and regards,
> > Bharath
> > 
> 
> 

Re: WS-Addressing CXF Client API Problem

Posted by Willem Jiang <wi...@gmail.com>.
Hi Bharath,

Does the com.primavera.ws.p6.authentication.AuthenticationService be an 
interface class?
If not , the ClientProxyFactoryBean can't create a proxy for you.

Willem
Bharath Thippireddy wrote:
> I am trying to use the CXF Addressing Feature and i see the following 
> exception while constructing the client object.Is this the right way to 
> get ws-addressing running on the JAXWS client?
>
>          ClientProxyFactoryBean factory = new ClientProxyFactoryBean();
>         factory.setServiceClass(AuthenticationService.class);
>         factory.setAddress(Authentication_SERVICE_URL);
>         factory.getFeatures().add(new WSAddressingFeature());
>         AuthenticationService client = 
> (AuthenticationService)factory.create();
>
> Exception in thread "main" java.lang.IllegalArgumentException: 
> com.primavera.ws.p6.authentication.AuthenticationService is not an 
> interface
>         at java.lang.reflect.Proxy.getProxyClass(Proxy.java:362)
>         at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:581)
>         at org.apache.cxf.frontend.ClientProxyFactoryBean.create(
> ClientProxyFactoryBean.java:105)
>         at com.primavera.wsclient.WSAddressingClient.main(
> WSAddressingClient.java:25)
>
> thanks and regards,
> Bharath
>