You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Christian Vest Hansen <ka...@gmail.com> on 2007/10/24 15:48:12 UTC

how clients handle changing wsdls

If you generate a java client from a wsdl, and then add an operation
to the wsdl but forget to update the client code - how does CXF handle
that situation?

Will the client crash or blissfully hum along (but withut being able
to invoke the new operation)?

I'm asking because it might influence decisions and policies one might
define for managing change and backwards compatibility when working
with CXF web services and clients.

-- 
Venlig hilsen / Kind regards,
Christian Vest Hansen.

Re: how clients handle changing wsdls

Posted by James Mao <ja...@iona.com>.
If you just add an operation, it will/should not failed the client,
you can modify the hello_world demo in cxf samples, and give it a try
(Before you run the client after you modify the wsdl, make sure to 
remove the depends="build" in the client target, so it'll not generate 
the client code)

James

> If you generate a java client from a wsdl, and then add an operation
> to the wsdl but forget to update the client code - how does CXF handle
> that situation?
>
> Will the client crash or blissfully hum along (but withut being able
> to invoke the new operation)?
>
> I'm asking because it might influence decisions and policies one might
> define for managing change and backwards compatibility when working
> with CXF web services and clients.
>
>   

Re: how clients handle changing wsdls

Posted by Christian Vest Hansen <ka...@gmail.com>.
Thanks Daniel.


2007/10/30, Daniel Kulp <dk...@apache.org>:
>
>
> I just committed a fix for this on trunk.     It logs a warning for each
> unavailable operation, then removes the operations from the ServiceModel
> so they won't be invokable.
>
> Dan
>
>
> On Monday 29 October 2007, Daniel Kulp wrote:
> > There's a JIRA logged someplace about this:
> > http://issues.apache.org/jira/browse/CXF-940
> >
> > I'd like to get it logged on client side, but fail on server side.
> > That's a bit more complicated since the code in question is completely
> > shared between the two and it really doesn't know what it's
> > targetting.
> >
> > I suppose we could just log a warning.   If a service is created
> > without a backing method and someone tries to invoke it, a fault would
> > be raised.
> >
> > Dan
> >
> > On Thursday 25 October 2007, Christian Vest Hansen wrote:
> > > I recall seing a stack trace like that, which prompted my query.
> > >
> > > But if it, in this particular use case, always works if the client
> > > refer directly to the ?wsdl from the online service, then it's just
> > > something to keep in mind when creating clients.
> > >
> > > However, this confuses me:
> > > > I think if you still use the old wsdl to create the service , the
> > > > client can still work.
> > >
> > > (...)
> > >
> > > > On the client side if I use the ?wsdl which is generated by CXF to
> > > > create the service ,
> > > > the client  can still work.
> > >
> > > This sounds contradictory to me, given that one of thos scenarios
> > > resulted in the stack trace you provided.
> > > Could you clarify?
> > >
> > > 2007/10/25, Willem Jiang <ni...@iona.com>:
> > > > Hi Christian,
> > > >
> > > > I think if you still use the old wsdl to create the service , the
> > > > client can still work.
> > > >
> > > > I just did a quick test for your case by remove the WSDL2Java
> > > > generated SEI's method.
> > > > It can reproduce your case.
> > > > On the client side if I use the ?wsdl which is generated by CXF to
> > > > create the service ,
> > > > the client  can still work. But if I specified the orginal WSDL ,
> > > > I got the below exception.
> > > >
> > > > Caused by:
> > > > org.apache.cxf.service.factory.ServiceConstructionException: Could
> > > > not find a matching method for operation
> > > > {http://apache.org/hello_world_soap_http}greetMeOneWay
> > > >     at
> > > > org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initia
> > > >li zeWSDLOperations(ReflectionServiceFactoryBean.java:323) at
> > > > org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeWSD
> > > >LO perations(JaxWsServiceFactoryBean.java:184) at
> > > > org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildS
> > > >er viceFromWSDL(ReflectionServiceFactoryBean.java:214) at
> > > > org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initia
> > > >li zeServiceModel(ReflectionServiceFactoryBean.java:269) at
> > > > org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create
> > > >(R eflectionServiceFactoryBean.java:146) at
> > > > org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsS
> > > >er viceFactoryBean.java:91) at
> > > > org.apache.cxf.frontend.AbstractEndpointFactory.createEndpoint(Abs
> > > >tr actEndpointFactory.java:94) at
> > > > org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean
> > > >.j ava:50) at
> > > > org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyF
> > > >ac toryBean.java:89) at
> > > > org.apache.cxf.jaxws.ServiceImpl.createPort(ServiceImpl.java:372)
> > > > at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:271)
> > > >
> > > > Any thoughts?
> > > >
> > > > Willem.
> > > >
> > > > Christian Vest Hansen wrote:
> > > > > If you generate a java client from a wsdl, and then add an
> > > > > operation to the wsdl but forget to update the client code - how
> > > > > does CXF handle that situation?
> > > > >
> > > > > Will the client crash or blissfully hum along (but withut being
> > > > > able to invoke the new operation)?
> > > > >
> > > > > I'm asking because it might influence decisions and policies one
> > > > > might define for managing change and backwards compatibility
> > > > > when working with CXF web services and clients.
>
>
>
> --
> J. Daniel Kulp
> Principal Engineer
> IONA
> P: 781-902-8727    C: 508-380-7194
> daniel.kulp@iona.com
> http://www.dankulp.com/blog
>


-- 
Venlig hilsen / Kind regards,
Christian Vest Hansen.

Re: how clients handle changing wsdls

Posted by Daniel Kulp <dk...@apache.org>.

I just committed a fix for this on trunk.     It logs a warning for each 
unavailable operation, then removes the operations from the ServiceModel 
so they won't be invokable. 

Dan


On Monday 29 October 2007, Daniel Kulp wrote:
> There's a JIRA logged someplace about this:
> http://issues.apache.org/jira/browse/CXF-940
>
> I'd like to get it logged on client side, but fail on server side.
> That's a bit more complicated since the code in question is completely
> shared between the two and it really doesn't know what it's
> targetting.
>
> I suppose we could just log a warning.   If a service is created
> without a backing method and someone tries to invoke it, a fault would
> be raised.
>
> Dan
>
> On Thursday 25 October 2007, Christian Vest Hansen wrote:
> > I recall seing a stack trace like that, which prompted my query.
> >
> > But if it, in this particular use case, always works if the client
> > refer directly to the ?wsdl from the online service, then it's just
> > something to keep in mind when creating clients.
> >
> > However, this confuses me:
> > > I think if you still use the old wsdl to create the service , the
> > > client can still work.
> >
> > (...)
> >
> > > On the client side if I use the ?wsdl which is generated by CXF to
> > > create the service ,
> > > the client  can still work.
> >
> > This sounds contradictory to me, given that one of thos scenarios
> > resulted in the stack trace you provided.
> > Could you clarify?
> >
> > 2007/10/25, Willem Jiang <ni...@iona.com>:
> > > Hi Christian,
> > >
> > > I think if you still use the old wsdl to create the service , the
> > > client can still work.
> > >
> > > I just did a quick test for your case by remove the WSDL2Java
> > > generated SEI's method.
> > > It can reproduce your case.
> > > On the client side if I use the ?wsdl which is generated by CXF to
> > > create the service ,
> > > the client  can still work. But if I specified the orginal WSDL ,
> > > I got the below exception.
> > >
> > > Caused by:
> > > org.apache.cxf.service.factory.ServiceConstructionException: Could
> > > not find a matching method for operation
> > > {http://apache.org/hello_world_soap_http}greetMeOneWay
> > >     at
> > > org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initia
> > >li zeWSDLOperations(ReflectionServiceFactoryBean.java:323) at
> > > org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeWSD
> > >LO perations(JaxWsServiceFactoryBean.java:184) at
> > > org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildS
> > >er viceFromWSDL(ReflectionServiceFactoryBean.java:214) at
> > > org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initia
> > >li zeServiceModel(ReflectionServiceFactoryBean.java:269) at
> > > org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create
> > >(R eflectionServiceFactoryBean.java:146) at
> > > org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsS
> > >er viceFactoryBean.java:91) at
> > > org.apache.cxf.frontend.AbstractEndpointFactory.createEndpoint(Abs
> > >tr actEndpointFactory.java:94) at
> > > org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean
> > >.j ava:50) at
> > > org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyF
> > >ac toryBean.java:89) at
> > > org.apache.cxf.jaxws.ServiceImpl.createPort(ServiceImpl.java:372)
> > > at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:271)
> > >
> > > Any thoughts?
> > >
> > > Willem.
> > >
> > > Christian Vest Hansen wrote:
> > > > If you generate a java client from a wsdl, and then add an
> > > > operation to the wsdl but forget to update the client code - how
> > > > does CXF handle that situation?
> > > >
> > > > Will the client crash or blissfully hum along (but withut being
> > > > able to invoke the new operation)?
> > > >
> > > > I'm asking because it might influence decisions and policies one
> > > > might define for managing change and backwards compatibility
> > > > when working with CXF web services and clients.



-- 
J. Daniel Kulp
Principal Engineer
IONA
P: 781-902-8727    C: 508-380-7194
daniel.kulp@iona.com
http://www.dankulp.com/blog

Re: how clients handle changing wsdls

Posted by Daniel Kulp <dk...@apache.org>.
There's a JIRA logged someplace about this:
http://issues.apache.org/jira/browse/CXF-940

I'd like to get it logged on client side, but fail on server side.   
That's a bit more complicated since the code in question is completely 
shared between the two and it really doesn't know what it's targetting.   

I suppose we could just log a warning.   If a service is created without 
a backing method and someone tries to invoke it, a fault would be 
raised. 

Dan



On Thursday 25 October 2007, Christian Vest Hansen wrote:
> I recall seing a stack trace like that, which prompted my query.
>
> But if it, in this particular use case, always works if the client
> refer directly to the ?wsdl from the online service, then it's just
> something to keep in mind when creating clients.
>
> However, this confuses me:
> > I think if you still use the old wsdl to create the service , the
> > client can still work.
>
> (...)
>
> > On the client side if I use the ?wsdl which is generated by CXF to
> > create the service ,
> > the client  can still work.
>
> This sounds contradictory to me, given that one of thos scenarios
> resulted in the stack trace you provided.
> Could you clarify?
>
> 2007/10/25, Willem Jiang <ni...@iona.com>:
> > Hi Christian,
> >
> > I think if you still use the old wsdl to create the service , the
> > client can still work.
> >
> > I just did a quick test for your case by remove the WSDL2Java
> > generated SEI's method.
> > It can reproduce your case.
> > On the client side if I use the ?wsdl which is generated by CXF to
> > create the service ,
> > the client  can still work. But if I specified the orginal WSDL , I
> > got the below exception.
> >
> > Caused by:
> > org.apache.cxf.service.factory.ServiceConstructionException: Could
> > not find a matching method for operation
> > {http://apache.org/hello_world_soap_http}greetMeOneWay
> >     at
> > org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initiali
> >zeWSDLOperations(ReflectionServiceFactoryBean.java:323) at
> > org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeWSDLO
> >perations(JaxWsServiceFactoryBean.java:184) at
> > org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildSer
> >viceFromWSDL(ReflectionServiceFactoryBean.java:214) at
> > org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initiali
> >zeServiceModel(ReflectionServiceFactoryBean.java:269) at
> > org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(R
> >eflectionServiceFactoryBean.java:146) at
> > org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsSer
> >viceFactoryBean.java:91) at
> > org.apache.cxf.frontend.AbstractEndpointFactory.createEndpoint(Abstr
> >actEndpointFactory.java:94) at
> > org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.j
> >ava:50) at
> > org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFac
> >toryBean.java:89) at
> > org.apache.cxf.jaxws.ServiceImpl.createPort(ServiceImpl.java:372) at
> > org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:271)
> >
> > Any thoughts?
> >
> > Willem.
> >
> > Christian Vest Hansen wrote:
> > > If you generate a java client from a wsdl, and then add an
> > > operation to the wsdl but forget to update the client code - how
> > > does CXF handle that situation?
> > >
> > > Will the client crash or blissfully hum along (but withut being
> > > able to invoke the new operation)?
> > >
> > > I'm asking because it might influence decisions and policies one
> > > might define for managing change and backwards compatibility when
> > > working with CXF web services and clients.



-- 
J. Daniel Kulp
Principal Engineer
IONA
P: 781-902-8727    C: 508-380-7194
daniel.kulp@iona.com
http://www.dankulp.com/blog

Re: how clients handle changing wsdls

Posted by Willem2 <ni...@iona.com>.
I can clarify it.
It is because I don't want to right a new WSDL to reproduce your case, I
just removed the method for the SEI which generate from the original wsdl. 
?wsdl 's wsdl just equals to the older wsdl in your case, and the original
wsdl equals newer wsdl in your case.

Willem.


Christian Vest Hansen wrote:
> 
> I recall seing a stack trace like that, which prompted my query.
> 
> But if it, in this particular use case, always works if the client
> refer directly to the ?wsdl from the online service, then it's just
> something to keep in mind when creating clients.
> 
> However, this confuses me:
> 
>> I think if you still use the old wsdl to create the service , the client
>> can still work.
> (...)
>> On the client side if I use the ?wsdl which is generated by CXF to
>> create the service ,
>> the client  can still work.
> 
> This sounds contradictory to me, given that one of thos scenarios
> resulted in the stack trace you provided.
> Could you clarify?
> 
> 2007/10/25, Willem Jiang <ni...@iona.com>:
>> Hi Christian,
>>
>> I think if you still use the old wsdl to create the service , the client
>> can still work.
>>
>> I just did a quick test for your case by remove the WSDL2Java generated
>> SEI's method.
>> It can reproduce your case.
>> On the client side if I use the ?wsdl which is generated by CXF to
>> create the service ,
>> the client  can still work. But if I specified the orginal WSDL , I got
>> the below exception.
>>
>> Caused by: org.apache.cxf.service.factory.ServiceConstructionException:
>> Could not find a matching method for operation
>> {http://apache.org/hello_world_soap_http}greetMeOneWay
>>     at
>> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeWSDLOperations(ReflectionServiceFactoryBean.java:323)
>>     at
>> org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeWSDLOperations(JaxWsServiceFactoryBean.java:184)
>>     at
>> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(ReflectionServiceFactoryBean.java:214)
>>     at
>> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:269)
>>     at
>> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:146)
>>     at
>> org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:91)
>>     at
>> org.apache.cxf.frontend.AbstractEndpointFactory.createEndpoint(AbstractEndpointFactory.java:94)
>>     at
>> org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:50)
>>     at
>> org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:89)
>>     at org.apache.cxf.jaxws.ServiceImpl.createPort(ServiceImpl.java:372)
>>     at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:271)
>>
>> Any thoughts?
>>
>> Willem.
>>
>> Christian Vest Hansen wrote:
>> > If you generate a java client from a wsdl, and then add an operation
>> > to the wsdl but forget to update the client code - how does CXF handle
>> > that situation?
>> >
>> > Will the client crash or blissfully hum along (but withut being able
>> > to invoke the new operation)?
>> >
>> > I'm asking because it might influence decisions and policies one might
>> > define for managing change and backwards compatibility when working
>> > with CXF web services and clients.
>> >
>> >
>>
> 
> 
> -- 
> Venlig hilsen / Kind regards,
> Christian Vest Hansen.
> 
> 

-- 
View this message in context: http://www.nabble.com/how-clients-handle-changing-wsdls-tf4684521.html#a13407403
Sent from the cxf-user mailing list archive at Nabble.com.


Re: how clients handle changing wsdls

Posted by Christian Vest Hansen <ka...@gmail.com>.
I recall seing a stack trace like that, which prompted my query.

But if it, in this particular use case, always works if the client
refer directly to the ?wsdl from the online service, then it's just
something to keep in mind when creating clients.

However, this confuses me:

> I think if you still use the old wsdl to create the service , the client
> can still work.
(...)
> On the client side if I use the ?wsdl which is generated by CXF to
> create the service ,
> the client  can still work.

This sounds contradictory to me, given that one of thos scenarios
resulted in the stack trace you provided.
Could you clarify?

2007/10/25, Willem Jiang <ni...@iona.com>:
> Hi Christian,
>
> I think if you still use the old wsdl to create the service , the client
> can still work.
>
> I just did a quick test for your case by remove the WSDL2Java generated
> SEI's method.
> It can reproduce your case.
> On the client side if I use the ?wsdl which is generated by CXF to
> create the service ,
> the client  can still work. But if I specified the orginal WSDL , I got
> the below exception.
>
> Caused by: org.apache.cxf.service.factory.ServiceConstructionException:
> Could not find a matching method for operation
> {http://apache.org/hello_world_soap_http}greetMeOneWay
>     at
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeWSDLOperations(ReflectionServiceFactoryBean.java:323)
>     at
> org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeWSDLOperations(JaxWsServiceFactoryBean.java:184)
>     at
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(ReflectionServiceFactoryBean.java:214)
>     at
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:269)
>     at
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:146)
>     at
> org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:91)
>     at
> org.apache.cxf.frontend.AbstractEndpointFactory.createEndpoint(AbstractEndpointFactory.java:94)
>     at
> org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:50)
>     at
> org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:89)
>     at org.apache.cxf.jaxws.ServiceImpl.createPort(ServiceImpl.java:372)
>     at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:271)
>
> Any thoughts?
>
> Willem.
>
> Christian Vest Hansen wrote:
> > If you generate a java client from a wsdl, and then add an operation
> > to the wsdl but forget to update the client code - how does CXF handle
> > that situation?
> >
> > Will the client crash or blissfully hum along (but withut being able
> > to invoke the new operation)?
> >
> > I'm asking because it might influence decisions and policies one might
> > define for managing change and backwards compatibility when working
> > with CXF web services and clients.
> >
> >
>


-- 
Venlig hilsen / Kind regards,
Christian Vest Hansen.

Re: how clients handle changing wsdls

Posted by Willem Jiang <ni...@iona.com>.
Hi Christian,

I think if you still use the old wsdl to create the service , the client 
can still work.

I just did a quick test for your case by remove the WSDL2Java generated 
SEI's method.
It can reproduce your case.
On the client side if I use the ?wsdl which is generated by CXF to 
create the service ,
the client  can still work. But if I specified the orginal WSDL , I got 
the below exception.

Caused by: org.apache.cxf.service.factory.ServiceConstructionException:
Could not find a matching method for operation 
{http://apache.org/hello_world_soap_http}greetMeOneWay
    at 
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeWSDLOperations(ReflectionServiceFactoryBean.java:323)
    at 
org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeWSDLOperations(JaxWsServiceFactoryBean.java:184)
    at 
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(ReflectionServiceFactoryBean.java:214)
    at 
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:269)
    at 
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:146)
    at 
org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:91)
    at 
org.apache.cxf.frontend.AbstractEndpointFactory.createEndpoint(AbstractEndpointFactory.java:94)
    at 
org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:50)
    at 
org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:89)
    at org.apache.cxf.jaxws.ServiceImpl.createPort(ServiceImpl.java:372)
    at org.apache.cxf.jaxws.ServiceImpl.getPort(ServiceImpl.java:271)

Any thoughts?

Willem.

Christian Vest Hansen wrote:
> If you generate a java client from a wsdl, and then add an operation
> to the wsdl but forget to update the client code - how does CXF handle
> that situation?
>
> Will the client crash or blissfully hum along (but withut being able
> to invoke the new operation)?
>
> I'm asking because it might influence decisions and policies one might
> define for managing change and backwards compatibility when working
> with CXF web services and clients.
>
>