You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Tomas Majak <to...@nasdaqomx.com> on 2009/11/11 11:28:03 UTC

How to get rid of certain runtime exceptions in the log?

Hi,

I'm using CXF together with Spring Security (Acegi). I have secured my WS methods, with role constraints.
I'm also using basic auth, which in most cases leads to requests without credentials first, then I reply HTTP401-USE BASIC AUTH (I have added a interceptor for doing this)
Upon receiving 401,  the client will resubmit the SOAP request and supply credentials.

The problem here is that in the first request, the service (more precise a Spring security interceptor on the POJO), will throw org.springframework.security.AccessDeniedException (RunTime). As described above, this is OK, hence I want the error consumed and nothing logged. BUT reading CXF code, I note that (org.apache.cxf.phase.PhaseInterceptorChain.java) where the exception is caught, there is no possibility to turn off logging for this scenario. The only possible way I found is to set log level ERROR, which will turn of all logging of exceptions, which I don't. I just want this one to be consumed.

Anyone solved something similar?

Thanks!
Tomas

Re: How to configure CXF client consume wsdl with overloaded methods?

Posted by Daniel Kulp <dk...@apache.org>.
As Benson bluntly pointed out, it's generally a bad idea.   However, there are 
things that can be done to make it "work".

1) Make sure any added elements are minOccurs=0.   The old clients wouldn't be 
sending them, so the schema needs to account for that.

2) When SENDING responses, if you can detect when it's an old client (like if 
the client sends a header with a version or something), don't send those 
elements.

3) OR, in the schema, wherever you think you may add elements in the future, 
add a <xsd:any maxOccurs="unbounded"> or similar.    In that case, any 
"unknown" elements would be dumped into the any.   Kind of requires some 
forward thinking though.   

4) In the JAXB databinding on the client, you MAY be able to register a 
ValidationEventHandler that would tell it to ignore any unknown elements.   If 
you do that on the clients, that should allow it to work with future schemas.    
That said, kind of kills the idea of really validating the response.

In any case, usually not a good idea.  :-)

Dan

  

On Mon November 16 2009 3:26:05 pm Jason Clark wrote:
> Hi Dan,
> 
> I think something related (albeit peripherally) has recently come up at my
> workplace.
> 
> The scenario is we have a web service that we've published a WSDL for.
> Recently, a new element has been added to a complex type (ignoring my
> objections), thus resulting in an updated WSDL.
> 
> This has necessitated customers using JAX-WS, and Axis2 to have to recreate
> their classes for accessing the service ( though it seems .NET solutions
> don't mind extra field in the SOAP response? ).
> 
> If I understand you correctly, you're saying that what we've done
> contradicts what the WSI-BP would dictate?
> 
> Cheers,
> Jason.
> 
> 2009/11/11 Daniel Kulp <dk...@apache.org>
> 
> > Two notes:
> >
> > 1)  Without the wsdl and the IVolume interface you are using, it might be
> > hard
> > to diagnose.   You may need to put them someplace public or log a JIRA or
> > similar.   The mailing list usually strips attachments.
> >
> > 2) Operation overloading in wsdl is not supported.    It's specifically
> > forbidden in the WSI-BP.     That said, on the interface, if the proper
> > annotations are there, it MAY work.
> >
> > Dan
> >
> > On Wed November 11 2009 7:02:27 am Alpin, Luba wrote:
> > > I need a help to configure my CXF client to use XFire SOAP service with
> > >  overloaded methods.
> > >
> > >
> > >
> > > IVolume interface has two method 'getVolumes' with different signature
> > >
> > >
> > >
> > > Wsdl has one 'getVolumes' and second 'getVolumes1'
> > >
> > >
> > >
> > > This is the dump of error:
> > >
> > >
> > >
> > > INFO: Creating Service
> > > {http://xfire.codehaus.org/IVolume}IVolume<http://xfire.codehaus.org/IV
> > >olume%7DIVolume>from WSDL:
> > > http://localhost:8080/public/services/IVolume?wsdl
> > >
> > > Nov 11, 2009 1:46:48 PM
> > >  org.apache.cxf.service.factory.ReflectionServiceFactoryBean
> > >  initializeWSDLOperations
> > >
> > > WARNING: Could not find a matching method for operation
> > > 
> > > {http://xfire.codehaus.org/IVolume}getVolumes1<http://xfire.codehaus.or
> > >g/IVolume%7DgetVolumes1>.
> >
> > Operation will be
> >
> > >  unavailable.
> > >
> > > java.lang.NullPointerException
> > >
> > >       at
> >
> > 
> > org.apache.cxf.aegis.databinding.AegisDatabinding.getParameterType(AegisD
> >a
> >
> > > tabinding.java:581)
> > >
> > >       at
> >
> > 
> > org.apache.cxf.aegis.databinding.AegisDatabinding.initializeMessage(Aegis
> >D
> >
> > > atabinding.java:342)
> > >
> > >       at
> >
> > 
> > org.apache.cxf.aegis.databinding.AegisDatabinding.initializeOperation(Aeg
> >i
> >
> > > sDatabinding.java:303)
> > >
> > >       at
> >
> > 
> > org.apache.cxf.aegis.databinding.AegisDatabinding.initialize(AegisDatabin
> >d
> >
> > > ing.java:267)
> > >
> > >       at
> >
> > 
> > org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceF
> >r
> >
> > > omWSDL(ReflectionServiceFactoryBean.java:363)
> > >
> > >       at
> >
> > 
> > org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeSer
> >v
> >
> > > iceModel(ReflectionServiceFactoryBean.java:459)
> > >
> > >       at
> >
> > 
> > org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(Reflec
> >t
> >
> > > ionServiceFactoryBean.java:212)
> > >
> > >       at
> >
> > 
> > org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceF
> >a
> >
> > > ctoryBean.java:163)
> > >
> > >       at
> >
> > 
> > org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(A
> >b
> >
> > > stractWSDLBasedEndpointFactory.java:100)
> > >
> > >       at
> >
> > 
> > org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:5
> >2
> >
> > > )
> > >
> > >       at
> >
> > 
> > org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryB
> >e
> >
> > > an.java:102)
> > >
> > >       at
> >
> > 
> > org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.j
> >a
> >
> > > va:115)
> > >
> > >       at
> > > 
> > > com.lsi.xfireConnector.CXFUtil.typedServiceProxyCreator(CXFUtil.java:67
> > >)
> > >
> > >
> > >
> > > This is my client:
> > >
> > >
> > >
> > >       JaxWsProxyFactoryBean client = new JaxWsProxyFactoryBean();
> > >
> > >       client.setServiceClass(clazz);
> > >
> > >       client.setAddress(url);
> > >
> > >       client.setWsdlURL(url + "?wsdl");
> > >
> > >       AegisDatabinding db = new AegisDatabinding();
> > >
> > >       AegisContext context = new AegisContext();
> > >
> > >       context.setWriteXsiTypes(false);
> > >
> > >       context.setReadXsiTypes(true);
> > >
> > >       db.setAegisContext(context);
> > >
> > >       client.setDataBinding(db);
> > >
> > >       IVolume object = (IVolume) client.create();
> > >
> > >
> > >
> > > Thanks,
> > >
> > > Luba A.
> >
> > --
> > Daniel Kulp
> > dkulp@apache.org
> > http://www.dankulp.com/blog
> 

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

Re: How to configure CXF client consume wsdl with overloaded methods?

Posted by Benson Margulies <bi...@gmail.com>.
You're welcome. Sorry for the blunt language.

On Tue, Nov 17, 2009 at 8:44 AM, Jason Clark <je...@gmail.com> wrote:

> Thanks for the confirmation, Benson.
>
> Cheers,
> Jason.
>
> 2009/11/16 Benson Margulies <bi...@gmail.com>
>
> > It doesn't contradict WSI-BP. It's just stupid. If you change a type in
> the
> > middle of an existing contract, and the original schema didn't use 'any'
> > particles to leave room for expansion, you've made an incompatible
> change,
> > and, yes, all those clients have to be reinvented.
> >
> > On Mon, Nov 16, 2009 at 3:26 PM, Jason Clark <je...@gmail.com> wrote:
> >
> > > Hi Dan,
> > >
> > > I think something related (albeit peripherally) has recently come up at
> > my
> > > workplace.
> > >
> > > The scenario is we have a web service that we've published a WSDL for.
> > > Recently, a new element has been added to a complex type (ignoring my
> > > objections), thus resulting in an updated WSDL.
> > >
> > > This has necessitated customers using JAX-WS, and Axis2 to have to
> > recreate
> > > their classes for accessing the service ( though it seems .NET
> solutions
> > > don't mind extra field in the SOAP response? ).
> > >
> > > If I understand you correctly, you're saying that what we've done
> > > contradicts what the WSI-BP would dictate?
> > >
> > > Cheers,
> > > Jason.
> > >
> > > 2009/11/11 Daniel Kulp <dk...@apache.org>
> > >
> > > >
> > > > Two notes:
> > > >
> > > > 1)  Without the wsdl and the IVolume interface you are using, it
> might
> > be
> > > > hard
> > > > to diagnose.   You may need to put them someplace public or log a
> JIRA
> > or
> > > > similar.   The mailing list usually strips attachments.
> > > >
> > > > 2) Operation overloading in wsdl is not supported.    It's
> specifically
> > > > forbidden in the WSI-BP.     That said, on the interface, if the
> proper
> > > > annotations are there, it MAY work.
> > > >
> > > > Dan
> > > >
> > > >
> > > > On Wed November 11 2009 7:02:27 am Alpin, Luba wrote:
> > > > > I need a help to configure my CXF client to use XFire SOAP service
> > with
> > > > >  overloaded methods.
> > > > >
> > > > >
> > > > >
> > > > > IVolume interface has two method 'getVolumes' with different
> > signature
> > > > >
> > > > >
> > > > >
> > > > > Wsdl has one 'getVolumes' and second 'getVolumes1'
> > > > >
> > > > >
> > > > >
> > > > > This is the dump of error:
> > > > >
> > > > >
> > > > >
> > > > > INFO: Creating Service {http://xfire.codehaus.org/IVolume}IVolume<http://xfire.codehaus.org/IVolume%7DIVolume>
> <http://xfire.codehaus.org/IVolume%7DIVolume>
> > <http://xfire.codehaus.org/IVolume%7DIVolume>
> > > <http://xfire.codehaus.org/IVolume%7DIVolume>from
> > > > >  WSDL: http://localhost:8080/public/services/IVolume?wsdl
> > > > >
> > > > > Nov 11, 2009 1:46:48 PM
> > > > >  org.apache.cxf.service.factory.ReflectionServiceFactoryBean
> > > > >  initializeWSDLOperations
> > > > >
> > > > > WARNING: Could not find a matching method for operation
> > > > >  {http://xfire.codehaus.org/IVolume}getVolumes1<http://xfire.codehaus.org/IVolume%7DgetVolumes1>
> <http://xfire.codehaus.org/IVolume%7DgetVolumes1>
> > <http://xfire.codehaus.org/IVolume%7DgetVolumes1>
> > > <http://xfire.codehaus.org/IVolume%7DgetVolumes1>.
> > > > Operation will be
> > > > >  unavailable.
> > > > >
> > > > > java.lang.NullPointerException
> > > > >
> > > > >       at
> > > > >
> > > >
> > >
> >
>  org.apache.cxf.aegis.databinding.AegisDatabinding.getParameterType(AegisDa
> > > > > tabinding.java:581)
> > > > >
> > > > >       at
> > > > >
> > > >
> > >
> >
>  org.apache.cxf.aegis.databinding.AegisDatabinding.initializeMessage(AegisD
> > > > > atabinding.java:342)
> > > > >
> > > > >       at
> > > > >
> > > >
> > >
> >
>  org.apache.cxf.aegis.databinding.AegisDatabinding.initializeOperation(Aegi
> > > > > sDatabinding.java:303)
> > > > >
> > > > >       at
> > > > >
> > > >
> > >
> >
>  org.apache.cxf.aegis.databinding.AegisDatabinding.initialize(AegisDatabind
> > > > > ing.java:267)
> > > > >
> > > > >       at
> > > > >
> > > >
> > >
> >
>  org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFr
> > > > > omWSDL(ReflectionServiceFactoryBean.java:363)
> > > > >
> > > > >       at
> > > > >
> > > >
> > >
> >
>  org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServ
> > > > > iceModel(ReflectionServiceFactoryBean.java:459)
> > > > >
> > > > >       at
> > > > >
> > > >
> > >
> >
>  org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(Reflect
> > > > > ionServiceFactoryBean.java:212)
> > > > >
> > > > >       at
> > > > >
> > > >
> > >
> >
>  org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFa
> > > > > ctoryBean.java:163)
> > > > >
> > > > >       at
> > > > >
> > > >
> > >
> >
>  org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(Ab
> > > > > stractWSDLBasedEndpointFactory.java:100)
> > > > >
> > > > >       at
> > > > >
> > > >
> > >
> >
>  org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:52
> > > > > )
> > > > >
> > > > >       at
> > > > >
> > > >
> > >
> >
>  org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBe
> > > > > an.java:102)
> > > > >
> > > > >       at
> > > > >
> > > >
> > >
> >
>  org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.ja
> > > > > va:115)
> > > > >
> > > > >       at
> > > > >
> > >
>  com.lsi.xfireConnector.CXFUtil.typedServiceProxyCreator(CXFUtil.java:67)
> > > > >
> > > > >
> > > > >
> > > > > This is my client:
> > > > >
> > > > >
> > > > >
> > > > >       JaxWsProxyFactoryBean client = new JaxWsProxyFactoryBean();
> > > > >
> > > > >       client.setServiceClass(clazz);
> > > > >
> > > > >       client.setAddress(url);
> > > > >
> > > > >       client.setWsdlURL(url + "?wsdl");
> > > > >
> > > > >       AegisDatabinding db = new AegisDatabinding();
> > > > >
> > > > >       AegisContext context = new AegisContext();
> > > > >
> > > > >       context.setWriteXsiTypes(false);
> > > > >
> > > > >       context.setReadXsiTypes(true);
> > > > >
> > > > >       db.setAegisContext(context);
> > > > >
> > > > >       client.setDataBinding(db);
> > > > >
> > > > >       IVolume object = (IVolume) client.create();
> > > > >
> > > > >
> > > > >
> > > > > Thanks,
> > > > >
> > > > > Luba A.
> > > > >
> > > >
> > > > --
> > > > Daniel Kulp
> > > > dkulp@apache.org
> > > > http://www.dankulp.com/blog
> > > >
> > >
> >
>

Re: How to configure CXF client consume wsdl with overloaded methods?

Posted by Jason Clark <je...@gmail.com>.
Thanks for the confirmation, Benson.

Cheers,
Jason.

2009/11/16 Benson Margulies <bi...@gmail.com>

> It doesn't contradict WSI-BP. It's just stupid. If you change a type in the
> middle of an existing contract, and the original schema didn't use 'any'
> particles to leave room for expansion, you've made an incompatible change,
> and, yes, all those clients have to be reinvented.
>
> On Mon, Nov 16, 2009 at 3:26 PM, Jason Clark <je...@gmail.com> wrote:
>
> > Hi Dan,
> >
> > I think something related (albeit peripherally) has recently come up at
> my
> > workplace.
> >
> > The scenario is we have a web service that we've published a WSDL for.
> > Recently, a new element has been added to a complex type (ignoring my
> > objections), thus resulting in an updated WSDL.
> >
> > This has necessitated customers using JAX-WS, and Axis2 to have to
> recreate
> > their classes for accessing the service ( though it seems .NET solutions
> > don't mind extra field in the SOAP response? ).
> >
> > If I understand you correctly, you're saying that what we've done
> > contradicts what the WSI-BP would dictate?
> >
> > Cheers,
> > Jason.
> >
> > 2009/11/11 Daniel Kulp <dk...@apache.org>
> >
> > >
> > > Two notes:
> > >
> > > 1)  Without the wsdl and the IVolume interface you are using, it might
> be
> > > hard
> > > to diagnose.   You may need to put them someplace public or log a JIRA
> or
> > > similar.   The mailing list usually strips attachments.
> > >
> > > 2) Operation overloading in wsdl is not supported.    It's specifically
> > > forbidden in the WSI-BP.     That said, on the interface, if the proper
> > > annotations are there, it MAY work.
> > >
> > > Dan
> > >
> > >
> > > On Wed November 11 2009 7:02:27 am Alpin, Luba wrote:
> > > > I need a help to configure my CXF client to use XFire SOAP service
> with
> > > >  overloaded methods.
> > > >
> > > >
> > > >
> > > > IVolume interface has two method 'getVolumes' with different
> signature
> > > >
> > > >
> > > >
> > > > Wsdl has one 'getVolumes' and second 'getVolumes1'
> > > >
> > > >
> > > >
> > > > This is the dump of error:
> > > >
> > > >
> > > >
> > > > INFO: Creating Service {http://xfire.codehaus.org/IVolume}IVolume<http://xfire.codehaus.org/IVolume%7DIVolume>
> <http://xfire.codehaus.org/IVolume%7DIVolume>
> > <http://xfire.codehaus.org/IVolume%7DIVolume>from
> > > >  WSDL: http://localhost:8080/public/services/IVolume?wsdl
> > > >
> > > > Nov 11, 2009 1:46:48 PM
> > > >  org.apache.cxf.service.factory.ReflectionServiceFactoryBean
> > > >  initializeWSDLOperations
> > > >
> > > > WARNING: Could not find a matching method for operation
> > > >  {http://xfire.codehaus.org/IVolume}getVolumes1<http://xfire.codehaus.org/IVolume%7DgetVolumes1>
> <http://xfire.codehaus.org/IVolume%7DgetVolumes1>
> > <http://xfire.codehaus.org/IVolume%7DgetVolumes1>.
> > > Operation will be
> > > >  unavailable.
> > > >
> > > > java.lang.NullPointerException
> > > >
> > > >       at
> > > >
> > >
> >
>  org.apache.cxf.aegis.databinding.AegisDatabinding.getParameterType(AegisDa
> > > > tabinding.java:581)
> > > >
> > > >       at
> > > >
> > >
> >
>  org.apache.cxf.aegis.databinding.AegisDatabinding.initializeMessage(AegisD
> > > > atabinding.java:342)
> > > >
> > > >       at
> > > >
> > >
> >
>  org.apache.cxf.aegis.databinding.AegisDatabinding.initializeOperation(Aegi
> > > > sDatabinding.java:303)
> > > >
> > > >       at
> > > >
> > >
> >
>  org.apache.cxf.aegis.databinding.AegisDatabinding.initialize(AegisDatabind
> > > > ing.java:267)
> > > >
> > > >       at
> > > >
> > >
> >
>  org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFr
> > > > omWSDL(ReflectionServiceFactoryBean.java:363)
> > > >
> > > >       at
> > > >
> > >
> >
>  org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServ
> > > > iceModel(ReflectionServiceFactoryBean.java:459)
> > > >
> > > >       at
> > > >
> > >
> >
>  org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(Reflect
> > > > ionServiceFactoryBean.java:212)
> > > >
> > > >       at
> > > >
> > >
> >
>  org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFa
> > > > ctoryBean.java:163)
> > > >
> > > >       at
> > > >
> > >
> >
>  org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(Ab
> > > > stractWSDLBasedEndpointFactory.java:100)
> > > >
> > > >       at
> > > >
> > >
> >
>  org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:52
> > > > )
> > > >
> > > >       at
> > > >
> > >
> >
>  org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBe
> > > > an.java:102)
> > > >
> > > >       at
> > > >
> > >
> >
>  org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.ja
> > > > va:115)
> > > >
> > > >       at
> > > >
> >  com.lsi.xfireConnector.CXFUtil.typedServiceProxyCreator(CXFUtil.java:67)
> > > >
> > > >
> > > >
> > > > This is my client:
> > > >
> > > >
> > > >
> > > >       JaxWsProxyFactoryBean client = new JaxWsProxyFactoryBean();
> > > >
> > > >       client.setServiceClass(clazz);
> > > >
> > > >       client.setAddress(url);
> > > >
> > > >       client.setWsdlURL(url + "?wsdl");
> > > >
> > > >       AegisDatabinding db = new AegisDatabinding();
> > > >
> > > >       AegisContext context = new AegisContext();
> > > >
> > > >       context.setWriteXsiTypes(false);
> > > >
> > > >       context.setReadXsiTypes(true);
> > > >
> > > >       db.setAegisContext(context);
> > > >
> > > >       client.setDataBinding(db);
> > > >
> > > >       IVolume object = (IVolume) client.create();
> > > >
> > > >
> > > >
> > > > Thanks,
> > > >
> > > > Luba A.
> > > >
> > >
> > > --
> > > Daniel Kulp
> > > dkulp@apache.org
> > > http://www.dankulp.com/blog
> > >
> >
>

Re: How to configure CXF client consume wsdl with overloaded methods?

Posted by Benson Margulies <bi...@gmail.com>.
It doesn't contradict WSI-BP. It's just stupid. If you change a type in the
middle of an existing contract, and the original schema didn't use 'any'
particles to leave room for expansion, you've made an incompatible change,
and, yes, all those clients have to be reinvented.

On Mon, Nov 16, 2009 at 3:26 PM, Jason Clark <je...@gmail.com> wrote:

> Hi Dan,
>
> I think something related (albeit peripherally) has recently come up at my
> workplace.
>
> The scenario is we have a web service that we've published a WSDL for.
> Recently, a new element has been added to a complex type (ignoring my
> objections), thus resulting in an updated WSDL.
>
> This has necessitated customers using JAX-WS, and Axis2 to have to recreate
> their classes for accessing the service ( though it seems .NET solutions
> don't mind extra field in the SOAP response? ).
>
> If I understand you correctly, you're saying that what we've done
> contradicts what the WSI-BP would dictate?
>
> Cheers,
> Jason.
>
> 2009/11/11 Daniel Kulp <dk...@apache.org>
>
> >
> > Two notes:
> >
> > 1)  Without the wsdl and the IVolume interface you are using, it might be
> > hard
> > to diagnose.   You may need to put them someplace public or log a JIRA or
> > similar.   The mailing list usually strips attachments.
> >
> > 2) Operation overloading in wsdl is not supported.    It's specifically
> > forbidden in the WSI-BP.     That said, on the interface, if the proper
> > annotations are there, it MAY work.
> >
> > Dan
> >
> >
> > On Wed November 11 2009 7:02:27 am Alpin, Luba wrote:
> > > I need a help to configure my CXF client to use XFire SOAP service with
> > >  overloaded methods.
> > >
> > >
> > >
> > > IVolume interface has two method 'getVolumes' with different signature
> > >
> > >
> > >
> > > Wsdl has one 'getVolumes' and second 'getVolumes1'
> > >
> > >
> > >
> > > This is the dump of error:
> > >
> > >
> > >
> > > INFO: Creating Service {http://xfire.codehaus.org/IVolume}IVolume<http://xfire.codehaus.org/IVolume%7DIVolume>
> <http://xfire.codehaus.org/IVolume%7DIVolume>from
> > >  WSDL: http://localhost:8080/public/services/IVolume?wsdl
> > >
> > > Nov 11, 2009 1:46:48 PM
> > >  org.apache.cxf.service.factory.ReflectionServiceFactoryBean
> > >  initializeWSDLOperations
> > >
> > > WARNING: Could not find a matching method for operation
> > >  {http://xfire.codehaus.org/IVolume}getVolumes1<http://xfire.codehaus.org/IVolume%7DgetVolumes1>
> <http://xfire.codehaus.org/IVolume%7DgetVolumes1>.
> > Operation will be
> > >  unavailable.
> > >
> > > java.lang.NullPointerException
> > >
> > >       at
> > >
> >
>  org.apache.cxf.aegis.databinding.AegisDatabinding.getParameterType(AegisDa
> > > tabinding.java:581)
> > >
> > >       at
> > >
> >
>  org.apache.cxf.aegis.databinding.AegisDatabinding.initializeMessage(AegisD
> > > atabinding.java:342)
> > >
> > >       at
> > >
> >
>  org.apache.cxf.aegis.databinding.AegisDatabinding.initializeOperation(Aegi
> > > sDatabinding.java:303)
> > >
> > >       at
> > >
> >
>  org.apache.cxf.aegis.databinding.AegisDatabinding.initialize(AegisDatabind
> > > ing.java:267)
> > >
> > >       at
> > >
> >
>  org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFr
> > > omWSDL(ReflectionServiceFactoryBean.java:363)
> > >
> > >       at
> > >
> >
>  org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServ
> > > iceModel(ReflectionServiceFactoryBean.java:459)
> > >
> > >       at
> > >
> >
>  org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(Reflect
> > > ionServiceFactoryBean.java:212)
> > >
> > >       at
> > >
> >
>  org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFa
> > > ctoryBean.java:163)
> > >
> > >       at
> > >
> >
>  org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(Ab
> > > stractWSDLBasedEndpointFactory.java:100)
> > >
> > >       at
> > >
> >
>  org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:52
> > > )
> > >
> > >       at
> > >
> >
>  org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBe
> > > an.java:102)
> > >
> > >       at
> > >
> >
>  org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.ja
> > > va:115)
> > >
> > >       at
> > >
>  com.lsi.xfireConnector.CXFUtil.typedServiceProxyCreator(CXFUtil.java:67)
> > >
> > >
> > >
> > > This is my client:
> > >
> > >
> > >
> > >       JaxWsProxyFactoryBean client = new JaxWsProxyFactoryBean();
> > >
> > >       client.setServiceClass(clazz);
> > >
> > >       client.setAddress(url);
> > >
> > >       client.setWsdlURL(url + "?wsdl");
> > >
> > >       AegisDatabinding db = new AegisDatabinding();
> > >
> > >       AegisContext context = new AegisContext();
> > >
> > >       context.setWriteXsiTypes(false);
> > >
> > >       context.setReadXsiTypes(true);
> > >
> > >       db.setAegisContext(context);
> > >
> > >       client.setDataBinding(db);
> > >
> > >       IVolume object = (IVolume) client.create();
> > >
> > >
> > >
> > > Thanks,
> > >
> > > Luba A.
> > >
> >
> > --
> > Daniel Kulp
> > dkulp@apache.org
> > http://www.dankulp.com/blog
> >
>

Re: How to configure CXF client consume wsdl with overloaded methods?

Posted by Jason Clark <je...@gmail.com>.
Hi Dan,

I think something related (albeit peripherally) has recently come up at my
workplace.

The scenario is we have a web service that we've published a WSDL for.
Recently, a new element has been added to a complex type (ignoring my
objections), thus resulting in an updated WSDL.

This has necessitated customers using JAX-WS, and Axis2 to have to recreate
their classes for accessing the service ( though it seems .NET solutions
don't mind extra field in the SOAP response? ).

If I understand you correctly, you're saying that what we've done
contradicts what the WSI-BP would dictate?

Cheers,
Jason.

2009/11/11 Daniel Kulp <dk...@apache.org>

>
> Two notes:
>
> 1)  Without the wsdl and the IVolume interface you are using, it might be
> hard
> to diagnose.   You may need to put them someplace public or log a JIRA or
> similar.   The mailing list usually strips attachments.
>
> 2) Operation overloading in wsdl is not supported.    It's specifically
> forbidden in the WSI-BP.     That said, on the interface, if the proper
> annotations are there, it MAY work.
>
> Dan
>
>
> On Wed November 11 2009 7:02:27 am Alpin, Luba wrote:
> > I need a help to configure my CXF client to use XFire SOAP service with
> >  overloaded methods.
> >
> >
> >
> > IVolume interface has two method 'getVolumes' with different signature
> >
> >
> >
> > Wsdl has one 'getVolumes' and second 'getVolumes1'
> >
> >
> >
> > This is the dump of error:
> >
> >
> >
> > INFO: Creating Service {http://xfire.codehaus.org/IVolume}IVolume<http://xfire.codehaus.org/IVolume%7DIVolume>from
> >  WSDL: http://localhost:8080/public/services/IVolume?wsdl
> >
> > Nov 11, 2009 1:46:48 PM
> >  org.apache.cxf.service.factory.ReflectionServiceFactoryBean
> >  initializeWSDLOperations
> >
> > WARNING: Could not find a matching method for operation
> >  {http://xfire.codehaus.org/IVolume}getVolumes1<http://xfire.codehaus.org/IVolume%7DgetVolumes1>.
> Operation will be
> >  unavailable.
> >
> > java.lang.NullPointerException
> >
> >       at
> >
>  org.apache.cxf.aegis.databinding.AegisDatabinding.getParameterType(AegisDa
> > tabinding.java:581)
> >
> >       at
> >
>  org.apache.cxf.aegis.databinding.AegisDatabinding.initializeMessage(AegisD
> > atabinding.java:342)
> >
> >       at
> >
>  org.apache.cxf.aegis.databinding.AegisDatabinding.initializeOperation(Aegi
> > sDatabinding.java:303)
> >
> >       at
> >
>  org.apache.cxf.aegis.databinding.AegisDatabinding.initialize(AegisDatabind
> > ing.java:267)
> >
> >       at
> >
>  org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFr
> > omWSDL(ReflectionServiceFactoryBean.java:363)
> >
> >       at
> >
>  org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServ
> > iceModel(ReflectionServiceFactoryBean.java:459)
> >
> >       at
> >
>  org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(Reflect
> > ionServiceFactoryBean.java:212)
> >
> >       at
> >
>  org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFa
> > ctoryBean.java:163)
> >
> >       at
> >
>  org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(Ab
> > stractWSDLBasedEndpointFactory.java:100)
> >
> >       at
> >
>  org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:52
> > )
> >
> >       at
> >
>  org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBe
> > an.java:102)
> >
> >       at
> >
>  org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.ja
> > va:115)
> >
> >       at
> >  com.lsi.xfireConnector.CXFUtil.typedServiceProxyCreator(CXFUtil.java:67)
> >
> >
> >
> > This is my client:
> >
> >
> >
> >       JaxWsProxyFactoryBean client = new JaxWsProxyFactoryBean();
> >
> >       client.setServiceClass(clazz);
> >
> >       client.setAddress(url);
> >
> >       client.setWsdlURL(url + "?wsdl");
> >
> >       AegisDatabinding db = new AegisDatabinding();
> >
> >       AegisContext context = new AegisContext();
> >
> >       context.setWriteXsiTypes(false);
> >
> >       context.setReadXsiTypes(true);
> >
> >       db.setAegisContext(context);
> >
> >       client.setDataBinding(db);
> >
> >       IVolume object = (IVolume) client.create();
> >
> >
> >
> > Thanks,
> >
> > Luba A.
> >
>
> --
> Daniel Kulp
> dkulp@apache.org
> http://www.dankulp.com/blog
>

RE: How to configure CXF client consume wsdl with overloaded methods?

Posted by "Alpin, Luba" <Lu...@lsi.com>.
Thanks!

The annotations really help make it working.
Now I will try to make it working without changing server side.

Regards,
Luba A.




-----Original Message-----
From: Daniel Kulp [mailto:dkulp@apache.org]
Sent: Thursday, November 12, 2009 18:07 PM
To: users@cxf.apache.org
Cc: Alpin, Luba
Subject: Re: How to configure CXF client consume wsdl with overloaded methods?



If you add proper @WebMethod annotations onto the interface methods like:

@WebMethod(name = "getVolume")
public VolumePropertiesDTO getVolume(String name);

@WebMethod(name = "getVolume1")
public VolumePropertiesDTO getVolume(String name, int size);

It MAY have a chance of working.   That should allow the runtime to properly
map the methods to operations in the wsdl.    You are likely to ALSO need to
add @WebParam and @WebResult annotations to get the parameter names mapped
correctly as well.

Dan



On Thu November 12 2009 3:08:24 am Alpin, Luba wrote:
> My demo is really small program to demonstrate problematic area from real
>  code, so I paste it right to this email.
>  --------------------------------------------------------------------------
> -- Interface of service IVolume.java
> ------------------------------------
>
> package demowar.server;
>
> import java.util.*;
>
> import javax.jws.WebService;
> import demowar.dto.*;
>
> @WebService(name = "Demo", targetNamespace =
>  "http://xfire.codehaus.org/Demo")public interface IDemo {
>
>     //works OK
>     public Properties getDemoProperties();
>     //works OK
>     public BaseObjectDTO[] getArrayOfData();
>
>     // overloading doesn't work for CXF with XFire all works good
>     public VolumePropertiesDTO getVolume(String name);
>     public VolumePropertiesDTO getVolume(String name, int size);
> }
>
> Implementation VolumeImpl.java
> -------------------------------
> package demowar.server;
>
> import java.util.Properties;
> import demowar.dto.*;
>
> public class DemoImpl implements IDemo {
>     public Properties getDemoProperties() {
>         Properties p = new Properties();
>         p.setProperty("key-1", "value-1");
>         p.setProperty("key-2", "value-2");
>         return p;
>     }
>
>     public BaseObjectDTO[] getArrayOfData() {
>         BaseObjectDTO[] arr = new BaseObjectDTO[3];
>         for (int i = 0; i < arr.length; i++) {
>             arr[i] = new VolumePropertiesDTO("Name-" + i, i);
>         }
>         return arr;
>     }
>
>     public VolumePropertiesDTO getVolume(String name) {
>         return new VolumePropertiesDTO(name, 0);
>     }
>
>     public VolumePropertiesDTO getVolume(String name, int size) {
>         return new VolumePropertiesDTO(name, size);
>     }
> }
>
> --------------
> WSDL - Demo.wsdl
> --------------
>
> <?xml version="1.0" encoding="UTF-8" ?>
> <wsdl:definitions targetNamespace="http://xfire.codehaus.org/Demo"
>  xmlns:tns="http://xfire.codehaus.org/Demo"
>  xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
>  xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"
>  xmlns:ns1="http://dto.demowar"
>  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>  xmlns:soapenc11="http://schemas.xmlsoap.org/soap/encoding/"
>  xmlns:soapenc12="http://www.w3.org/2003/05/soap-encoding"
>  xmlns:soap11="http://schemas.xmlsoap.org/soap/envelope/"
>  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> <wsdl:types>
> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>  attributeFormDefault="qualified" elementFormDefault="qualified"
>  targetNamespace="http://xfire.codehaus.org/Demo"> <xsd:element
>  name="getVolume1">
> <xsd:complexType>
> <xsd:sequence>
>   <xsd:element maxOccurs="1" minOccurs="1" name="in0" nillable="true"
>  type="xsd:string" /> <xsd:element maxOccurs="1" minOccurs="1" name="in1"
>  type="xsd:int" /> </xsd:sequence>
>   </xsd:complexType>
>   </xsd:element>
> <xsd:element name="getVolume1Response">
> <xsd:complexType>
> <xsd:sequence>
>   <xsd:element maxOccurs="1" minOccurs="1" name="out" nillable="true"
>  type="ns1:VolumePropertiesDTO" /> </xsd:sequence>
>   </xsd:complexType>
>   </xsd:element>
> <xsd:element name="getArrayOfData">
>   <xsd:complexType />
>   </xsd:element>
> <xsd:element name="getArrayOfDataResponse">
> <xsd:complexType>
> <xsd:sequence>
>   <xsd:element maxOccurs="1" minOccurs="1" name="out" nillable="true"
>  type="ns1:ArrayOfBaseObjectDTO" /> </xsd:sequence>
>   </xsd:complexType>
>   </xsd:element>
> <xsd:element name="getVolume">
> <xsd:complexType>
> <xsd:sequence>
>   <xsd:element maxOccurs="1" minOccurs="1" name="in0" nillable="true"
>  type="xsd:string" /> </xsd:sequence>
>   </xsd:complexType>
>   </xsd:element>
> <xsd:element name="getVolumeResponse">
> <xsd:complexType>
> <xsd:sequence>
>   <xsd:element maxOccurs="1" minOccurs="1" name="out" nillable="true"
>  type="ns1:VolumePropertiesDTO" /> </xsd:sequence>
>   </xsd:complexType>
>   </xsd:element>
> <xsd:element name="getDemoProperties">
>   <xsd:complexType />
>   </xsd:element>
> <xsd:complexType name="anyType2anyTypeMap">
> <xsd:sequence>
> <xsd:element maxOccurs="unbounded" minOccurs="0" name="entry">
> <xsd:complexType>
> <xsd:sequence>
>   <xsd:element maxOccurs="1" minOccurs="0" name="key" type="xsd:anyType" />
>   <xsd:element maxOccurs="1" minOccurs="0" name="value" type="xsd:anyType"
>  /> </xsd:sequence>
>   </xsd:complexType>
>   </xsd:element>
>   </xsd:sequence>
>   </xsd:complexType>
> <xsd:element name="getDemoPropertiesResponse">
> <xsd:complexType>
> <xsd:sequence>
>   <xsd:element maxOccurs="1" minOccurs="1" name="out" nillable="true"
>  type="tns:anyType2anyTypeMap" /> </xsd:sequence>
>   </xsd:complexType>
>   </xsd:element>
>   </xsd:schema>
> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>  attributeFormDefault="qualified" elementFormDefault="qualified"
>  targetNamespace="http://dto.demowar"> <xsd:complexType
>  name="VolumePropertiesDTO">
> <xsd:complexContent>
> <xsd:extension base="ns1:BaseObjectDTO">
> <xsd:sequence>
>   <xsd:element minOccurs="0" name="size" type="xsd:int" />
>   </xsd:sequence>
>   </xsd:extension>
>   </xsd:complexContent>
>   </xsd:complexType>
> <xsd:complexType name="BaseObjectDTO">
> <xsd:sequence>
>   <xsd:element minOccurs="0" name="name" nillable="true" type="xsd:string"
>  /> </xsd:sequence>
>   </xsd:complexType>
> <xsd:complexType name="ArrayOfBaseObjectDTO">
> <xsd:sequence>
>   <xsd:element maxOccurs="unbounded" minOccurs="0" name="BaseObjectDTO"
>  nillable="true" type="ns1:BaseObjectDTO" /> </xsd:sequence>
>   </xsd:complexType>
>   </xsd:schema>
>   </wsdl:types>
> <wsdl:message name="getVolume1Response">
>   <wsdl:part name="parameters" element="tns:getVolume1Response" />
>   </wsdl:message>
> <wsdl:message name="getArrayOfDataResponse">
>   <wsdl:part name="parameters" element="tns:getArrayOfDataResponse" />
>   </wsdl:message>
> <wsdl:message name="getVolume1Request">
>   <wsdl:part name="parameters" element="tns:getVolume1" />
>   </wsdl:message>
> <wsdl:message name="getDemoPropertiesResponse">
>   <wsdl:part name="parameters" element="tns:getDemoPropertiesResponse" />
>   </wsdl:message>
> <wsdl:message name="getVolumeResponse">
>   <wsdl:part name="parameters" element="tns:getVolumeResponse" />
>   </wsdl:message>
> <wsdl:message name="getArrayOfDataRequest">
>   <wsdl:part name="parameters" element="tns:getArrayOfData" />
>   </wsdl:message>
> <wsdl:message name="getDemoPropertiesRequest">
>   <wsdl:part name="parameters" element="tns:getDemoProperties" />
>   </wsdl:message>
> <wsdl:message name="getVolumeRequest">
>   <wsdl:part name="parameters" element="tns:getVolume" />
>   </wsdl:message>
> <wsdl:portType name="Demo">
> <wsdl:operation name="getVolume1">
>   <wsdl:input name="getVolume1Request" message="tns:getVolume1Request" />
>   <wsdl:output name="getVolume1Response" message="tns:getVolume1Response"
>  /> </wsdl:operation>
> <wsdl:operation name="getArrayOfData">
>   <wsdl:input name="getArrayOfDataRequest"
>  message="tns:getArrayOfDataRequest" /> <wsdl:output
>  name="getArrayOfDataResponse" message="tns:getArrayOfDataResponse" />
>  </wsdl:operation>
> <wsdl:operation name="getVolume">
>   <wsdl:input name="getVolumeRequest" message="tns:getVolumeRequest" />
>   <wsdl:output name="getVolumeResponse" message="tns:getVolumeResponse" />
>   </wsdl:operation>
> <wsdl:operation name="getDemoProperties">
>   <wsdl:input name="getDemoPropertiesRequest"
>  message="tns:getDemoPropertiesRequest" /> <wsdl:output
>  name="getDemoPropertiesResponse" message="tns:getDemoPropertiesResponse"
>  /> </wsdl:operation>
>   </wsdl:portType>
> <wsdl:binding name="DemoHttpBinding" type="tns:Demo">
>   <wsdlsoap:binding style="document"
>  transport="http://schemas.xmlsoap.org/soap/http" /> <wsdl:operation
>  name="getVolume1">
>   <wsdlsoap:operation soapAction="" />
> <wsdl:input name="getVolume1Request">
>   <wsdlsoap:body use="literal" />
>   </wsdl:input>
> <wsdl:output name="getVolume1Response">
>   <wsdlsoap:body use="literal" />
>   </wsdl:output>
>   </wsdl:operation>
> <wsdl:operation name="getArrayOfData">
>   <wsdlsoap:operation soapAction="" />
> <wsdl:input name="getArrayOfDataRequest">
>   <wsdlsoap:body use="literal" />
>   </wsdl:input>
> <wsdl:output name="getArrayOfDataResponse">
>   <wsdlsoap:body use="literal" />
>   </wsdl:output>
>   </wsdl:operation>
> <wsdl:operation name="getVolume">
>   <wsdlsoap:operation soapAction="" />
> <wsdl:input name="getVolumeRequest">
>   <wsdlsoap:body use="literal" />
>   </wsdl:input>
> <wsdl:output name="getVolumeResponse">
>   <wsdlsoap:body use="literal" />
>   </wsdl:output>
>   </wsdl:operation>
> <wsdl:operation name="getDemoProperties">
>   <wsdlsoap:operation soapAction="" />
> <wsdl:input name="getDemoPropertiesRequest">
>   <wsdlsoap:body use="literal" />
>   </wsdl:input>
> <wsdl:output name="getDemoPropertiesResponse">
>   <wsdlsoap:body use="literal" />
>   </wsdl:output>
>   </wsdl:operation>
>   </wsdl:binding>
> <wsdl:service name="Demo">
> <wsdl:port name="DemoHttpPort" binding="tns:DemoHttpBinding">
>   <wsdlsoap:address location="http://localhost:8080/demo/services/Demo" />
>   </wsdl:port>
>   </wsdl:service>
>   </wsdl:definitions>
>
>
> ----------------------------------------
> Configuration - services.xml
> ----------------------------------------
>
> <beans xmlns="http://xfire.codehaus.org/config/1.0">
>   <service>
>     <name>Demo</name>
>     <serviceClass>demowar.server.IDemo</serviceClass>
>     <implementationClass>demowar.server.DemoImpl</implementationClass>
>     <serviceFactory>jsr181</serviceFactory>
>     <properties>
>       <property key="writeXsiType">true</property>
>       <property key="overrideTypesList">
>         <list xmlns="">
>           <value>demowar.dto.VolumePropertiesDTO</value>
>         </list>
>       </property>
>     </properties>
>   </service>
> </beans>
>
> Thanks,
> Luba A.
>
> -----Original Message-----
> From: Benson Margulies [mailto:bimargulies@gmail.com]
> Sent: Wednesday, November 11, 2009 23:24 PM
> To: users@cxf.apache.org
> Subject: Re: How to configure CXF client consume wsdl with overloaded
>  methods?
>
> Dan,
>
> So, we have the following situation?
>
> XFire let the OP create a non-WSI-BP service, and purports to generate a
> WSDL for it. If the version of Aegis was the same on both ends, it would
> work. If the particular API does not happen to run into one of the areas
> where Aegis has changed what goes on the wire (and there are a lot more
> changes to how it writes the schema than how it writes the data) it might
> work, but if it doesn't work, it's going to be pretty challenging to make
>  it work.
>
> --benson
>
> On Wed, Nov 11, 2009 at 3:37 PM, Daniel Kulp <dk...@apache.org> wrote:
> > Two notes:
> >
> > 1)  Without the wsdl and the IVolume interface you are using, it might be
> > hard
> > to diagnose.   You may need to put them someplace public or log a JIRA or
> > similar.   The mailing list usually strips attachments.
> >
> > 2) Operation overloading in wsdl is not supported.    It's specifically
> > forbidden in the WSI-BP.     That said, on the interface, if the proper
> > annotations are there, it MAY work.
> >
> > Dan
> >
> > On Wed November 11 2009 7:02:27 am Alpin, Luba wrote:
> > > I need a help to configure my CXF client to use XFire SOAP service with
> > >  overloaded methods.
> > >
> > >
> > >
> > > IVolume interface has two method 'getVolumes' with different signature
> > >
> > >
> > >
> > > Wsdl has one 'getVolumes' and second 'getVolumes1'
> > >
> > >
> > >
> > > This is the dump of error:
> > >
> > >
> > >
> > > INFO: Creating Service {http://xfire.codehaus.org/IVolume}IVolume from
> > >  WSDL: http://localhost:8080/public/services/IVolume?wsdl
> > >
> > > Nov 11, 2009 1:46:48 PM
> > >  org.apache.cxf.service.factory.ReflectionServiceFactoryBean
> > >  initializeWSDLOperations
> > >
> > > WARNING: Could not find a matching method for operation
> > >  {http://xfire.codehaus.org/IVolume}getVolumes1. Operation will be
> > >  unavailable.
> > >
> > > java.lang.NullPointerException
> > >
> > >       at
> >
> >
> > org.apache.cxf.aegis.databinding.AegisDatabinding.getParameterType(AegisD
> >a
> >
> > > tabinding.java:581)
> > >
> > >       at
> >
> >
> > org.apache.cxf.aegis.databinding.AegisDatabinding.initializeMessage(Aegis
> >D
> >
> > > atabinding.java:342)
> > >
> > >       at
> >
> >
> > org.apache.cxf.aegis.databinding.AegisDatabinding.initializeOperation(Aeg
> >i
> >
> > > sDatabinding.java:303)
> > >
> > >       at
> >
> >
> > org.apache.cxf.aegis.databinding.AegisDatabinding.initialize(AegisDatabin
> >d
> >
> > > ing.java:267)
> > >
> > >       at
> >
> >
> > org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceF
> >r
> >
> > > omWSDL(ReflectionServiceFactoryBean.java:363)
> > >
> > >       at
> >
> >
> > org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeSer
> >v
> >
> > > iceModel(ReflectionServiceFactoryBean.java:459)
> > >
> > >       at
> >
> >
> > org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(Reflec
> >t
> >
> > > ionServiceFactoryBean.java:212)
> > >
> > >       at
> >
> >
> > org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceF
> >a
> >
> > > ctoryBean.java:163)
> > >
> > >       at
> >
> >
> > org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(A
> >b
> >
> > > stractWSDLBasedEndpointFactory.java:100)
> > >
> > >       at
> >
> >
> > org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:5
> >2
> >
> > > )
> > >
> > >       at
> >
> >
> > org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryB
> >e
> >
> > > an.java:102)
> > >
> > >       at
> >
> >
> > org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.j
> >a
> >
> > > va:115)
> > >
> > >       at
> > >
> > > com.lsi.xfireConnector.CXFUtil.typedServiceProxyCreator(CXFUtil.java:67
> > >)
> > >
> > >
> > >
> > > This is my client:
> > >
> > >
> > >
> > >       JaxWsProxyFactoryBean client = new JaxWsProxyFactoryBean();
> > >
> > >       client.setServiceClass(clazz);
> > >
> > >       client.setAddress(url);
> > >
> > >       client.setWsdlURL(url + "?wsdl");
> > >
> > >       AegisDatabinding db = new AegisDatabinding();
> > >
> > >       AegisContext context = new AegisContext();
> > >
> > >       context.setWriteXsiTypes(false);
> > >
> > >       context.setReadXsiTypes(true);
> > >
> > >       db.setAegisContext(context);
> > >
> > >       client.setDataBinding(db);
> > >
> > >       IVolume object = (IVolume) client.create();
> > >
> > >
> > >
> > > Thanks,
> > >
> > > Luba A.
> >
> > --
> > Daniel Kulp
> > dkulp@apache.org
> > http://www.dankulp.com/blog
>

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

Re: How to configure CXF client consume wsdl with overloaded methods?

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

If you add proper @WebMethod annotations onto the interface methods like:

@WebMethod(name = "getVolume")
public VolumePropertiesDTO getVolume(String name);

@WebMethod(name = "getVolume1")
public VolumePropertiesDTO getVolume(String name, int size);

It MAY have a chance of working.   That should allow the runtime to properly 
map the methods to operations in the wsdl.    You are likely to ALSO need to 
add @WebParam and @WebResult annotations to get the parameter names mapped 
correctly as well.

Dan



On Thu November 12 2009 3:08:24 am Alpin, Luba wrote:
> My demo is really small program to demonstrate problematic area from real
>  code, so I paste it right to this email.
>  --------------------------------------------------------------------------
> -- Interface of service IVolume.java
> ------------------------------------
> 
> package demowar.server;
> 
> import java.util.*;
> 
> import javax.jws.WebService;
> import demowar.dto.*;
> 
> @WebService(name = "Demo", targetNamespace =
>  "http://xfire.codehaus.org/Demo")public interface IDemo {
> 
>     //works OK
>     public Properties getDemoProperties();
>     //works OK
>     public BaseObjectDTO[] getArrayOfData();
> 
>     // overloading doesn't work for CXF with XFire all works good
>     public VolumePropertiesDTO getVolume(String name);
>     public VolumePropertiesDTO getVolume(String name, int size);
> }
> 
> Implementation VolumeImpl.java
> -------------------------------
> package demowar.server;
> 
> import java.util.Properties;
> import demowar.dto.*;
> 
> public class DemoImpl implements IDemo {
>     public Properties getDemoProperties() {
>         Properties p = new Properties();
>         p.setProperty("key-1", "value-1");
>         p.setProperty("key-2", "value-2");
>         return p;
>     }
> 
>     public BaseObjectDTO[] getArrayOfData() {
>         BaseObjectDTO[] arr = new BaseObjectDTO[3];
>         for (int i = 0; i < arr.length; i++) {
>             arr[i] = new VolumePropertiesDTO("Name-" + i, i);
>         }
>         return arr;
>     }
> 
>     public VolumePropertiesDTO getVolume(String name) {
>         return new VolumePropertiesDTO(name, 0);
>     }
> 
>     public VolumePropertiesDTO getVolume(String name, int size) {
>         return new VolumePropertiesDTO(name, size);
>     }
> }
> 
> --------------
> WSDL - Demo.wsdl
> --------------
> 
> <?xml version="1.0" encoding="UTF-8" ?>
> <wsdl:definitions targetNamespace="http://xfire.codehaus.org/Demo"
>  xmlns:tns="http://xfire.codehaus.org/Demo"
>  xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
>  xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"
>  xmlns:ns1="http://dto.demowar"
>  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>  xmlns:soapenc11="http://schemas.xmlsoap.org/soap/encoding/"
>  xmlns:soapenc12="http://www.w3.org/2003/05/soap-encoding"
>  xmlns:soap11="http://schemas.xmlsoap.org/soap/envelope/"
>  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> <wsdl:types>
> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>  attributeFormDefault="qualified" elementFormDefault="qualified"
>  targetNamespace="http://xfire.codehaus.org/Demo"> <xsd:element
>  name="getVolume1">
> <xsd:complexType>
> <xsd:sequence>
>   <xsd:element maxOccurs="1" minOccurs="1" name="in0" nillable="true"
>  type="xsd:string" /> <xsd:element maxOccurs="1" minOccurs="1" name="in1"
>  type="xsd:int" /> </xsd:sequence>
>   </xsd:complexType>
>   </xsd:element>
> <xsd:element name="getVolume1Response">
> <xsd:complexType>
> <xsd:sequence>
>   <xsd:element maxOccurs="1" minOccurs="1" name="out" nillable="true"
>  type="ns1:VolumePropertiesDTO" /> </xsd:sequence>
>   </xsd:complexType>
>   </xsd:element>
> <xsd:element name="getArrayOfData">
>   <xsd:complexType />
>   </xsd:element>
> <xsd:element name="getArrayOfDataResponse">
> <xsd:complexType>
> <xsd:sequence>
>   <xsd:element maxOccurs="1" minOccurs="1" name="out" nillable="true"
>  type="ns1:ArrayOfBaseObjectDTO" /> </xsd:sequence>
>   </xsd:complexType>
>   </xsd:element>
> <xsd:element name="getVolume">
> <xsd:complexType>
> <xsd:sequence>
>   <xsd:element maxOccurs="1" minOccurs="1" name="in0" nillable="true"
>  type="xsd:string" /> </xsd:sequence>
>   </xsd:complexType>
>   </xsd:element>
> <xsd:element name="getVolumeResponse">
> <xsd:complexType>
> <xsd:sequence>
>   <xsd:element maxOccurs="1" minOccurs="1" name="out" nillable="true"
>  type="ns1:VolumePropertiesDTO" /> </xsd:sequence>
>   </xsd:complexType>
>   </xsd:element>
> <xsd:element name="getDemoProperties">
>   <xsd:complexType />
>   </xsd:element>
> <xsd:complexType name="anyType2anyTypeMap">
> <xsd:sequence>
> <xsd:element maxOccurs="unbounded" minOccurs="0" name="entry">
> <xsd:complexType>
> <xsd:sequence>
>   <xsd:element maxOccurs="1" minOccurs="0" name="key" type="xsd:anyType" />
>   <xsd:element maxOccurs="1" minOccurs="0" name="value" type="xsd:anyType"
>  /> </xsd:sequence>
>   </xsd:complexType>
>   </xsd:element>
>   </xsd:sequence>
>   </xsd:complexType>
> <xsd:element name="getDemoPropertiesResponse">
> <xsd:complexType>
> <xsd:sequence>
>   <xsd:element maxOccurs="1" minOccurs="1" name="out" nillable="true"
>  type="tns:anyType2anyTypeMap" /> </xsd:sequence>
>   </xsd:complexType>
>   </xsd:element>
>   </xsd:schema>
> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>  attributeFormDefault="qualified" elementFormDefault="qualified"
>  targetNamespace="http://dto.demowar"> <xsd:complexType
>  name="VolumePropertiesDTO">
> <xsd:complexContent>
> <xsd:extension base="ns1:BaseObjectDTO">
> <xsd:sequence>
>   <xsd:element minOccurs="0" name="size" type="xsd:int" />
>   </xsd:sequence>
>   </xsd:extension>
>   </xsd:complexContent>
>   </xsd:complexType>
> <xsd:complexType name="BaseObjectDTO">
> <xsd:sequence>
>   <xsd:element minOccurs="0" name="name" nillable="true" type="xsd:string"
>  /> </xsd:sequence>
>   </xsd:complexType>
> <xsd:complexType name="ArrayOfBaseObjectDTO">
> <xsd:sequence>
>   <xsd:element maxOccurs="unbounded" minOccurs="0" name="BaseObjectDTO"
>  nillable="true" type="ns1:BaseObjectDTO" /> </xsd:sequence>
>   </xsd:complexType>
>   </xsd:schema>
>   </wsdl:types>
> <wsdl:message name="getVolume1Response">
>   <wsdl:part name="parameters" element="tns:getVolume1Response" />
>   </wsdl:message>
> <wsdl:message name="getArrayOfDataResponse">
>   <wsdl:part name="parameters" element="tns:getArrayOfDataResponse" />
>   </wsdl:message>
> <wsdl:message name="getVolume1Request">
>   <wsdl:part name="parameters" element="tns:getVolume1" />
>   </wsdl:message>
> <wsdl:message name="getDemoPropertiesResponse">
>   <wsdl:part name="parameters" element="tns:getDemoPropertiesResponse" />
>   </wsdl:message>
> <wsdl:message name="getVolumeResponse">
>   <wsdl:part name="parameters" element="tns:getVolumeResponse" />
>   </wsdl:message>
> <wsdl:message name="getArrayOfDataRequest">
>   <wsdl:part name="parameters" element="tns:getArrayOfData" />
>   </wsdl:message>
> <wsdl:message name="getDemoPropertiesRequest">
>   <wsdl:part name="parameters" element="tns:getDemoProperties" />
>   </wsdl:message>
> <wsdl:message name="getVolumeRequest">
>   <wsdl:part name="parameters" element="tns:getVolume" />
>   </wsdl:message>
> <wsdl:portType name="Demo">
> <wsdl:operation name="getVolume1">
>   <wsdl:input name="getVolume1Request" message="tns:getVolume1Request" />
>   <wsdl:output name="getVolume1Response" message="tns:getVolume1Response"
>  /> </wsdl:operation>
> <wsdl:operation name="getArrayOfData">
>   <wsdl:input name="getArrayOfDataRequest"
>  message="tns:getArrayOfDataRequest" /> <wsdl:output
>  name="getArrayOfDataResponse" message="tns:getArrayOfDataResponse" />
>  </wsdl:operation>
> <wsdl:operation name="getVolume">
>   <wsdl:input name="getVolumeRequest" message="tns:getVolumeRequest" />
>   <wsdl:output name="getVolumeResponse" message="tns:getVolumeResponse" />
>   </wsdl:operation>
> <wsdl:operation name="getDemoProperties">
>   <wsdl:input name="getDemoPropertiesRequest"
>  message="tns:getDemoPropertiesRequest" /> <wsdl:output
>  name="getDemoPropertiesResponse" message="tns:getDemoPropertiesResponse"
>  /> </wsdl:operation>
>   </wsdl:portType>
> <wsdl:binding name="DemoHttpBinding" type="tns:Demo">
>   <wsdlsoap:binding style="document"
>  transport="http://schemas.xmlsoap.org/soap/http" /> <wsdl:operation
>  name="getVolume1">
>   <wsdlsoap:operation soapAction="" />
> <wsdl:input name="getVolume1Request">
>   <wsdlsoap:body use="literal" />
>   </wsdl:input>
> <wsdl:output name="getVolume1Response">
>   <wsdlsoap:body use="literal" />
>   </wsdl:output>
>   </wsdl:operation>
> <wsdl:operation name="getArrayOfData">
>   <wsdlsoap:operation soapAction="" />
> <wsdl:input name="getArrayOfDataRequest">
>   <wsdlsoap:body use="literal" />
>   </wsdl:input>
> <wsdl:output name="getArrayOfDataResponse">
>   <wsdlsoap:body use="literal" />
>   </wsdl:output>
>   </wsdl:operation>
> <wsdl:operation name="getVolume">
>   <wsdlsoap:operation soapAction="" />
> <wsdl:input name="getVolumeRequest">
>   <wsdlsoap:body use="literal" />
>   </wsdl:input>
> <wsdl:output name="getVolumeResponse">
>   <wsdlsoap:body use="literal" />
>   </wsdl:output>
>   </wsdl:operation>
> <wsdl:operation name="getDemoProperties">
>   <wsdlsoap:operation soapAction="" />
> <wsdl:input name="getDemoPropertiesRequest">
>   <wsdlsoap:body use="literal" />
>   </wsdl:input>
> <wsdl:output name="getDemoPropertiesResponse">
>   <wsdlsoap:body use="literal" />
>   </wsdl:output>
>   </wsdl:operation>
>   </wsdl:binding>
> <wsdl:service name="Demo">
> <wsdl:port name="DemoHttpPort" binding="tns:DemoHttpBinding">
>   <wsdlsoap:address location="http://localhost:8080/demo/services/Demo" />
>   </wsdl:port>
>   </wsdl:service>
>   </wsdl:definitions>
> 
> 
> ----------------------------------------
> Configuration - services.xml
> ----------------------------------------
> 
> <beans xmlns="http://xfire.codehaus.org/config/1.0">
>   <service>
>     <name>Demo</name>
>     <serviceClass>demowar.server.IDemo</serviceClass>
>     <implementationClass>demowar.server.DemoImpl</implementationClass>
>     <serviceFactory>jsr181</serviceFactory>
>     <properties>
>       <property key="writeXsiType">true</property>
>       <property key="overrideTypesList">
>         <list xmlns="">
>           <value>demowar.dto.VolumePropertiesDTO</value>
>         </list>
>       </property>
>     </properties>
>   </service>
> </beans>
> 
> Thanks,
> Luba A.
> 
> -----Original Message-----
> From: Benson Margulies [mailto:bimargulies@gmail.com]
> Sent: Wednesday, November 11, 2009 23:24 PM
> To: users@cxf.apache.org
> Subject: Re: How to configure CXF client consume wsdl with overloaded
>  methods?
> 
> Dan,
> 
> So, we have the following situation?
> 
> XFire let the OP create a non-WSI-BP service, and purports to generate a
> WSDL for it. If the version of Aegis was the same on both ends, it would
> work. If the particular API does not happen to run into one of the areas
> where Aegis has changed what goes on the wire (and there are a lot more
> changes to how it writes the schema than how it writes the data) it might
> work, but if it doesn't work, it's going to be pretty challenging to make
>  it work.
> 
> --benson
> 
> On Wed, Nov 11, 2009 at 3:37 PM, Daniel Kulp <dk...@apache.org> wrote:
> > Two notes:
> >
> > 1)  Without the wsdl and the IVolume interface you are using, it might be
> > hard
> > to diagnose.   You may need to put them someplace public or log a JIRA or
> > similar.   The mailing list usually strips attachments.
> >
> > 2) Operation overloading in wsdl is not supported.    It's specifically
> > forbidden in the WSI-BP.     That said, on the interface, if the proper
> > annotations are there, it MAY work.
> >
> > Dan
> >
> > On Wed November 11 2009 7:02:27 am Alpin, Luba wrote:
> > > I need a help to configure my CXF client to use XFire SOAP service with
> > >  overloaded methods.
> > >
> > >
> > >
> > > IVolume interface has two method 'getVolumes' with different signature
> > >
> > >
> > >
> > > Wsdl has one 'getVolumes' and second 'getVolumes1'
> > >
> > >
> > >
> > > This is the dump of error:
> > >
> > >
> > >
> > > INFO: Creating Service {http://xfire.codehaus.org/IVolume}IVolume from
> > >  WSDL: http://localhost:8080/public/services/IVolume?wsdl
> > >
> > > Nov 11, 2009 1:46:48 PM
> > >  org.apache.cxf.service.factory.ReflectionServiceFactoryBean
> > >  initializeWSDLOperations
> > >
> > > WARNING: Could not find a matching method for operation
> > >  {http://xfire.codehaus.org/IVolume}getVolumes1. Operation will be
> > >  unavailable.
> > >
> > > java.lang.NullPointerException
> > >
> > >       at
> >
> > 
> > org.apache.cxf.aegis.databinding.AegisDatabinding.getParameterType(AegisD
> >a
> >
> > > tabinding.java:581)
> > >
> > >       at
> >
> > 
> > org.apache.cxf.aegis.databinding.AegisDatabinding.initializeMessage(Aegis
> >D
> >
> > > atabinding.java:342)
> > >
> > >       at
> >
> > 
> > org.apache.cxf.aegis.databinding.AegisDatabinding.initializeOperation(Aeg
> >i
> >
> > > sDatabinding.java:303)
> > >
> > >       at
> >
> > 
> > org.apache.cxf.aegis.databinding.AegisDatabinding.initialize(AegisDatabin
> >d
> >
> > > ing.java:267)
> > >
> > >       at
> >
> > 
> > org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceF
> >r
> >
> > > omWSDL(ReflectionServiceFactoryBean.java:363)
> > >
> > >       at
> >
> > 
> > org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeSer
> >v
> >
> > > iceModel(ReflectionServiceFactoryBean.java:459)
> > >
> > >       at
> >
> > 
> > org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(Reflec
> >t
> >
> > > ionServiceFactoryBean.java:212)
> > >
> > >       at
> >
> > 
> > org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceF
> >a
> >
> > > ctoryBean.java:163)
> > >
> > >       at
> >
> > 
> > org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(A
> >b
> >
> > > stractWSDLBasedEndpointFactory.java:100)
> > >
> > >       at
> >
> > 
> > org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:5
> >2
> >
> > > )
> > >
> > >       at
> >
> > 
> > org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryB
> >e
> >
> > > an.java:102)
> > >
> > >       at
> >
> > 
> > org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.j
> >a
> >
> > > va:115)
> > >
> > >       at
> > > 
> > > com.lsi.xfireConnector.CXFUtil.typedServiceProxyCreator(CXFUtil.java:67
> > >)
> > >
> > >
> > >
> > > This is my client:
> > >
> > >
> > >
> > >       JaxWsProxyFactoryBean client = new JaxWsProxyFactoryBean();
> > >
> > >       client.setServiceClass(clazz);
> > >
> > >       client.setAddress(url);
> > >
> > >       client.setWsdlURL(url + "?wsdl");
> > >
> > >       AegisDatabinding db = new AegisDatabinding();
> > >
> > >       AegisContext context = new AegisContext();
> > >
> > >       context.setWriteXsiTypes(false);
> > >
> > >       context.setReadXsiTypes(true);
> > >
> > >       db.setAegisContext(context);
> > >
> > >       client.setDataBinding(db);
> > >
> > >       IVolume object = (IVolume) client.create();
> > >
> > >
> > >
> > > Thanks,
> > >
> > > Luba A.
> >
> > --
> > Daniel Kulp
> > dkulp@apache.org
> > http://www.dankulp.com/blog
> 

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

Re: How to configure CXF client consume wsdl with overloaded methods?

Posted by Benson Margulies <bi...@gmail.com>.
No, my advice is to run CXF wsdl2java on your WSDL and try out the resulting
client.


On Thu, Nov 12, 2009 at 8:37 AM, Alpin, Luba <Lu...@lsi.com> wrote:

> If I understand correct your advice me to change server implementation. I
> can't do this.
> The server is freeze for changes and other XFire clients have no problem to
> use hundreds closed apis. But one client used CXF can't use them. So the
> changes must be done by this specific client.
>
> Regards,
> Luba A.
>
>
> -----Original Message-----
> From: Benson Margulies [mailto:bimargulies@gmail.com]
> Sent: Thursday, November 12, 2009 14:59 PM
> To: users@cxf.apache.org
> Subject: Re: How to configure CXF client consume wsdl with overloaded
> methods?
>
> If you run this into wsdl2java, you'll get a getVolume and a getVolume1.
> They might both work.
>
> On Thu, Nov 12, 2009 at 3:08 AM, Alpin, Luba <Lu...@lsi.com> wrote:
>
> >
> > My demo is really small program to demonstrate problematic area from real
> > code, so I paste it right to this email.
> >
> >
> ----------------------------------------------------------------------------
> > Interface of service IVolume.java
> > ------------------------------------
> >
> > package demowar.server;
> >
> > import java.util.*;
> >
> > import javax.jws.WebService;
> > import demowar.dto.*;
> >
> > @WebService(name = "Demo", targetNamespace = "
> > http://xfire.codehaus.org/Demo")public interface
> >        IDemo {
> >
> >    //works OK
> >    public Properties getDemoProperties();
> >    //works OK
> >    public BaseObjectDTO[] getArrayOfData();
> >
> >    // overloading doesn't work for CXF with XFire all works good
> >    public VolumePropertiesDTO getVolume(String name);
> >    public VolumePropertiesDTO getVolume(String name, int size);
> > }
> >
> > Implementation VolumeImpl.java
> > -------------------------------
> > package demowar.server;
> >
> > import java.util.Properties;
> > import demowar.dto.*;
> >
> > public class DemoImpl implements IDemo {
> >    public Properties getDemoProperties() {
> >        Properties p = new Properties();
> >        p.setProperty("key-1", "value-1");
> >        p.setProperty("key-2", "value-2");
> >        return p;
> >    }
> >
> >    public BaseObjectDTO[] getArrayOfData() {
> >        BaseObjectDTO[] arr = new BaseObjectDTO[3];
> >        for (int i = 0; i < arr.length; i++) {
> >            arr[i] = new VolumePropertiesDTO("Name-" + i, i);
> >        }
> >        return arr;
> >    }
> >
> >    public VolumePropertiesDTO getVolume(String name) {
> >        return new VolumePropertiesDTO(name, 0);
> >    }
> >
> >    public VolumePropertiesDTO getVolume(String name, int size) {
> >        return new VolumePropertiesDTO(name, size);
> >    }
> > }
> >
> > --------------
> > WSDL - Demo.wsdl
> > --------------
> >
> > <?xml version="1.0" encoding="UTF-8" ?>
> > <wsdl:definitions targetNamespace="http://xfire.codehaus.org/Demo"
> > xmlns:tns="http://xfire.codehaus.org/Demo" xmlns:wsdlsoap="
> > http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="
> > http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://dto.demowar"
> > xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenc11="
> > http://schemas.xmlsoap.org/soap/encoding/" xmlns:soapenc12="
> > http://www.w3.org/2003/05/soap-encoding" xmlns:soap11="
> > http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsdl="
> > http://schemas.xmlsoap.org/wsdl/">
> > <wsdl:types>
> > <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> > attributeFormDefault="qualified" elementFormDefault="qualified"
> > targetNamespace="http://xfire.codehaus.org/Demo">
> > <xsd:element name="getVolume1">
> > <xsd:complexType>
> > <xsd:sequence>
> >  <xsd:element maxOccurs="1" minOccurs="1" name="in0" nillable="true"
> > type="xsd:string" />
> >  <xsd:element maxOccurs="1" minOccurs="1" name="in1" type="xsd:int" />
> >  </xsd:sequence>
> >  </xsd:complexType>
> >  </xsd:element>
> > <xsd:element name="getVolume1Response">
> > <xsd:complexType>
> > <xsd:sequence>
> >  <xsd:element maxOccurs="1" minOccurs="1" name="out" nillable="true"
> > type="ns1:VolumePropertiesDTO" />
> >  </xsd:sequence>
> >  </xsd:complexType>
> >  </xsd:element>
> > <xsd:element name="getArrayOfData">
> >  <xsd:complexType />
> >  </xsd:element>
> > <xsd:element name="getArrayOfDataResponse">
> > <xsd:complexType>
> > <xsd:sequence>
> >  <xsd:element maxOccurs="1" minOccurs="1" name="out" nillable="true"
> > type="ns1:ArrayOfBaseObjectDTO" />
> >  </xsd:sequence>
> >  </xsd:complexType>
> >  </xsd:element>
> > <xsd:element name="getVolume">
> > <xsd:complexType>
> > <xsd:sequence>
> >  <xsd:element maxOccurs="1" minOccurs="1" name="in0" nillable="true"
> > type="xsd:string" />
> >  </xsd:sequence>
> >  </xsd:complexType>
> >  </xsd:element>
> > <xsd:element name="getVolumeResponse">
> > <xsd:complexType>
> > <xsd:sequence>
> >  <xsd:element maxOccurs="1" minOccurs="1" name="out" nillable="true"
> > type="ns1:VolumePropertiesDTO" />
> >  </xsd:sequence>
> >  </xsd:complexType>
> >  </xsd:element>
> > <xsd:element name="getDemoProperties">
> >  <xsd:complexType />
> >  </xsd:element>
> > <xsd:complexType name="anyType2anyTypeMap">
> > <xsd:sequence>
> > <xsd:element maxOccurs="unbounded" minOccurs="0" name="entry">
> > <xsd:complexType>
> > <xsd:sequence>
> >  <xsd:element maxOccurs="1" minOccurs="0" name="key" type="xsd:anyType"
> />
> >  <xsd:element maxOccurs="1" minOccurs="0" name="value" type="xsd:anyType"
> > />
> >  </xsd:sequence>
> >  </xsd:complexType>
> >  </xsd:element>
> >  </xsd:sequence>
> >  </xsd:complexType>
> > <xsd:element name="getDemoPropertiesResponse">
> > <xsd:complexType>
> > <xsd:sequence>
> >  <xsd:element maxOccurs="1" minOccurs="1" name="out" nillable="true"
> > type="tns:anyType2anyTypeMap" />
> >  </xsd:sequence>
> >  </xsd:complexType>
> >  </xsd:element>
> >  </xsd:schema>
> > <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> > attributeFormDefault="qualified" elementFormDefault="qualified"
> > targetNamespace="http://dto.demowar">
> > <xsd:complexType name="VolumePropertiesDTO">
> > <xsd:complexContent>
> > <xsd:extension base="ns1:BaseObjectDTO">
> > <xsd:sequence>
> >  <xsd:element minOccurs="0" name="size" type="xsd:int" />
> >  </xsd:sequence>
> >  </xsd:extension>
> >  </xsd:complexContent>
> >  </xsd:complexType>
> > <xsd:complexType name="BaseObjectDTO">
> > <xsd:sequence>
> >  <xsd:element minOccurs="0" name="name" nillable="true" type="xsd:string"
> > />
> >  </xsd:sequence>
> >  </xsd:complexType>
> > <xsd:complexType name="ArrayOfBaseObjectDTO">
> > <xsd:sequence>
> >  <xsd:element maxOccurs="unbounded" minOccurs="0" name="BaseObjectDTO"
> > nillable="true" type="ns1:BaseObjectDTO" />
> >  </xsd:sequence>
> >  </xsd:complexType>
> >  </xsd:schema>
> >  </wsdl:types>
> > <wsdl:message name="getVolume1Response">
> >  <wsdl:part name="parameters" element="tns:getVolume1Response" />
> >  </wsdl:message>
> > <wsdl:message name="getArrayOfDataResponse">
> >  <wsdl:part name="parameters" element="tns:getArrayOfDataResponse" />
> >  </wsdl:message>
> > <wsdl:message name="getVolume1Request">
> >  <wsdl:part name="parameters" element="tns:getVolume1" />
> >  </wsdl:message>
> > <wsdl:message name="getDemoPropertiesResponse">
> >  <wsdl:part name="parameters" element="tns:getDemoPropertiesResponse" />
> >  </wsdl:message>
> > <wsdl:message name="getVolumeResponse">
> >  <wsdl:part name="parameters" element="tns:getVolumeResponse" />
> >  </wsdl:message>
> > <wsdl:message name="getArrayOfDataRequest">
> >  <wsdl:part name="parameters" element="tns:getArrayOfData" />
> >  </wsdl:message>
> > <wsdl:message name="getDemoPropertiesRequest">
> >  <wsdl:part name="parameters" element="tns:getDemoProperties" />
> >  </wsdl:message>
> > <wsdl:message name="getVolumeRequest">
> >  <wsdl:part name="parameters" element="tns:getVolume" />
> >  </wsdl:message>
> > <wsdl:portType name="Demo">
> > <wsdl:operation name="getVolume1">
> >  <wsdl:input name="getVolume1Request" message="tns:getVolume1Request" />
> >  <wsdl:output name="getVolume1Response" message="tns:getVolume1Response"
> />
> >  </wsdl:operation>
> > <wsdl:operation name="getArrayOfData">
> >  <wsdl:input name="getArrayOfDataRequest"
> > message="tns:getArrayOfDataRequest" />
> >  <wsdl:output name="getArrayOfDataResponse"
> > message="tns:getArrayOfDataResponse" />
> >  </wsdl:operation>
> > <wsdl:operation name="getVolume">
> >  <wsdl:input name="getVolumeRequest" message="tns:getVolumeRequest" />
> >  <wsdl:output name="getVolumeResponse" message="tns:getVolumeResponse" />
> >  </wsdl:operation>
> > <wsdl:operation name="getDemoProperties">
> >  <wsdl:input name="getDemoPropertiesRequest"
> > message="tns:getDemoPropertiesRequest" />
> >  <wsdl:output name="getDemoPropertiesResponse"
> > message="tns:getDemoPropertiesResponse" />
> >  </wsdl:operation>
> >  </wsdl:portType>
> > <wsdl:binding name="DemoHttpBinding" type="tns:Demo">
> >  <wsdlsoap:binding style="document" transport="
> > http://schemas.xmlsoap.org/soap/http" />
> > <wsdl:operation name="getVolume1">
> >  <wsdlsoap:operation soapAction="" />
> > <wsdl:input name="getVolume1Request">
> >  <wsdlsoap:body use="literal" />
> >  </wsdl:input>
> > <wsdl:output name="getVolume1Response">
> >  <wsdlsoap:body use="literal" />
> >  </wsdl:output>
> >  </wsdl:operation>
> > <wsdl:operation name="getArrayOfData">
> >  <wsdlsoap:operation soapAction="" />
> > <wsdl:input name="getArrayOfDataRequest">
> >  <wsdlsoap:body use="literal" />
> >  </wsdl:input>
> > <wsdl:output name="getArrayOfDataResponse">
> >  <wsdlsoap:body use="literal" />
> >  </wsdl:output>
> >  </wsdl:operation>
> > <wsdl:operation name="getVolume">
> >  <wsdlsoap:operation soapAction="" />
> > <wsdl:input name="getVolumeRequest">
> >  <wsdlsoap:body use="literal" />
> >  </wsdl:input>
> > <wsdl:output name="getVolumeResponse">
> >  <wsdlsoap:body use="literal" />
> >  </wsdl:output>
> >  </wsdl:operation>
> > <wsdl:operation name="getDemoProperties">
> >  <wsdlsoap:operation soapAction="" />
> > <wsdl:input name="getDemoPropertiesRequest">
> >  <wsdlsoap:body use="literal" />
> >  </wsdl:input>
> > <wsdl:output name="getDemoPropertiesResponse">
> >  <wsdlsoap:body use="literal" />
> >  </wsdl:output>
> >  </wsdl:operation>
> >  </wsdl:binding>
> > <wsdl:service name="Demo">
> > <wsdl:port name="DemoHttpPort" binding="tns:DemoHttpBinding">
> >  <wsdlsoap:address location="http://localhost:8080/demo/services/Demo"
> />
> >  </wsdl:port>
> >  </wsdl:service>
> >  </wsdl:definitions>
> >
> >
> > ----------------------------------------
> > Configuration - services.xml
> > ----------------------------------------
> >
> > <beans xmlns="http://xfire.codehaus.org/config/1.0">
> >  <service>
> >    <name>Demo</name>
> >    <serviceClass>demowar.server.IDemo</serviceClass>
> >    <implementationClass>demowar.server.DemoImpl</implementationClass>
> >    <serviceFactory>jsr181</serviceFactory>
> >    <properties>
> >      <property key="writeXsiType">true</property>
> >      <property key="overrideTypesList">
> >        <list xmlns="">
> >          <value>demowar.dto.VolumePropertiesDTO</value>
> >        </list>
> >      </property>
> >    </properties>
> >  </service>
> > </beans>
> >
> > Thanks,
> > Luba A.
> >
> > -----Original Message-----
> > From: Benson Margulies [mailto:bimargulies@gmail.com]
> > Sent: Wednesday, November 11, 2009 23:24 PM
> > To: users@cxf.apache.org
> > Subject: Re: How to configure CXF client consume wsdl with overloaded
> > methods?
> >
> > Dan,
> >
> > So, we have the following situation?
> >
> > XFire let the OP create a non-WSI-BP service, and purports to generate a
> > WSDL for it. If the version of Aegis was the same on both ends, it would
> > work. If the particular API does not happen to run into one of the areas
> > where Aegis has changed what goes on the wire (and there are a lot more
> > changes to how it writes the schema than how it writes the data) it might
> > work, but if it doesn't work, it's going to be pretty challenging to make
> > it
> > work.
> >
> > --benson
> >
> >
> > On Wed, Nov 11, 2009 at 3:37 PM, Daniel Kulp <dk...@apache.org> wrote:
> >
> > >
> > > Two notes:
> > >
> > > 1)  Without the wsdl and the IVolume interface you are using, it might
> be
> > > hard
> > > to diagnose.   You may need to put them someplace public or log a JIRA
> or
> > > similar.   The mailing list usually strips attachments.
> > >
> > > 2) Operation overloading in wsdl is not supported.    It's specifically
> > > forbidden in the WSI-BP.     That said, on the interface, if the proper
> > > annotations are there, it MAY work.
> > >
> > > Dan
> > >
> > >
> > > On Wed November 11 2009 7:02:27 am Alpin, Luba wrote:
> > > > I need a help to configure my CXF client to use XFire SOAP service
> with
> > > >  overloaded methods.
> > > >
> > > >
> > > >
> > > > IVolume interface has two method 'getVolumes' with different
> signature
> > > >
> > > >
> > > >
> > > > Wsdl has one 'getVolumes' and second 'getVolumes1'
> > > >
> > > >
> > > >
> > > > This is the dump of error:
> > > >
> > > >
> > > >
> > > > INFO: Creating Service {http://xfire.codehaus.org/IVolume}IVolumefrom
> > > >  WSDL: http://localhost:8080/public/services/IVolume?wsdl
> > > >
> > > > Nov 11, 2009 1:46:48 PM
> > > >  org.apache.cxf.service.factory.ReflectionServiceFactoryBean
> > > >  initializeWSDLOperations
> > > >
> > > > WARNING: Could not find a matching method for operation
> > > >  {http://xfire.codehaus.org/IVolume}getVolumes1. Operation will be
> > > >  unavailable.
> > > >
> > > > java.lang.NullPointerException
> > > >
> > > >       at
> > > >
> > >
> >
>  org.apache.cxf.aegis.databinding.AegisDatabinding.getParameterType(AegisDa
> > > > tabinding.java:581)
> > > >
> > > >       at
> > > >
> > >
> >
>  org.apache.cxf.aegis.databinding.AegisDatabinding.initializeMessage(AegisD
> > > > atabinding.java:342)
> > > >
> > > >       at
> > > >
> > >
> >
>  org.apache.cxf.aegis.databinding.AegisDatabinding.initializeOperation(Aegi
> > > > sDatabinding.java:303)
> > > >
> > > >       at
> > > >
> > >
> >
>  org.apache.cxf.aegis.databinding.AegisDatabinding.initialize(AegisDatabind
> > > > ing.java:267)
> > > >
> > > >       at
> > > >
> > >
> >
>  org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFr
> > > > omWSDL(ReflectionServiceFactoryBean.java:363)
> > > >
> > > >       at
> > > >
> > >
> >
>  org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServ
> > > > iceModel(ReflectionServiceFactoryBean.java:459)
> > > >
> > > >       at
> > > >
> > >
> >
>  org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(Reflect
> > > > ionServiceFactoryBean.java:212)
> > > >
> > > >       at
> > > >
> > >
> >
>  org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFa
> > > > ctoryBean.java:163)
> > > >
> > > >       at
> > > >
> > >
> >
>  org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(Ab
> > > > stractWSDLBasedEndpointFactory.java:100)
> > > >
> > > >       at
> > > >
> > >
> >
>  org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:52
> > > > )
> > > >
> > > >       at
> > > >
> > >
> >
>  org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBe
> > > > an.java:102)
> > > >
> > > >       at
> > > >
> > >
> >
>  org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.ja
> > > > va:115)
> > > >
> > > >       at
> > > >
> >  com.lsi.xfireConnector.CXFUtil.typedServiceProxyCreator(CXFUtil.java:67)
> > > >
> > > >
> > > >
> > > > This is my client:
> > > >
> > > >
> > > >
> > > >       JaxWsProxyFactoryBean client = new JaxWsProxyFactoryBean();
> > > >
> > > >       client.setServiceClass(clazz);
> > > >
> > > >       client.setAddress(url);
> > > >
> > > >       client.setWsdlURL(url + "?wsdl");
> > > >
> > > >       AegisDatabinding db = new AegisDatabinding();
> > > >
> > > >       AegisContext context = new AegisContext();
> > > >
> > > >       context.setWriteXsiTypes(false);
> > > >
> > > >       context.setReadXsiTypes(true);
> > > >
> > > >       db.setAegisContext(context);
> > > >
> > > >       client.setDataBinding(db);
> > > >
> > > >       IVolume object = (IVolume) client.create();
> > > >
> > > >
> > > >
> > > > Thanks,
> > > >
> > > > Luba A.
> > > >
> > >
> > > --
> > > Daniel Kulp
> > > dkulp@apache.org
> > > http://www.dankulp.com/blog
> > >
> >
>

RE: How to configure CXF client consume wsdl with overloaded methods?

Posted by "Alpin, Luba" <Lu...@lsi.com>.
If I understand correct your advice me to change server implementation. I can't do this.
The server is freeze for changes and other XFire clients have no problem to use hundreds closed apis. But one client used CXF can't use them. So the changes must be done by this specific client.

Regards,
Luba A.


-----Original Message-----
From: Benson Margulies [mailto:bimargulies@gmail.com]
Sent: Thursday, November 12, 2009 14:59 PM
To: users@cxf.apache.org
Subject: Re: How to configure CXF client consume wsdl with overloaded methods?

If you run this into wsdl2java, you'll get a getVolume and a getVolume1.
They might both work.

On Thu, Nov 12, 2009 at 3:08 AM, Alpin, Luba <Lu...@lsi.com> wrote:

>
> My demo is really small program to demonstrate problematic area from real
> code, so I paste it right to this email.
>
> ----------------------------------------------------------------------------
> Interface of service IVolume.java
> ------------------------------------
>
> package demowar.server;
>
> import java.util.*;
>
> import javax.jws.WebService;
> import demowar.dto.*;
>
> @WebService(name = "Demo", targetNamespace = "
> http://xfire.codehaus.org/Demo")public interface
>        IDemo {
>
>    //works OK
>    public Properties getDemoProperties();
>    //works OK
>    public BaseObjectDTO[] getArrayOfData();
>
>    // overloading doesn't work for CXF with XFire all works good
>    public VolumePropertiesDTO getVolume(String name);
>    public VolumePropertiesDTO getVolume(String name, int size);
> }
>
> Implementation VolumeImpl.java
> -------------------------------
> package demowar.server;
>
> import java.util.Properties;
> import demowar.dto.*;
>
> public class DemoImpl implements IDemo {
>    public Properties getDemoProperties() {
>        Properties p = new Properties();
>        p.setProperty("key-1", "value-1");
>        p.setProperty("key-2", "value-2");
>        return p;
>    }
>
>    public BaseObjectDTO[] getArrayOfData() {
>        BaseObjectDTO[] arr = new BaseObjectDTO[3];
>        for (int i = 0; i < arr.length; i++) {
>            arr[i] = new VolumePropertiesDTO("Name-" + i, i);
>        }
>        return arr;
>    }
>
>    public VolumePropertiesDTO getVolume(String name) {
>        return new VolumePropertiesDTO(name, 0);
>    }
>
>    public VolumePropertiesDTO getVolume(String name, int size) {
>        return new VolumePropertiesDTO(name, size);
>    }
> }
>
> --------------
> WSDL - Demo.wsdl
> --------------
>
> <?xml version="1.0" encoding="UTF-8" ?>
> <wsdl:definitions targetNamespace="http://xfire.codehaus.org/Demo"
> xmlns:tns="http://xfire.codehaus.org/Demo" xmlns:wsdlsoap="
> http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="
> http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://dto.demowar"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenc11="
> http://schemas.xmlsoap.org/soap/encoding/" xmlns:soapenc12="
> http://www.w3.org/2003/05/soap-encoding" xmlns:soap11="
> http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsdl="
> http://schemas.xmlsoap.org/wsdl/">
> <wsdl:types>
> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> attributeFormDefault="qualified" elementFormDefault="qualified"
> targetNamespace="http://xfire.codehaus.org/Demo">
> <xsd:element name="getVolume1">
> <xsd:complexType>
> <xsd:sequence>
>  <xsd:element maxOccurs="1" minOccurs="1" name="in0" nillable="true"
> type="xsd:string" />
>  <xsd:element maxOccurs="1" minOccurs="1" name="in1" type="xsd:int" />
>  </xsd:sequence>
>  </xsd:complexType>
>  </xsd:element>
> <xsd:element name="getVolume1Response">
> <xsd:complexType>
> <xsd:sequence>
>  <xsd:element maxOccurs="1" minOccurs="1" name="out" nillable="true"
> type="ns1:VolumePropertiesDTO" />
>  </xsd:sequence>
>  </xsd:complexType>
>  </xsd:element>
> <xsd:element name="getArrayOfData">
>  <xsd:complexType />
>  </xsd:element>
> <xsd:element name="getArrayOfDataResponse">
> <xsd:complexType>
> <xsd:sequence>
>  <xsd:element maxOccurs="1" minOccurs="1" name="out" nillable="true"
> type="ns1:ArrayOfBaseObjectDTO" />
>  </xsd:sequence>
>  </xsd:complexType>
>  </xsd:element>
> <xsd:element name="getVolume">
> <xsd:complexType>
> <xsd:sequence>
>  <xsd:element maxOccurs="1" minOccurs="1" name="in0" nillable="true"
> type="xsd:string" />
>  </xsd:sequence>
>  </xsd:complexType>
>  </xsd:element>
> <xsd:element name="getVolumeResponse">
> <xsd:complexType>
> <xsd:sequence>
>  <xsd:element maxOccurs="1" minOccurs="1" name="out" nillable="true"
> type="ns1:VolumePropertiesDTO" />
>  </xsd:sequence>
>  </xsd:complexType>
>  </xsd:element>
> <xsd:element name="getDemoProperties">
>  <xsd:complexType />
>  </xsd:element>
> <xsd:complexType name="anyType2anyTypeMap">
> <xsd:sequence>
> <xsd:element maxOccurs="unbounded" minOccurs="0" name="entry">
> <xsd:complexType>
> <xsd:sequence>
>  <xsd:element maxOccurs="1" minOccurs="0" name="key" type="xsd:anyType" />
>  <xsd:element maxOccurs="1" minOccurs="0" name="value" type="xsd:anyType"
> />
>  </xsd:sequence>
>  </xsd:complexType>
>  </xsd:element>
>  </xsd:sequence>
>  </xsd:complexType>
> <xsd:element name="getDemoPropertiesResponse">
> <xsd:complexType>
> <xsd:sequence>
>  <xsd:element maxOccurs="1" minOccurs="1" name="out" nillable="true"
> type="tns:anyType2anyTypeMap" />
>  </xsd:sequence>
>  </xsd:complexType>
>  </xsd:element>
>  </xsd:schema>
> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> attributeFormDefault="qualified" elementFormDefault="qualified"
> targetNamespace="http://dto.demowar">
> <xsd:complexType name="VolumePropertiesDTO">
> <xsd:complexContent>
> <xsd:extension base="ns1:BaseObjectDTO">
> <xsd:sequence>
>  <xsd:element minOccurs="0" name="size" type="xsd:int" />
>  </xsd:sequence>
>  </xsd:extension>
>  </xsd:complexContent>
>  </xsd:complexType>
> <xsd:complexType name="BaseObjectDTO">
> <xsd:sequence>
>  <xsd:element minOccurs="0" name="name" nillable="true" type="xsd:string"
> />
>  </xsd:sequence>
>  </xsd:complexType>
> <xsd:complexType name="ArrayOfBaseObjectDTO">
> <xsd:sequence>
>  <xsd:element maxOccurs="unbounded" minOccurs="0" name="BaseObjectDTO"
> nillable="true" type="ns1:BaseObjectDTO" />
>  </xsd:sequence>
>  </xsd:complexType>
>  </xsd:schema>
>  </wsdl:types>
> <wsdl:message name="getVolume1Response">
>  <wsdl:part name="parameters" element="tns:getVolume1Response" />
>  </wsdl:message>
> <wsdl:message name="getArrayOfDataResponse">
>  <wsdl:part name="parameters" element="tns:getArrayOfDataResponse" />
>  </wsdl:message>
> <wsdl:message name="getVolume1Request">
>  <wsdl:part name="parameters" element="tns:getVolume1" />
>  </wsdl:message>
> <wsdl:message name="getDemoPropertiesResponse">
>  <wsdl:part name="parameters" element="tns:getDemoPropertiesResponse" />
>  </wsdl:message>
> <wsdl:message name="getVolumeResponse">
>  <wsdl:part name="parameters" element="tns:getVolumeResponse" />
>  </wsdl:message>
> <wsdl:message name="getArrayOfDataRequest">
>  <wsdl:part name="parameters" element="tns:getArrayOfData" />
>  </wsdl:message>
> <wsdl:message name="getDemoPropertiesRequest">
>  <wsdl:part name="parameters" element="tns:getDemoProperties" />
>  </wsdl:message>
> <wsdl:message name="getVolumeRequest">
>  <wsdl:part name="parameters" element="tns:getVolume" />
>  </wsdl:message>
> <wsdl:portType name="Demo">
> <wsdl:operation name="getVolume1">
>  <wsdl:input name="getVolume1Request" message="tns:getVolume1Request" />
>  <wsdl:output name="getVolume1Response" message="tns:getVolume1Response" />
>  </wsdl:operation>
> <wsdl:operation name="getArrayOfData">
>  <wsdl:input name="getArrayOfDataRequest"
> message="tns:getArrayOfDataRequest" />
>  <wsdl:output name="getArrayOfDataResponse"
> message="tns:getArrayOfDataResponse" />
>  </wsdl:operation>
> <wsdl:operation name="getVolume">
>  <wsdl:input name="getVolumeRequest" message="tns:getVolumeRequest" />
>  <wsdl:output name="getVolumeResponse" message="tns:getVolumeResponse" />
>  </wsdl:operation>
> <wsdl:operation name="getDemoProperties">
>  <wsdl:input name="getDemoPropertiesRequest"
> message="tns:getDemoPropertiesRequest" />
>  <wsdl:output name="getDemoPropertiesResponse"
> message="tns:getDemoPropertiesResponse" />
>  </wsdl:operation>
>  </wsdl:portType>
> <wsdl:binding name="DemoHttpBinding" type="tns:Demo">
>  <wsdlsoap:binding style="document" transport="
> http://schemas.xmlsoap.org/soap/http" />
> <wsdl:operation name="getVolume1">
>  <wsdlsoap:operation soapAction="" />
> <wsdl:input name="getVolume1Request">
>  <wsdlsoap:body use="literal" />
>  </wsdl:input>
> <wsdl:output name="getVolume1Response">
>  <wsdlsoap:body use="literal" />
>  </wsdl:output>
>  </wsdl:operation>
> <wsdl:operation name="getArrayOfData">
>  <wsdlsoap:operation soapAction="" />
> <wsdl:input name="getArrayOfDataRequest">
>  <wsdlsoap:body use="literal" />
>  </wsdl:input>
> <wsdl:output name="getArrayOfDataResponse">
>  <wsdlsoap:body use="literal" />
>  </wsdl:output>
>  </wsdl:operation>
> <wsdl:operation name="getVolume">
>  <wsdlsoap:operation soapAction="" />
> <wsdl:input name="getVolumeRequest">
>  <wsdlsoap:body use="literal" />
>  </wsdl:input>
> <wsdl:output name="getVolumeResponse">
>  <wsdlsoap:body use="literal" />
>  </wsdl:output>
>  </wsdl:operation>
> <wsdl:operation name="getDemoProperties">
>  <wsdlsoap:operation soapAction="" />
> <wsdl:input name="getDemoPropertiesRequest">
>  <wsdlsoap:body use="literal" />
>  </wsdl:input>
> <wsdl:output name="getDemoPropertiesResponse">
>  <wsdlsoap:body use="literal" />
>  </wsdl:output>
>  </wsdl:operation>
>  </wsdl:binding>
> <wsdl:service name="Demo">
> <wsdl:port name="DemoHttpPort" binding="tns:DemoHttpBinding">
>  <wsdlsoap:address location="http://localhost:8080/demo/services/Demo" />
>  </wsdl:port>
>  </wsdl:service>
>  </wsdl:definitions>
>
>
> ----------------------------------------
> Configuration - services.xml
> ----------------------------------------
>
> <beans xmlns="http://xfire.codehaus.org/config/1.0">
>  <service>
>    <name>Demo</name>
>    <serviceClass>demowar.server.IDemo</serviceClass>
>    <implementationClass>demowar.server.DemoImpl</implementationClass>
>    <serviceFactory>jsr181</serviceFactory>
>    <properties>
>      <property key="writeXsiType">true</property>
>      <property key="overrideTypesList">
>        <list xmlns="">
>          <value>demowar.dto.VolumePropertiesDTO</value>
>        </list>
>      </property>
>    </properties>
>  </service>
> </beans>
>
> Thanks,
> Luba A.
>
> -----Original Message-----
> From: Benson Margulies [mailto:bimargulies@gmail.com]
> Sent: Wednesday, November 11, 2009 23:24 PM
> To: users@cxf.apache.org
> Subject: Re: How to configure CXF client consume wsdl with overloaded
> methods?
>
> Dan,
>
> So, we have the following situation?
>
> XFire let the OP create a non-WSI-BP service, and purports to generate a
> WSDL for it. If the version of Aegis was the same on both ends, it would
> work. If the particular API does not happen to run into one of the areas
> where Aegis has changed what goes on the wire (and there are a lot more
> changes to how it writes the schema than how it writes the data) it might
> work, but if it doesn't work, it's going to be pretty challenging to make
> it
> work.
>
> --benson
>
>
> On Wed, Nov 11, 2009 at 3:37 PM, Daniel Kulp <dk...@apache.org> wrote:
>
> >
> > Two notes:
> >
> > 1)  Without the wsdl and the IVolume interface you are using, it might be
> > hard
> > to diagnose.   You may need to put them someplace public or log a JIRA or
> > similar.   The mailing list usually strips attachments.
> >
> > 2) Operation overloading in wsdl is not supported.    It's specifically
> > forbidden in the WSI-BP.     That said, on the interface, if the proper
> > annotations are there, it MAY work.
> >
> > Dan
> >
> >
> > On Wed November 11 2009 7:02:27 am Alpin, Luba wrote:
> > > I need a help to configure my CXF client to use XFire SOAP service with
> > >  overloaded methods.
> > >
> > >
> > >
> > > IVolume interface has two method 'getVolumes' with different signature
> > >
> > >
> > >
> > > Wsdl has one 'getVolumes' and second 'getVolumes1'
> > >
> > >
> > >
> > > This is the dump of error:
> > >
> > >
> > >
> > > INFO: Creating Service {http://xfire.codehaus.org/IVolume}IVolume from
> > >  WSDL: http://localhost:8080/public/services/IVolume?wsdl
> > >
> > > Nov 11, 2009 1:46:48 PM
> > >  org.apache.cxf.service.factory.ReflectionServiceFactoryBean
> > >  initializeWSDLOperations
> > >
> > > WARNING: Could not find a matching method for operation
> > >  {http://xfire.codehaus.org/IVolume}getVolumes1. Operation will be
> > >  unavailable.
> > >
> > > java.lang.NullPointerException
> > >
> > >       at
> > >
> >
>  org.apache.cxf.aegis.databinding.AegisDatabinding.getParameterType(AegisDa
> > > tabinding.java:581)
> > >
> > >       at
> > >
> >
>  org.apache.cxf.aegis.databinding.AegisDatabinding.initializeMessage(AegisD
> > > atabinding.java:342)
> > >
> > >       at
> > >
> >
>  org.apache.cxf.aegis.databinding.AegisDatabinding.initializeOperation(Aegi
> > > sDatabinding.java:303)
> > >
> > >       at
> > >
> >
>  org.apache.cxf.aegis.databinding.AegisDatabinding.initialize(AegisDatabind
> > > ing.java:267)
> > >
> > >       at
> > >
> >
>  org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFr
> > > omWSDL(ReflectionServiceFactoryBean.java:363)
> > >
> > >       at
> > >
> >
>  org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServ
> > > iceModel(ReflectionServiceFactoryBean.java:459)
> > >
> > >       at
> > >
> >
>  org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(Reflect
> > > ionServiceFactoryBean.java:212)
> > >
> > >       at
> > >
> >
>  org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFa
> > > ctoryBean.java:163)
> > >
> > >       at
> > >
> >
>  org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(Ab
> > > stractWSDLBasedEndpointFactory.java:100)
> > >
> > >       at
> > >
> >
>  org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:52
> > > )
> > >
> > >       at
> > >
> >
>  org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBe
> > > an.java:102)
> > >
> > >       at
> > >
> >
>  org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.ja
> > > va:115)
> > >
> > >       at
> > >
>  com.lsi.xfireConnector.CXFUtil.typedServiceProxyCreator(CXFUtil.java:67)
> > >
> > >
> > >
> > > This is my client:
> > >
> > >
> > >
> > >       JaxWsProxyFactoryBean client = new JaxWsProxyFactoryBean();
> > >
> > >       client.setServiceClass(clazz);
> > >
> > >       client.setAddress(url);
> > >
> > >       client.setWsdlURL(url + "?wsdl");
> > >
> > >       AegisDatabinding db = new AegisDatabinding();
> > >
> > >       AegisContext context = new AegisContext();
> > >
> > >       context.setWriteXsiTypes(false);
> > >
> > >       context.setReadXsiTypes(true);
> > >
> > >       db.setAegisContext(context);
> > >
> > >       client.setDataBinding(db);
> > >
> > >       IVolume object = (IVolume) client.create();
> > >
> > >
> > >
> > > Thanks,
> > >
> > > Luba A.
> > >
> >
> > --
> > Daniel Kulp
> > dkulp@apache.org
> > http://www.dankulp.com/blog
> >
>

Re: How to configure CXF client consume wsdl with overloaded methods?

Posted by Benson Margulies <bi...@gmail.com>.
If you run this into wsdl2java, you'll get a getVolume and a getVolume1.
They might both work.

On Thu, Nov 12, 2009 at 3:08 AM, Alpin, Luba <Lu...@lsi.com> wrote:

>
> My demo is really small program to demonstrate problematic area from real
> code, so I paste it right to this email.
>
> ----------------------------------------------------------------------------
> Interface of service IVolume.java
> ------------------------------------
>
> package demowar.server;
>
> import java.util.*;
>
> import javax.jws.WebService;
> import demowar.dto.*;
>
> @WebService(name = "Demo", targetNamespace = "
> http://xfire.codehaus.org/Demo")public interface
>        IDemo {
>
>    //works OK
>    public Properties getDemoProperties();
>    //works OK
>    public BaseObjectDTO[] getArrayOfData();
>
>    // overloading doesn't work for CXF with XFire all works good
>    public VolumePropertiesDTO getVolume(String name);
>    public VolumePropertiesDTO getVolume(String name, int size);
> }
>
> Implementation VolumeImpl.java
> -------------------------------
> package demowar.server;
>
> import java.util.Properties;
> import demowar.dto.*;
>
> public class DemoImpl implements IDemo {
>    public Properties getDemoProperties() {
>        Properties p = new Properties();
>        p.setProperty("key-1", "value-1");
>        p.setProperty("key-2", "value-2");
>        return p;
>    }
>
>    public BaseObjectDTO[] getArrayOfData() {
>        BaseObjectDTO[] arr = new BaseObjectDTO[3];
>        for (int i = 0; i < arr.length; i++) {
>            arr[i] = new VolumePropertiesDTO("Name-" + i, i);
>        }
>        return arr;
>    }
>
>    public VolumePropertiesDTO getVolume(String name) {
>        return new VolumePropertiesDTO(name, 0);
>    }
>
>    public VolumePropertiesDTO getVolume(String name, int size) {
>        return new VolumePropertiesDTO(name, size);
>    }
> }
>
> --------------
> WSDL - Demo.wsdl
> --------------
>
> <?xml version="1.0" encoding="UTF-8" ?>
> <wsdl:definitions targetNamespace="http://xfire.codehaus.org/Demo"
> xmlns:tns="http://xfire.codehaus.org/Demo" xmlns:wsdlsoap="
> http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="
> http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://dto.demowar"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenc11="
> http://schemas.xmlsoap.org/soap/encoding/" xmlns:soapenc12="
> http://www.w3.org/2003/05/soap-encoding" xmlns:soap11="
> http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsdl="
> http://schemas.xmlsoap.org/wsdl/">
> <wsdl:types>
> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> attributeFormDefault="qualified" elementFormDefault="qualified"
> targetNamespace="http://xfire.codehaus.org/Demo">
> <xsd:element name="getVolume1">
> <xsd:complexType>
> <xsd:sequence>
>  <xsd:element maxOccurs="1" minOccurs="1" name="in0" nillable="true"
> type="xsd:string" />
>  <xsd:element maxOccurs="1" minOccurs="1" name="in1" type="xsd:int" />
>  </xsd:sequence>
>  </xsd:complexType>
>  </xsd:element>
> <xsd:element name="getVolume1Response">
> <xsd:complexType>
> <xsd:sequence>
>  <xsd:element maxOccurs="1" minOccurs="1" name="out" nillable="true"
> type="ns1:VolumePropertiesDTO" />
>  </xsd:sequence>
>  </xsd:complexType>
>  </xsd:element>
> <xsd:element name="getArrayOfData">
>  <xsd:complexType />
>  </xsd:element>
> <xsd:element name="getArrayOfDataResponse">
> <xsd:complexType>
> <xsd:sequence>
>  <xsd:element maxOccurs="1" minOccurs="1" name="out" nillable="true"
> type="ns1:ArrayOfBaseObjectDTO" />
>  </xsd:sequence>
>  </xsd:complexType>
>  </xsd:element>
> <xsd:element name="getVolume">
> <xsd:complexType>
> <xsd:sequence>
>  <xsd:element maxOccurs="1" minOccurs="1" name="in0" nillable="true"
> type="xsd:string" />
>  </xsd:sequence>
>  </xsd:complexType>
>  </xsd:element>
> <xsd:element name="getVolumeResponse">
> <xsd:complexType>
> <xsd:sequence>
>  <xsd:element maxOccurs="1" minOccurs="1" name="out" nillable="true"
> type="ns1:VolumePropertiesDTO" />
>  </xsd:sequence>
>  </xsd:complexType>
>  </xsd:element>
> <xsd:element name="getDemoProperties">
>  <xsd:complexType />
>  </xsd:element>
> <xsd:complexType name="anyType2anyTypeMap">
> <xsd:sequence>
> <xsd:element maxOccurs="unbounded" minOccurs="0" name="entry">
> <xsd:complexType>
> <xsd:sequence>
>  <xsd:element maxOccurs="1" minOccurs="0" name="key" type="xsd:anyType" />
>  <xsd:element maxOccurs="1" minOccurs="0" name="value" type="xsd:anyType"
> />
>  </xsd:sequence>
>  </xsd:complexType>
>  </xsd:element>
>  </xsd:sequence>
>  </xsd:complexType>
> <xsd:element name="getDemoPropertiesResponse">
> <xsd:complexType>
> <xsd:sequence>
>  <xsd:element maxOccurs="1" minOccurs="1" name="out" nillable="true"
> type="tns:anyType2anyTypeMap" />
>  </xsd:sequence>
>  </xsd:complexType>
>  </xsd:element>
>  </xsd:schema>
> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> attributeFormDefault="qualified" elementFormDefault="qualified"
> targetNamespace="http://dto.demowar">
> <xsd:complexType name="VolumePropertiesDTO">
> <xsd:complexContent>
> <xsd:extension base="ns1:BaseObjectDTO">
> <xsd:sequence>
>  <xsd:element minOccurs="0" name="size" type="xsd:int" />
>  </xsd:sequence>
>  </xsd:extension>
>  </xsd:complexContent>
>  </xsd:complexType>
> <xsd:complexType name="BaseObjectDTO">
> <xsd:sequence>
>  <xsd:element minOccurs="0" name="name" nillable="true" type="xsd:string"
> />
>  </xsd:sequence>
>  </xsd:complexType>
> <xsd:complexType name="ArrayOfBaseObjectDTO">
> <xsd:sequence>
>  <xsd:element maxOccurs="unbounded" minOccurs="0" name="BaseObjectDTO"
> nillable="true" type="ns1:BaseObjectDTO" />
>  </xsd:sequence>
>  </xsd:complexType>
>  </xsd:schema>
>  </wsdl:types>
> <wsdl:message name="getVolume1Response">
>  <wsdl:part name="parameters" element="tns:getVolume1Response" />
>  </wsdl:message>
> <wsdl:message name="getArrayOfDataResponse">
>  <wsdl:part name="parameters" element="tns:getArrayOfDataResponse" />
>  </wsdl:message>
> <wsdl:message name="getVolume1Request">
>  <wsdl:part name="parameters" element="tns:getVolume1" />
>  </wsdl:message>
> <wsdl:message name="getDemoPropertiesResponse">
>  <wsdl:part name="parameters" element="tns:getDemoPropertiesResponse" />
>  </wsdl:message>
> <wsdl:message name="getVolumeResponse">
>  <wsdl:part name="parameters" element="tns:getVolumeResponse" />
>  </wsdl:message>
> <wsdl:message name="getArrayOfDataRequest">
>  <wsdl:part name="parameters" element="tns:getArrayOfData" />
>  </wsdl:message>
> <wsdl:message name="getDemoPropertiesRequest">
>  <wsdl:part name="parameters" element="tns:getDemoProperties" />
>  </wsdl:message>
> <wsdl:message name="getVolumeRequest">
>  <wsdl:part name="parameters" element="tns:getVolume" />
>  </wsdl:message>
> <wsdl:portType name="Demo">
> <wsdl:operation name="getVolume1">
>  <wsdl:input name="getVolume1Request" message="tns:getVolume1Request" />
>  <wsdl:output name="getVolume1Response" message="tns:getVolume1Response" />
>  </wsdl:operation>
> <wsdl:operation name="getArrayOfData">
>  <wsdl:input name="getArrayOfDataRequest"
> message="tns:getArrayOfDataRequest" />
>  <wsdl:output name="getArrayOfDataResponse"
> message="tns:getArrayOfDataResponse" />
>  </wsdl:operation>
> <wsdl:operation name="getVolume">
>  <wsdl:input name="getVolumeRequest" message="tns:getVolumeRequest" />
>  <wsdl:output name="getVolumeResponse" message="tns:getVolumeResponse" />
>  </wsdl:operation>
> <wsdl:operation name="getDemoProperties">
>  <wsdl:input name="getDemoPropertiesRequest"
> message="tns:getDemoPropertiesRequest" />
>  <wsdl:output name="getDemoPropertiesResponse"
> message="tns:getDemoPropertiesResponse" />
>  </wsdl:operation>
>  </wsdl:portType>
> <wsdl:binding name="DemoHttpBinding" type="tns:Demo">
>  <wsdlsoap:binding style="document" transport="
> http://schemas.xmlsoap.org/soap/http" />
> <wsdl:operation name="getVolume1">
>  <wsdlsoap:operation soapAction="" />
> <wsdl:input name="getVolume1Request">
>  <wsdlsoap:body use="literal" />
>  </wsdl:input>
> <wsdl:output name="getVolume1Response">
>  <wsdlsoap:body use="literal" />
>  </wsdl:output>
>  </wsdl:operation>
> <wsdl:operation name="getArrayOfData">
>  <wsdlsoap:operation soapAction="" />
> <wsdl:input name="getArrayOfDataRequest">
>  <wsdlsoap:body use="literal" />
>  </wsdl:input>
> <wsdl:output name="getArrayOfDataResponse">
>  <wsdlsoap:body use="literal" />
>  </wsdl:output>
>  </wsdl:operation>
> <wsdl:operation name="getVolume">
>  <wsdlsoap:operation soapAction="" />
> <wsdl:input name="getVolumeRequest">
>  <wsdlsoap:body use="literal" />
>  </wsdl:input>
> <wsdl:output name="getVolumeResponse">
>  <wsdlsoap:body use="literal" />
>  </wsdl:output>
>  </wsdl:operation>
> <wsdl:operation name="getDemoProperties">
>  <wsdlsoap:operation soapAction="" />
> <wsdl:input name="getDemoPropertiesRequest">
>  <wsdlsoap:body use="literal" />
>  </wsdl:input>
> <wsdl:output name="getDemoPropertiesResponse">
>  <wsdlsoap:body use="literal" />
>  </wsdl:output>
>  </wsdl:operation>
>  </wsdl:binding>
> <wsdl:service name="Demo">
> <wsdl:port name="DemoHttpPort" binding="tns:DemoHttpBinding">
>  <wsdlsoap:address location="http://localhost:8080/demo/services/Demo" />
>  </wsdl:port>
>  </wsdl:service>
>  </wsdl:definitions>
>
>
> ----------------------------------------
> Configuration - services.xml
> ----------------------------------------
>
> <beans xmlns="http://xfire.codehaus.org/config/1.0">
>  <service>
>    <name>Demo</name>
>    <serviceClass>demowar.server.IDemo</serviceClass>
>    <implementationClass>demowar.server.DemoImpl</implementationClass>
>    <serviceFactory>jsr181</serviceFactory>
>    <properties>
>      <property key="writeXsiType">true</property>
>      <property key="overrideTypesList">
>        <list xmlns="">
>          <value>demowar.dto.VolumePropertiesDTO</value>
>        </list>
>      </property>
>    </properties>
>  </service>
> </beans>
>
> Thanks,
> Luba A.
>
> -----Original Message-----
> From: Benson Margulies [mailto:bimargulies@gmail.com]
> Sent: Wednesday, November 11, 2009 23:24 PM
> To: users@cxf.apache.org
> Subject: Re: How to configure CXF client consume wsdl with overloaded
> methods?
>
> Dan,
>
> So, we have the following situation?
>
> XFire let the OP create a non-WSI-BP service, and purports to generate a
> WSDL for it. If the version of Aegis was the same on both ends, it would
> work. If the particular API does not happen to run into one of the areas
> where Aegis has changed what goes on the wire (and there are a lot more
> changes to how it writes the schema than how it writes the data) it might
> work, but if it doesn't work, it's going to be pretty challenging to make
> it
> work.
>
> --benson
>
>
> On Wed, Nov 11, 2009 at 3:37 PM, Daniel Kulp <dk...@apache.org> wrote:
>
> >
> > Two notes:
> >
> > 1)  Without the wsdl and the IVolume interface you are using, it might be
> > hard
> > to diagnose.   You may need to put them someplace public or log a JIRA or
> > similar.   The mailing list usually strips attachments.
> >
> > 2) Operation overloading in wsdl is not supported.    It's specifically
> > forbidden in the WSI-BP.     That said, on the interface, if the proper
> > annotations are there, it MAY work.
> >
> > Dan
> >
> >
> > On Wed November 11 2009 7:02:27 am Alpin, Luba wrote:
> > > I need a help to configure my CXF client to use XFire SOAP service with
> > >  overloaded methods.
> > >
> > >
> > >
> > > IVolume interface has two method 'getVolumes' with different signature
> > >
> > >
> > >
> > > Wsdl has one 'getVolumes' and second 'getVolumes1'
> > >
> > >
> > >
> > > This is the dump of error:
> > >
> > >
> > >
> > > INFO: Creating Service {http://xfire.codehaus.org/IVolume}IVolume from
> > >  WSDL: http://localhost:8080/public/services/IVolume?wsdl
> > >
> > > Nov 11, 2009 1:46:48 PM
> > >  org.apache.cxf.service.factory.ReflectionServiceFactoryBean
> > >  initializeWSDLOperations
> > >
> > > WARNING: Could not find a matching method for operation
> > >  {http://xfire.codehaus.org/IVolume}getVolumes1. Operation will be
> > >  unavailable.
> > >
> > > java.lang.NullPointerException
> > >
> > >       at
> > >
> >
>  org.apache.cxf.aegis.databinding.AegisDatabinding.getParameterType(AegisDa
> > > tabinding.java:581)
> > >
> > >       at
> > >
> >
>  org.apache.cxf.aegis.databinding.AegisDatabinding.initializeMessage(AegisD
> > > atabinding.java:342)
> > >
> > >       at
> > >
> >
>  org.apache.cxf.aegis.databinding.AegisDatabinding.initializeOperation(Aegi
> > > sDatabinding.java:303)
> > >
> > >       at
> > >
> >
>  org.apache.cxf.aegis.databinding.AegisDatabinding.initialize(AegisDatabind
> > > ing.java:267)
> > >
> > >       at
> > >
> >
>  org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFr
> > > omWSDL(ReflectionServiceFactoryBean.java:363)
> > >
> > >       at
> > >
> >
>  org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServ
> > > iceModel(ReflectionServiceFactoryBean.java:459)
> > >
> > >       at
> > >
> >
>  org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(Reflect
> > > ionServiceFactoryBean.java:212)
> > >
> > >       at
> > >
> >
>  org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFa
> > > ctoryBean.java:163)
> > >
> > >       at
> > >
> >
>  org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(Ab
> > > stractWSDLBasedEndpointFactory.java:100)
> > >
> > >       at
> > >
> >
>  org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:52
> > > )
> > >
> > >       at
> > >
> >
>  org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBe
> > > an.java:102)
> > >
> > >       at
> > >
> >
>  org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.ja
> > > va:115)
> > >
> > >       at
> > >
>  com.lsi.xfireConnector.CXFUtil.typedServiceProxyCreator(CXFUtil.java:67)
> > >
> > >
> > >
> > > This is my client:
> > >
> > >
> > >
> > >       JaxWsProxyFactoryBean client = new JaxWsProxyFactoryBean();
> > >
> > >       client.setServiceClass(clazz);
> > >
> > >       client.setAddress(url);
> > >
> > >       client.setWsdlURL(url + "?wsdl");
> > >
> > >       AegisDatabinding db = new AegisDatabinding();
> > >
> > >       AegisContext context = new AegisContext();
> > >
> > >       context.setWriteXsiTypes(false);
> > >
> > >       context.setReadXsiTypes(true);
> > >
> > >       db.setAegisContext(context);
> > >
> > >       client.setDataBinding(db);
> > >
> > >       IVolume object = (IVolume) client.create();
> > >
> > >
> > >
> > > Thanks,
> > >
> > > Luba A.
> > >
> >
> > --
> > Daniel Kulp
> > dkulp@apache.org
> > http://www.dankulp.com/blog
> >
>

RE: How to configure CXF client consume wsdl with overloaded methods?

Posted by "Alpin, Luba" <Lu...@lsi.com>.
My demo is really small program to demonstrate problematic area from real code, so I paste it right to this email.
----------------------------------------------------------------------------
Interface of service IVolume.java
------------------------------------

package demowar.server;

import java.util.*;

import javax.jws.WebService;
import demowar.dto.*;

@WebService(name = "Demo", targetNamespace = "http://xfire.codehaus.org/Demo")public interface
        IDemo {

    //works OK
    public Properties getDemoProperties();
    //works OK
    public BaseObjectDTO[] getArrayOfData();

    // overloading doesn't work for CXF with XFire all works good
    public VolumePropertiesDTO getVolume(String name); 
    public VolumePropertiesDTO getVolume(String name, int size);
}

Implementation VolumeImpl.java
-------------------------------
package demowar.server;

import java.util.Properties;
import demowar.dto.*;

public class DemoImpl implements IDemo {
    public Properties getDemoProperties() {
        Properties p = new Properties();
        p.setProperty("key-1", "value-1");
        p.setProperty("key-2", "value-2");
        return p;
    }

    public BaseObjectDTO[] getArrayOfData() {
        BaseObjectDTO[] arr = new BaseObjectDTO[3];
        for (int i = 0; i < arr.length; i++) {
            arr[i] = new VolumePropertiesDTO("Name-" + i, i);
        }
        return arr;
    }

    public VolumePropertiesDTO getVolume(String name) {
        return new VolumePropertiesDTO(name, 0);
    }

    public VolumePropertiesDTO getVolume(String name, int size) {
        return new VolumePropertiesDTO(name, size);
    }
}

--------------
WSDL - Demo.wsdl
--------------

<?xml version="1.0" encoding="UTF-8" ?> 
<wsdl:definitions targetNamespace="http://xfire.codehaus.org/Demo" xmlns:tns="http://xfire.codehaus.org/Demo" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://dto.demowar" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenc11="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soapenc12="http://www.w3.org/2003/05/soap-encoding" xmlns:soap11="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:types>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://xfire.codehaus.org/Demo">
<xsd:element name="getVolume1">
<xsd:complexType>
<xsd:sequence>
  <xsd:element maxOccurs="1" minOccurs="1" name="in0" nillable="true" type="xsd:string" /> 
  <xsd:element maxOccurs="1" minOccurs="1" name="in1" type="xsd:int" /> 
  </xsd:sequence>
  </xsd:complexType>
  </xsd:element>
<xsd:element name="getVolume1Response">
<xsd:complexType>
<xsd:sequence>
  <xsd:element maxOccurs="1" minOccurs="1" name="out" nillable="true" type="ns1:VolumePropertiesDTO" /> 
  </xsd:sequence>
  </xsd:complexType>
  </xsd:element>
<xsd:element name="getArrayOfData">
  <xsd:complexType /> 
  </xsd:element>
<xsd:element name="getArrayOfDataResponse">
<xsd:complexType>
<xsd:sequence>
  <xsd:element maxOccurs="1" minOccurs="1" name="out" nillable="true" type="ns1:ArrayOfBaseObjectDTO" /> 
  </xsd:sequence>
  </xsd:complexType>
  </xsd:element>
<xsd:element name="getVolume">
<xsd:complexType>
<xsd:sequence>
  <xsd:element maxOccurs="1" minOccurs="1" name="in0" nillable="true" type="xsd:string" /> 
  </xsd:sequence>
  </xsd:complexType>
  </xsd:element>
<xsd:element name="getVolumeResponse">
<xsd:complexType>
<xsd:sequence>
  <xsd:element maxOccurs="1" minOccurs="1" name="out" nillable="true" type="ns1:VolumePropertiesDTO" /> 
  </xsd:sequence>
  </xsd:complexType>
  </xsd:element>
<xsd:element name="getDemoProperties">
  <xsd:complexType /> 
  </xsd:element>
<xsd:complexType name="anyType2anyTypeMap">
<xsd:sequence>
<xsd:element maxOccurs="unbounded" minOccurs="0" name="entry">
<xsd:complexType>
<xsd:sequence>
  <xsd:element maxOccurs="1" minOccurs="0" name="key" type="xsd:anyType" /> 
  <xsd:element maxOccurs="1" minOccurs="0" name="value" type="xsd:anyType" /> 
  </xsd:sequence>
  </xsd:complexType>
  </xsd:element>
  </xsd:sequence>
  </xsd:complexType>
<xsd:element name="getDemoPropertiesResponse">
<xsd:complexType>
<xsd:sequence>
  <xsd:element maxOccurs="1" minOccurs="1" name="out" nillable="true" type="tns:anyType2anyTypeMap" /> 
  </xsd:sequence>
  </xsd:complexType>
  </xsd:element>
  </xsd:schema>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://dto.demowar">
<xsd:complexType name="VolumePropertiesDTO">
<xsd:complexContent>
<xsd:extension base="ns1:BaseObjectDTO">
<xsd:sequence>
  <xsd:element minOccurs="0" name="size" type="xsd:int" /> 
  </xsd:sequence>
  </xsd:extension>
  </xsd:complexContent>
  </xsd:complexType>
<xsd:complexType name="BaseObjectDTO">
<xsd:sequence>
  <xsd:element minOccurs="0" name="name" nillable="true" type="xsd:string" /> 
  </xsd:sequence>
  </xsd:complexType>
<xsd:complexType name="ArrayOfBaseObjectDTO">
<xsd:sequence>
  <xsd:element maxOccurs="unbounded" minOccurs="0" name="BaseObjectDTO" nillable="true" type="ns1:BaseObjectDTO" /> 
  </xsd:sequence>
  </xsd:complexType>
  </xsd:schema>
  </wsdl:types>
<wsdl:message name="getVolume1Response">
  <wsdl:part name="parameters" element="tns:getVolume1Response" /> 
  </wsdl:message>
<wsdl:message name="getArrayOfDataResponse">
  <wsdl:part name="parameters" element="tns:getArrayOfDataResponse" /> 
  </wsdl:message>
<wsdl:message name="getVolume1Request">
  <wsdl:part name="parameters" element="tns:getVolume1" /> 
  </wsdl:message>
<wsdl:message name="getDemoPropertiesResponse">
  <wsdl:part name="parameters" element="tns:getDemoPropertiesResponse" /> 
  </wsdl:message>
<wsdl:message name="getVolumeResponse">
  <wsdl:part name="parameters" element="tns:getVolumeResponse" /> 
  </wsdl:message>
<wsdl:message name="getArrayOfDataRequest">
  <wsdl:part name="parameters" element="tns:getArrayOfData" /> 
  </wsdl:message>
<wsdl:message name="getDemoPropertiesRequest">
  <wsdl:part name="parameters" element="tns:getDemoProperties" /> 
  </wsdl:message>
<wsdl:message name="getVolumeRequest">
  <wsdl:part name="parameters" element="tns:getVolume" /> 
  </wsdl:message>
<wsdl:portType name="Demo">
<wsdl:operation name="getVolume1">
  <wsdl:input name="getVolume1Request" message="tns:getVolume1Request" /> 
  <wsdl:output name="getVolume1Response" message="tns:getVolume1Response" /> 
  </wsdl:operation>
<wsdl:operation name="getArrayOfData">
  <wsdl:input name="getArrayOfDataRequest" message="tns:getArrayOfDataRequest" /> 
  <wsdl:output name="getArrayOfDataResponse" message="tns:getArrayOfDataResponse" /> 
  </wsdl:operation>
<wsdl:operation name="getVolume">
  <wsdl:input name="getVolumeRequest" message="tns:getVolumeRequest" /> 
  <wsdl:output name="getVolumeResponse" message="tns:getVolumeResponse" /> 
  </wsdl:operation>
<wsdl:operation name="getDemoProperties">
  <wsdl:input name="getDemoPropertiesRequest" message="tns:getDemoPropertiesRequest" /> 
  <wsdl:output name="getDemoPropertiesResponse" message="tns:getDemoPropertiesResponse" /> 
  </wsdl:operation>
  </wsdl:portType>
<wsdl:binding name="DemoHttpBinding" type="tns:Demo">
  <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" /> 
<wsdl:operation name="getVolume1">
  <wsdlsoap:operation soapAction="" /> 
<wsdl:input name="getVolume1Request">
  <wsdlsoap:body use="literal" /> 
  </wsdl:input>
<wsdl:output name="getVolume1Response">
  <wsdlsoap:body use="literal" /> 
  </wsdl:output>
  </wsdl:operation>
<wsdl:operation name="getArrayOfData">
  <wsdlsoap:operation soapAction="" /> 
<wsdl:input name="getArrayOfDataRequest">
  <wsdlsoap:body use="literal" /> 
  </wsdl:input>
<wsdl:output name="getArrayOfDataResponse">
  <wsdlsoap:body use="literal" /> 
  </wsdl:output>
  </wsdl:operation>
<wsdl:operation name="getVolume">
  <wsdlsoap:operation soapAction="" /> 
<wsdl:input name="getVolumeRequest">
  <wsdlsoap:body use="literal" /> 
  </wsdl:input>
<wsdl:output name="getVolumeResponse">
  <wsdlsoap:body use="literal" /> 
  </wsdl:output>
  </wsdl:operation>
<wsdl:operation name="getDemoProperties">
  <wsdlsoap:operation soapAction="" /> 
<wsdl:input name="getDemoPropertiesRequest">
  <wsdlsoap:body use="literal" /> 
  </wsdl:input>
<wsdl:output name="getDemoPropertiesResponse">
  <wsdlsoap:body use="literal" /> 
  </wsdl:output>
  </wsdl:operation>
  </wsdl:binding>
<wsdl:service name="Demo">
<wsdl:port name="DemoHttpPort" binding="tns:DemoHttpBinding">
  <wsdlsoap:address location="http://localhost:8080/demo/services/Demo" /> 
  </wsdl:port>
  </wsdl:service>
  </wsdl:definitions>


----------------------------------------
Configuration - services.xml
----------------------------------------

<beans xmlns="http://xfire.codehaus.org/config/1.0">
  <service>
    <name>Demo</name>
    <serviceClass>demowar.server.IDemo</serviceClass>
    <implementationClass>demowar.server.DemoImpl</implementationClass>
    <serviceFactory>jsr181</serviceFactory>
    <properties>
      <property key="writeXsiType">true</property>
      <property key="overrideTypesList">
        <list xmlns="">
          <value>demowar.dto.VolumePropertiesDTO</value>
        </list>
      </property>
    </properties>
  </service>
</beans>

Thanks,
Luba A.

-----Original Message-----
From: Benson Margulies [mailto:bimargulies@gmail.com] 
Sent: Wednesday, November 11, 2009 23:24 PM
To: users@cxf.apache.org
Subject: Re: How to configure CXF client consume wsdl with overloaded methods?

Dan,

So, we have the following situation?

XFire let the OP create a non-WSI-BP service, and purports to generate a
WSDL for it. If the version of Aegis was the same on both ends, it would
work. If the particular API does not happen to run into one of the areas
where Aegis has changed what goes on the wire (and there are a lot more
changes to how it writes the schema than how it writes the data) it might
work, but if it doesn't work, it's going to be pretty challenging to make it
work.

--benson


On Wed, Nov 11, 2009 at 3:37 PM, Daniel Kulp <dk...@apache.org> wrote:

>
> Two notes:
>
> 1)  Without the wsdl and the IVolume interface you are using, it might be
> hard
> to diagnose.   You may need to put them someplace public or log a JIRA or
> similar.   The mailing list usually strips attachments.
>
> 2) Operation overloading in wsdl is not supported.    It's specifically
> forbidden in the WSI-BP.     That said, on the interface, if the proper
> annotations are there, it MAY work.
>
> Dan
>
>
> On Wed November 11 2009 7:02:27 am Alpin, Luba wrote:
> > I need a help to configure my CXF client to use XFire SOAP service with
> >  overloaded methods.
> >
> >
> >
> > IVolume interface has two method 'getVolumes' with different signature
> >
> >
> >
> > Wsdl has one 'getVolumes' and second 'getVolumes1'
> >
> >
> >
> > This is the dump of error:
> >
> >
> >
> > INFO: Creating Service {http://xfire.codehaus.org/IVolume}IVolume from
> >  WSDL: http://localhost:8080/public/services/IVolume?wsdl
> >
> > Nov 11, 2009 1:46:48 PM
> >  org.apache.cxf.service.factory.ReflectionServiceFactoryBean
> >  initializeWSDLOperations
> >
> > WARNING: Could not find a matching method for operation
> >  {http://xfire.codehaus.org/IVolume}getVolumes1. Operation will be
> >  unavailable.
> >
> > java.lang.NullPointerException
> >
> >       at
> >
>  org.apache.cxf.aegis.databinding.AegisDatabinding.getParameterType(AegisDa
> > tabinding.java:581)
> >
> >       at
> >
>  org.apache.cxf.aegis.databinding.AegisDatabinding.initializeMessage(AegisD
> > atabinding.java:342)
> >
> >       at
> >
>  org.apache.cxf.aegis.databinding.AegisDatabinding.initializeOperation(Aegi
> > sDatabinding.java:303)
> >
> >       at
> >
>  org.apache.cxf.aegis.databinding.AegisDatabinding.initialize(AegisDatabind
> > ing.java:267)
> >
> >       at
> >
>  org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFr
> > omWSDL(ReflectionServiceFactoryBean.java:363)
> >
> >       at
> >
>  org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServ
> > iceModel(ReflectionServiceFactoryBean.java:459)
> >
> >       at
> >
>  org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(Reflect
> > ionServiceFactoryBean.java:212)
> >
> >       at
> >
>  org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFa
> > ctoryBean.java:163)
> >
> >       at
> >
>  org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(Ab
> > stractWSDLBasedEndpointFactory.java:100)
> >
> >       at
> >
>  org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:52
> > )
> >
> >       at
> >
>  org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBe
> > an.java:102)
> >
> >       at
> >
>  org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.ja
> > va:115)
> >
> >       at
> >  com.lsi.xfireConnector.CXFUtil.typedServiceProxyCreator(CXFUtil.java:67)
> >
> >
> >
> > This is my client:
> >
> >
> >
> >       JaxWsProxyFactoryBean client = new JaxWsProxyFactoryBean();
> >
> >       client.setServiceClass(clazz);
> >
> >       client.setAddress(url);
> >
> >       client.setWsdlURL(url + "?wsdl");
> >
> >       AegisDatabinding db = new AegisDatabinding();
> >
> >       AegisContext context = new AegisContext();
> >
> >       context.setWriteXsiTypes(false);
> >
> >       context.setReadXsiTypes(true);
> >
> >       db.setAegisContext(context);
> >
> >       client.setDataBinding(db);
> >
> >       IVolume object = (IVolume) client.create();
> >
> >
> >
> > Thanks,
> >
> > Luba A.
> >
>
> --
> Daniel Kulp
> dkulp@apache.org
> http://www.dankulp.com/blog
>

Re: How to configure CXF client consume wsdl with overloaded methods?

Posted by Benson Margulies <bi...@gmail.com>.
Dan,

So, we have the following situation?

XFire let the OP create a non-WSI-BP service, and purports to generate a
WSDL for it. If the version of Aegis was the same on both ends, it would
work. If the particular API does not happen to run into one of the areas
where Aegis has changed what goes on the wire (and there are a lot more
changes to how it writes the schema than how it writes the data) it might
work, but if it doesn't work, it's going to be pretty challenging to make it
work.

--benson


On Wed, Nov 11, 2009 at 3:37 PM, Daniel Kulp <dk...@apache.org> wrote:

>
> Two notes:
>
> 1)  Without the wsdl and the IVolume interface you are using, it might be
> hard
> to diagnose.   You may need to put them someplace public or log a JIRA or
> similar.   The mailing list usually strips attachments.
>
> 2) Operation overloading in wsdl is not supported.    It's specifically
> forbidden in the WSI-BP.     That said, on the interface, if the proper
> annotations are there, it MAY work.
>
> Dan
>
>
> On Wed November 11 2009 7:02:27 am Alpin, Luba wrote:
> > I need a help to configure my CXF client to use XFire SOAP service with
> >  overloaded methods.
> >
> >
> >
> > IVolume interface has two method 'getVolumes' with different signature
> >
> >
> >
> > Wsdl has one 'getVolumes' and second 'getVolumes1'
> >
> >
> >
> > This is the dump of error:
> >
> >
> >
> > INFO: Creating Service {http://xfire.codehaus.org/IVolume}IVolume from
> >  WSDL: http://localhost:8080/public/services/IVolume?wsdl
> >
> > Nov 11, 2009 1:46:48 PM
> >  org.apache.cxf.service.factory.ReflectionServiceFactoryBean
> >  initializeWSDLOperations
> >
> > WARNING: Could not find a matching method for operation
> >  {http://xfire.codehaus.org/IVolume}getVolumes1. Operation will be
> >  unavailable.
> >
> > java.lang.NullPointerException
> >
> >       at
> >
>  org.apache.cxf.aegis.databinding.AegisDatabinding.getParameterType(AegisDa
> > tabinding.java:581)
> >
> >       at
> >
>  org.apache.cxf.aegis.databinding.AegisDatabinding.initializeMessage(AegisD
> > atabinding.java:342)
> >
> >       at
> >
>  org.apache.cxf.aegis.databinding.AegisDatabinding.initializeOperation(Aegi
> > sDatabinding.java:303)
> >
> >       at
> >
>  org.apache.cxf.aegis.databinding.AegisDatabinding.initialize(AegisDatabind
> > ing.java:267)
> >
> >       at
> >
>  org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFr
> > omWSDL(ReflectionServiceFactoryBean.java:363)
> >
> >       at
> >
>  org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServ
> > iceModel(ReflectionServiceFactoryBean.java:459)
> >
> >       at
> >
>  org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(Reflect
> > ionServiceFactoryBean.java:212)
> >
> >       at
> >
>  org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFa
> > ctoryBean.java:163)
> >
> >       at
> >
>  org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(Ab
> > stractWSDLBasedEndpointFactory.java:100)
> >
> >       at
> >
>  org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:52
> > )
> >
> >       at
> >
>  org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBe
> > an.java:102)
> >
> >       at
> >
>  org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.ja
> > va:115)
> >
> >       at
> >  com.lsi.xfireConnector.CXFUtil.typedServiceProxyCreator(CXFUtil.java:67)
> >
> >
> >
> > This is my client:
> >
> >
> >
> >       JaxWsProxyFactoryBean client = new JaxWsProxyFactoryBean();
> >
> >       client.setServiceClass(clazz);
> >
> >       client.setAddress(url);
> >
> >       client.setWsdlURL(url + "?wsdl");
> >
> >       AegisDatabinding db = new AegisDatabinding();
> >
> >       AegisContext context = new AegisContext();
> >
> >       context.setWriteXsiTypes(false);
> >
> >       context.setReadXsiTypes(true);
> >
> >       db.setAegisContext(context);
> >
> >       client.setDataBinding(db);
> >
> >       IVolume object = (IVolume) client.create();
> >
> >
> >
> > Thanks,
> >
> > Luba A.
> >
>
> --
> Daniel Kulp
> dkulp@apache.org
> http://www.dankulp.com/blog
>

Re: How to configure CXF client consume wsdl with overloaded methods?

Posted by Daniel Kulp <dk...@apache.org>.
Two notes:

1)  Without the wsdl and the IVolume interface you are using, it might be hard 
to diagnose.   You may need to put them someplace public or log a JIRA or 
similar.   The mailing list usually strips attachments.

2) Operation overloading in wsdl is not supported.    It's specifically 
forbidden in the WSI-BP.     That said, on the interface, if the proper 
annotations are there, it MAY work.  

Dan


On Wed November 11 2009 7:02:27 am Alpin, Luba wrote:
> I need a help to configure my CXF client to use XFire SOAP service with
>  overloaded methods.
> 
> 
> 
> IVolume interface has two method 'getVolumes' with different signature
> 
> 
> 
> Wsdl has one 'getVolumes' and second 'getVolumes1'
> 
> 
> 
> This is the dump of error:
> 
> 
> 
> INFO: Creating Service {http://xfire.codehaus.org/IVolume}IVolume from
>  WSDL: http://localhost:8080/public/services/IVolume?wsdl
> 
> Nov 11, 2009 1:46:48 PM
>  org.apache.cxf.service.factory.ReflectionServiceFactoryBean
>  initializeWSDLOperations
> 
> WARNING: Could not find a matching method for operation
>  {http://xfire.codehaus.org/IVolume}getVolumes1. Operation will be
>  unavailable.
> 
> java.lang.NullPointerException
> 
>       at
>  org.apache.cxf.aegis.databinding.AegisDatabinding.getParameterType(AegisDa
> tabinding.java:581)
> 
>       at
>  org.apache.cxf.aegis.databinding.AegisDatabinding.initializeMessage(AegisD
> atabinding.java:342)
> 
>       at
>  org.apache.cxf.aegis.databinding.AegisDatabinding.initializeOperation(Aegi
> sDatabinding.java:303)
> 
>       at
>  org.apache.cxf.aegis.databinding.AegisDatabinding.initialize(AegisDatabind
> ing.java:267)
> 
>       at
>  org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFr
> omWSDL(ReflectionServiceFactoryBean.java:363)
> 
>       at
>  org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServ
> iceModel(ReflectionServiceFactoryBean.java:459)
> 
>       at
>  org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(Reflect
> ionServiceFactoryBean.java:212)
> 
>       at
>  org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFa
> ctoryBean.java:163)
> 
>       at
>  org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(Ab
> stractWSDLBasedEndpointFactory.java:100)
> 
>       at
>  org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:52
> )
> 
>       at
>  org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBe
> an.java:102)
> 
>       at
>  org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.ja
> va:115)
> 
>       at
>  com.lsi.xfireConnector.CXFUtil.typedServiceProxyCreator(CXFUtil.java:67)
> 
> 
> 
> This is my client:
> 
> 
> 
>       JaxWsProxyFactoryBean client = new JaxWsProxyFactoryBean();
> 
>       client.setServiceClass(clazz);
> 
>       client.setAddress(url);
> 
>       client.setWsdlURL(url + "?wsdl");
> 
>       AegisDatabinding db = new AegisDatabinding();
> 
>       AegisContext context = new AegisContext();
> 
>       context.setWriteXsiTypes(false);
> 
>       context.setReadXsiTypes(true);
> 
>       db.setAegisContext(context);
> 
>       client.setDataBinding(db);
> 
>       IVolume object = (IVolume) client.create();
> 
> 
> 
> Thanks,
> 
> Luba A.
> 

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

Re: How to configure CXF client consume wsdl with overloaded methods?

Posted by Benson Margulies <bi...@gmail.com>.
I should warn you that is is quite likely that a CXF Aegis client will
be UNABLE to talk to an XFire server. Aegis is/was not tightly
specified. If you want to talk to an XFire server with a CXF client, I
recommend that you use wsdl2java to generate a JAX-WS+JAXB client.

On Wed, Nov 11, 2009 at 11:53 AM, Alpin, Luba <Lu...@lsi.com> wrote:
>
> Attached are:
>
> 1. The http://localhost:8080/demo/services/Demo?wsdl file (created by XFire).
>
> 2. The 'src.rar' - my service implementation.
>
> 3. 'WEB-INF.rar' - my service configuration. I load service with Tomcat or Jetty.
>
> And this is my XFire Client test method that works good.
>
> public void XFireClientTest() {
>        AnnotationServiceFactory asFactory = new AnnotationServiceFactory();
>        XFire xfire = XFireFactory.newInstance().getXFire();
>        XFireProxyFactory proxyFactory = new XFireProxyFactory(xfire);
>        HashMap<String, Object> map = new HashMap<String, Object>();
>        map.put(AegisBindingProvider.READ_XSI_TYPE_KEY, Boolean.TRUE);
>        ArrayList<String> l = new ArrayList<String>();
>        l.add(demowar.dto.VolumePropertiesDTO.class.getName());
>        map.put(AegisBindingProvider.OVERRIDE_TYPES_KEY, l);
>        try {
>            demowar.server.IDemo demo = (demowar.server.IDemo) proxyFactory.create(asFactory.create(demowar.server.IDemo.class, map),
>                    "http://135.24.169.23:8080/demo/services/Demo");
>            demowar.dto.VolumePropertiesDTO v = demo.getVolume("v-1");
>            System.out.println(v.getName());
>            demowar.dto.VolumePropertiesDTO v1 = demo.getVolume("v-1", 123);
>            System.out.println(v1.getName() + "," + v1.getSize());
>        } catch (MalformedURLException ex) {
>            ex.printStackTrace();
>        }
>    }
>
>
>
> Sorry, I don't familiar with JIRA.
>
> Thanks,
> Luba A.
>
>
>
>
> -----Original Message-----
> From: Benson Margulies [mailto:bimargulies@gmail.com]
> Sent: Wednesday, November 11, 2009 15:34 PM
> To: users@cxf.apache.org
> Subject: Re: How to configure CXF client consume wsdl with overloaded methods?
>
> Post a JIRA and attach the wsdl and we'll try to help.
>
>
> On Wed, Nov 11, 2009 at 7:02 AM, Alpin, Luba <Lu...@lsi.com> wrote:
>
> > I need a help to configure my CXF client to use XFire SOAP service with
> > overloaded methods.
> >
> >
> >
> > IVolume interface has two method 'getVolumes' with different signature
> >
> >
> >
> > Wsdl has one 'getVolumes' and second 'getVolumes1'
> >
> >
> >
> > This is the dump of error:
> >
> >
> >
> > INFO: Creating Service {http://xfire.codehaus.org/IVolume}IVolume from
> > WSDL: http://localhost:8080/public/services/IVolume?wsdl
> >
> > Nov 11, 2009 1:46:48 PM
> > org.apache.cxf.service.factory.ReflectionServiceFactoryBean
> > initializeWSDLOperations
> >
> > WARNING: Could not find a matching method for operation {
> > http://xfire.codehaus.org/IVolume}getVolumes1. Operation will be
> > unavailable.
> >
> > java.lang.NullPointerException
> >
> >      at
> > org.apache.cxf.aegis.databinding.AegisDatabinding.getParameterType(AegisDatabinding.java:581)
> >
> >      at
> > org.apache.cxf.aegis.databinding.AegisDatabinding.initializeMessage(AegisDatabinding.java:342)
> >
> >      at
> > org.apache.cxf.aegis.databinding.AegisDatabinding.initializeOperation(AegisDatabinding.java:303)
> >
> >      at
> > org.apache.cxf.aegis.databinding.AegisDatabinding.initialize(AegisDatabinding.java:267)
> >
> >      at
> > org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(ReflectionServiceFactoryBean.java:363)
> >
> >      at
> > org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:459)
> >
> >      at
> > org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:212)
> >
> >      at
> > org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:163)
> >
> >      at
> > org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:100)
> >
> >      at
> > org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:52)
> >
> >      at
> > org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:102)
> >
> >      at
> > org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.java:115)
> >
> >      at
> > com.lsi.xfireConnector.CXFUtil.typedServiceProxyCreator(CXFUtil.java:67)
> >
> >
> >
> > This is my client:
> >
> >
> >
> >      JaxWsProxyFactoryBean client = new JaxWsProxyFactoryBean();
> >
> >      client.setServiceClass(clazz);
> >
> >      client.setAddress(url);
> >
> >      client.setWsdlURL(url + "?wsdl");
> >
> >      AegisDatabinding db = new AegisDatabinding();
> >
> >      AegisContext context = new AegisContext();
> >
> >      context.setWriteXsiTypes(false);
> >
> >      context.setReadXsiTypes(true);
> >
> >      db.setAegisContext(context);
> >
> >      client.setDataBinding(db);
> >
> >      IVolume object = (IVolume) client.create();
> >
> >
> >
> > Thanks,
> >
> > Luba A.
> >

Re: How to configure CXF client consume wsdl with overloaded methods?

Posted by Benson Margulies <bi...@gmail.com>.
This list strips attachments. To do show-and-tell, you have to open a JIRA
and attach there.


On Wed, Nov 11, 2009 at 11:53 AM, Alpin, Luba <Lu...@lsi.com> wrote:

>
> Attached are:
>
> 1. The http://localhost:8080/demo/services/Demo?wsdl file (created by
> XFire).
>
> 2. The 'src.rar' - my service implementation.
>
> 3. 'WEB-INF.rar' - my service configuration. I load service with Tomcat or
> Jetty.
>
> And this is my XFire Client test method that works good.
>
> public void XFireClientTest() {
>        AnnotationServiceFactory asFactory = new AnnotationServiceFactory();
>        XFire xfire = XFireFactory.newInstance().getXFire();
>        XFireProxyFactory proxyFactory = new XFireProxyFactory(xfire);
>        HashMap<String, Object> map = new HashMap<String, Object>();
>        map.put(AegisBindingProvider.READ_XSI_TYPE_KEY, Boolean.TRUE);
>        ArrayList<String> l = new ArrayList<String>();
>        l.add(demowar.dto.VolumePropertiesDTO.class.getName());
>        map.put(AegisBindingProvider.OVERRIDE_TYPES_KEY, l);
>        try {
>            demowar.server.IDemo demo = (demowar.server.IDemo)
> proxyFactory.create(asFactory.create(demowar.server.IDemo.class, map),
>                    "http://135.24.169.23:8080/demo/services/Demo");
>            demowar.dto.VolumePropertiesDTO v = demo.getVolume("v-1");
>            System.out.println(v.getName());
>            demowar.dto.VolumePropertiesDTO v1 = demo.getVolume("v-1", 123);
>            System.out.println(v1.getName() + "," + v1.getSize());
>        } catch (MalformedURLException ex) {
>            ex.printStackTrace();
>        }
>    }
>
>
>
> Sorry, I don't familiar with JIRA.
>
> Thanks,
> Luba A.
>
>
>
>
> -----Original Message-----
> From: Benson Margulies [mailto:bimargulies@gmail.com]
> Sent: Wednesday, November 11, 2009 15:34 PM
> To: users@cxf.apache.org
> Subject: Re: How to configure CXF client consume wsdl with overloaded
> methods?
>
> Post a JIRA and attach the wsdl and we'll try to help.
>
>
> On Wed, Nov 11, 2009 at 7:02 AM, Alpin, Luba <Lu...@lsi.com> wrote:
>
> > I need a help to configure my CXF client to use XFire SOAP service with
> > overloaded methods.
> >
> >
> >
> > IVolume interface has two method 'getVolumes' with different signature
> >
> >
> >
> > Wsdl has one 'getVolumes' and second 'getVolumes1'
> >
> >
> >
> > This is the dump of error:
> >
> >
> >
> > INFO: Creating Service {http://xfire.codehaus.org/IVolume}IVolume from
> > WSDL: http://localhost:8080/public/services/IVolume?wsdl
> >
> > Nov 11, 2009 1:46:48 PM
> > org.apache.cxf.service.factory.ReflectionServiceFactoryBean
> > initializeWSDLOperations
> >
> > WARNING: Could not find a matching method for operation {
> > http://xfire.codehaus.org/IVolume}getVolumes1. Operation will be
> > unavailable.
> >
> > java.lang.NullPointerException
> >
> >      at
> >
> org.apache.cxf.aegis.databinding.AegisDatabinding.getParameterType(AegisDatabinding.java:581)
> >
> >      at
> >
> org.apache.cxf.aegis.databinding.AegisDatabinding.initializeMessage(AegisDatabinding.java:342)
> >
> >      at
> >
> org.apache.cxf.aegis.databinding.AegisDatabinding.initializeOperation(AegisDatabinding.java:303)
> >
> >      at
> >
> org.apache.cxf.aegis.databinding.AegisDatabinding.initialize(AegisDatabinding.java:267)
> >
> >      at
> >
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(ReflectionServiceFactoryBean.java:363)
> >
> >      at
> >
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:459)
> >
> >      at
> >
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:212)
> >
> >      at
> >
> org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:163)
> >
> >      at
> >
> org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:100)
> >
> >      at
> >
> org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:52)
> >
> >      at
> >
> org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:102)
> >
> >      at
> >
> org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.java:115)
> >
> >      at
> > com.lsi.xfireConnector.CXFUtil.typedServiceProxyCreator(CXFUtil.java:67)
> >
> >
> >
> > This is my client:
> >
> >
> >
> >      JaxWsProxyFactoryBean client = new JaxWsProxyFactoryBean();
> >
> >      client.setServiceClass(clazz);
> >
> >      client.setAddress(url);
> >
> >      client.setWsdlURL(url + "?wsdl");
> >
> >      AegisDatabinding db = new AegisDatabinding();
> >
> >      AegisContext context = new AegisContext();
> >
> >      context.setWriteXsiTypes(false);
> >
> >      context.setReadXsiTypes(true);
> >
> >      db.setAegisContext(context);
> >
> >      client.setDataBinding(db);
> >
> >      IVolume object = (IVolume) client.create();
> >
> >
> >
> > Thanks,
> >
> > Luba A.
> >
>

RE: How to configure CXF client consume wsdl with overloaded methods?

Posted by "Alpin, Luba" <Lu...@lsi.com>.
Attached are:

1. The http://localhost:8080/demo/services/Demo?wsdl file (created by XFire).

2. The 'src.rar' - my service implementation.

3. 'WEB-INF.rar' - my service configuration. I load service with Tomcat or Jetty. 

And this is my XFire Client test method that works good.

public void XFireClientTest() {
        AnnotationServiceFactory asFactory = new AnnotationServiceFactory();
        XFire xfire = XFireFactory.newInstance().getXFire();
        XFireProxyFactory proxyFactory = new XFireProxyFactory(xfire);
        HashMap<String, Object> map = new HashMap<String, Object>();
        map.put(AegisBindingProvider.READ_XSI_TYPE_KEY, Boolean.TRUE);
        ArrayList<String> l = new ArrayList<String>();
        l.add(demowar.dto.VolumePropertiesDTO.class.getName());
        map.put(AegisBindingProvider.OVERRIDE_TYPES_KEY, l);
        try {
            demowar.server.IDemo demo = (demowar.server.IDemo) proxyFactory.create(asFactory.create(demowar.server.IDemo.class, map),
                    "http://135.24.169.23:8080/demo/services/Demo");
            demowar.dto.VolumePropertiesDTO v = demo.getVolume("v-1");
            System.out.println(v.getName());
            demowar.dto.VolumePropertiesDTO v1 = demo.getVolume("v-1", 123);
            System.out.println(v1.getName() + "," + v1.getSize());
        } catch (MalformedURLException ex) {
            ex.printStackTrace();
        }
    }



Sorry, I don't familiar with JIRA.

Thanks,
Luba A.




-----Original Message-----
From: Benson Margulies [mailto:bimargulies@gmail.com] 
Sent: Wednesday, November 11, 2009 15:34 PM
To: users@cxf.apache.org
Subject: Re: How to configure CXF client consume wsdl with overloaded methods?

Post a JIRA and attach the wsdl and we'll try to help.


On Wed, Nov 11, 2009 at 7:02 AM, Alpin, Luba <Lu...@lsi.com> wrote:

> I need a help to configure my CXF client to use XFire SOAP service with
> overloaded methods.
>
>
>
> IVolume interface has two method 'getVolumes' with different signature
>
>
>
> Wsdl has one 'getVolumes' and second 'getVolumes1'
>
>
>
> This is the dump of error:
>
>
>
> INFO: Creating Service {http://xfire.codehaus.org/IVolume}IVolume from
> WSDL: http://localhost:8080/public/services/IVolume?wsdl
>
> Nov 11, 2009 1:46:48 PM
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean
> initializeWSDLOperations
>
> WARNING: Could not find a matching method for operation {
> http://xfire.codehaus.org/IVolume}getVolumes1. Operation will be
> unavailable.
>
> java.lang.NullPointerException
>
>      at
> org.apache.cxf.aegis.databinding.AegisDatabinding.getParameterType(AegisDatabinding.java:581)
>
>      at
> org.apache.cxf.aegis.databinding.AegisDatabinding.initializeMessage(AegisDatabinding.java:342)
>
>      at
> org.apache.cxf.aegis.databinding.AegisDatabinding.initializeOperation(AegisDatabinding.java:303)
>
>      at
> org.apache.cxf.aegis.databinding.AegisDatabinding.initialize(AegisDatabinding.java:267)
>
>      at
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(ReflectionServiceFactoryBean.java:363)
>
>      at
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:459)
>
>      at
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:212)
>
>      at
> org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:163)
>
>      at
> org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:100)
>
>      at
> org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:52)
>
>      at
> org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:102)
>
>      at
> org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.java:115)
>
>      at
> com.lsi.xfireConnector.CXFUtil.typedServiceProxyCreator(CXFUtil.java:67)
>
>
>
> This is my client:
>
>
>
>      JaxWsProxyFactoryBean client = new JaxWsProxyFactoryBean();
>
>      client.setServiceClass(clazz);
>
>      client.setAddress(url);
>
>      client.setWsdlURL(url + "?wsdl");
>
>      AegisDatabinding db = new AegisDatabinding();
>
>      AegisContext context = new AegisContext();
>
>      context.setWriteXsiTypes(false);
>
>      context.setReadXsiTypes(true);
>
>      db.setAegisContext(context);
>
>      client.setDataBinding(db);
>
>      IVolume object = (IVolume) client.create();
>
>
>
> Thanks,
>
> Luba A.
>

Re: How to configure CXF client consume wsdl with overloaded methods?

Posted by Benson Margulies <bi...@gmail.com>.
Post a JIRA and attach the wsdl and we'll try to help.


On Wed, Nov 11, 2009 at 7:02 AM, Alpin, Luba <Lu...@lsi.com> wrote:

> I need a help to configure my CXF client to use XFire SOAP service with
> overloaded methods.
>
>
>
> IVolume interface has two method 'getVolumes' with different signature
>
>
>
> Wsdl has one 'getVolumes' and second 'getVolumes1'
>
>
>
> This is the dump of error:
>
>
>
> INFO: Creating Service {http://xfire.codehaus.org/IVolume}IVolume from
> WSDL: http://localhost:8080/public/services/IVolume?wsdl
>
> Nov 11, 2009 1:46:48 PM
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean
> initializeWSDLOperations
>
> WARNING: Could not find a matching method for operation {
> http://xfire.codehaus.org/IVolume}getVolumes1. Operation will be
> unavailable.
>
> java.lang.NullPointerException
>
>      at
> org.apache.cxf.aegis.databinding.AegisDatabinding.getParameterType(AegisDatabinding.java:581)
>
>      at
> org.apache.cxf.aegis.databinding.AegisDatabinding.initializeMessage(AegisDatabinding.java:342)
>
>      at
> org.apache.cxf.aegis.databinding.AegisDatabinding.initializeOperation(AegisDatabinding.java:303)
>
>      at
> org.apache.cxf.aegis.databinding.AegisDatabinding.initialize(AegisDatabinding.java:267)
>
>      at
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(ReflectionServiceFactoryBean.java:363)
>
>      at
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:459)
>
>      at
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:212)
>
>      at
> org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:163)
>
>      at
> org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:100)
>
>      at
> org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:52)
>
>      at
> org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:102)
>
>      at
> org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.java:115)
>
>      at
> com.lsi.xfireConnector.CXFUtil.typedServiceProxyCreator(CXFUtil.java:67)
>
>
>
> This is my client:
>
>
>
>      JaxWsProxyFactoryBean client = new JaxWsProxyFactoryBean();
>
>      client.setServiceClass(clazz);
>
>      client.setAddress(url);
>
>      client.setWsdlURL(url + "?wsdl");
>
>      AegisDatabinding db = new AegisDatabinding();
>
>      AegisContext context = new AegisContext();
>
>      context.setWriteXsiTypes(false);
>
>      context.setReadXsiTypes(true);
>
>      db.setAegisContext(context);
>
>      client.setDataBinding(db);
>
>      IVolume object = (IVolume) client.create();
>
>
>
> Thanks,
>
> Luba A.
>

How to configure CXF client consume wsdl with overloaded methods?

Posted by "Alpin, Luba" <Lu...@lsi.com>.
I need a help to configure my CXF client to use XFire SOAP service with overloaded methods.



IVolume interface has two method 'getVolumes' with different signature



Wsdl has one 'getVolumes' and second 'getVolumes1'



This is the dump of error:



INFO: Creating Service {http://xfire.codehaus.org/IVolume}IVolume from WSDL: http://localhost:8080/public/services/IVolume?wsdl

Nov 11, 2009 1:46:48 PM org.apache.cxf.service.factory.ReflectionServiceFactoryBean initializeWSDLOperations

WARNING: Could not find a matching method for operation {http://xfire.codehaus.org/IVolume}getVolumes1. Operation will be unavailable.

java.lang.NullPointerException

      at org.apache.cxf.aegis.databinding.AegisDatabinding.getParameterType(AegisDatabinding.java:581)

      at org.apache.cxf.aegis.databinding.AegisDatabinding.initializeMessage(AegisDatabinding.java:342)

      at org.apache.cxf.aegis.databinding.AegisDatabinding.initializeOperation(AegisDatabinding.java:303)

      at org.apache.cxf.aegis.databinding.AegisDatabinding.initialize(AegisDatabinding.java:267)

      at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(ReflectionServiceFactoryBean.java:363)

      at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:459)

      at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:212)

      at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:163)

      at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:100)

      at org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:52)

      at org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:102)

      at org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.java:115)

      at com.lsi.xfireConnector.CXFUtil.typedServiceProxyCreator(CXFUtil.java:67)



This is my client:



      JaxWsProxyFactoryBean client = new JaxWsProxyFactoryBean();

      client.setServiceClass(clazz);

      client.setAddress(url);

      client.setWsdlURL(url + "?wsdl");

      AegisDatabinding db = new AegisDatabinding();

      AegisContext context = new AegisContext();

      context.setWriteXsiTypes(false);

      context.setReadXsiTypes(true);

      db.setAegisContext(context);

      client.setDataBinding(db);

      IVolume object = (IVolume) client.create();



Thanks,

Luba A.

Re: How to get rid of certain runtime exceptions in the log?

Posted by Daniel Kulp <dk...@apache.org>.
On Thu November 12 2009 4:21:46 am Tomas Majak wrote:
> Thanks for your reply, I came to the same conclusion, seems a bit of a hack
>  to do that... Assuming that you're involved in development of CXF:
> What if I where to submit a patch, I'm guessing customizing the behavior in
>  the PhaseInterceptorChain may be the simplest fix. One solution could be
>  to introduce a faultLogger handling the fault logging in
>  PhaseInterceptorChain, based on the MessageObserver interface. Have
>  PhaseInterceptorChain calling faultLogger, which then can be replaced by a
>  custom implementation by configuration. Reasonable?

Sounds reasonable to me.   A patch would be lovely.  :-)

Dan


> 
> Tomas
> 
> -----Original Message-----
> From: Daniel Kulp [mailto:dkulp@apache.org]
> Sent: den 11 november 2009 22:17
> To: users@cxf.apache.org
> Cc: Tomas Majak
> Subject: Re: How to get rid of certain runtime exceptions in the log?
> 
> 
> The only thing I can think of would be to subclass the JAXWSMethodInvoker
>  we use and override the invoke or createFault things and do:
> 
> message.put(FaultMode.class, FaultMode.CHECKED_APPLICATION_FAULT);
> 
> if the fault is the security fault.   That would mark it as a checked
> exception and not an unchecked exception.   Checked exceptions are logged
>  at INFO level which would allow the other exceptions that are logged at
>  WARNING to make it through.    Not sure if that is really enough for you
>  though.  If not, a patch adding an enhancement would be good.   :-)
> 
> Dan
> 
> On Wed November 11 2009 5:28:03 am Tomas Majak wrote:
> > Hi,
> >
> > I'm using CXF together with Spring Security (Acegi). I have secured my WS
> >  methods, with role constraints. I'm also using basic auth, which in most
> >  cases leads to requests without credentials first, then I reply
> >  HTTP401-USE BASIC AUTH (I have added a interceptor for doing this) Upon
> >  receiving 401,  the client will resubmit the SOAP request and supply
> >  credentials.
> >
> > The problem here is that in the first request, the service (more precise
> > a Spring security interceptor on the POJO), will throw
> >  org.springframework.security.AccessDeniedException (RunTime). As
> > described above, this is OK, hence I want the error consumed and nothing
> > logged. BUT reading CXF code, I note that
> >  (org.apache.cxf.phase.PhaseInterceptorChain.java) where the exception is
> >  caught, there is no possibility to turn off logging for this scenario.
> > The only possible way I found is to set log level ERROR, which will turn
> > of all logging of exceptions, which I don't. I just want this one to be
> > consumed.
> >
> > Anyone solved something similar?
> >
> > Thanks!
> > Tomas
> 

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

RE: How to get rid of certain runtime exceptions in the log?

Posted by Tomas Majak <to...@nasdaqomx.com>.
Thanks for your reply, I came to the same conclusion, seems a bit of a hack to do that...
Assuming that you're involved in development of CXF:
What if I where to submit a patch, I'm guessing customizing the behavior in the PhaseInterceptorChain may be the simplest fix. One solution could be to introduce a faultLogger handling the fault logging in PhaseInterceptorChain, based on the MessageObserver interface. Have PhaseInterceptorChain calling faultLogger, which then can be replaced by a custom implementation by configuration.
Reasonable?

Tomas

-----Original Message-----
From: Daniel Kulp [mailto:dkulp@apache.org] 
Sent: den 11 november 2009 22:17
To: users@cxf.apache.org
Cc: Tomas Majak
Subject: Re: How to get rid of certain runtime exceptions in the log?


The only thing I can think of would be to subclass the JAXWSMethodInvoker we 
use and override the invoke or createFault things and do:

message.put(FaultMode.class, FaultMode.CHECKED_APPLICATION_FAULT);

if the fault is the security fault.   That would mark it as a checked 
exception and not an unchecked exception.   Checked exceptions are logged at 
INFO level which would allow the other exceptions that are logged at WARNING 
to make it through.    Not sure if that is really enough for you though.  If 
not, a patch adding an enhancement would be good.   :-)

Dan


On Wed November 11 2009 5:28:03 am Tomas Majak wrote:
> Hi,
> 
> I'm using CXF together with Spring Security (Acegi). I have secured my WS
>  methods, with role constraints. I'm also using basic auth, which in most
>  cases leads to requests without credentials first, then I reply
>  HTTP401-USE BASIC AUTH (I have added a interceptor for doing this) Upon
>  receiving 401,  the client will resubmit the SOAP request and supply
>  credentials.
> 
> The problem here is that in the first request, the service (more precise a
>  Spring security interceptor on the POJO), will throw
>  org.springframework.security.AccessDeniedException (RunTime). As described
>  above, this is OK, hence I want the error consumed and nothing logged. BUT
>  reading CXF code, I note that
>  (org.apache.cxf.phase.PhaseInterceptorChain.java) where the exception is
>  caught, there is no possibility to turn off logging for this scenario. The
>  only possible way I found is to set log level ERROR, which will turn of
>  all logging of exceptions, which I don't. I just want this one to be
>  consumed.
> 
> Anyone solved something similar?
> 
> Thanks!
> Tomas
> 

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

Re: How to get rid of certain runtime exceptions in the log?

Posted by Daniel Kulp <dk...@apache.org>.
The only thing I can think of would be to subclass the JAXWSMethodInvoker we 
use and override the invoke or createFault things and do:

message.put(FaultMode.class, FaultMode.CHECKED_APPLICATION_FAULT);

if the fault is the security fault.   That would mark it as a checked 
exception and not an unchecked exception.   Checked exceptions are logged at 
INFO level which would allow the other exceptions that are logged at WARNING 
to make it through.    Not sure if that is really enough for you though.  If 
not, a patch adding an enhancement would be good.   :-)

Dan


On Wed November 11 2009 5:28:03 am Tomas Majak wrote:
> Hi,
> 
> I'm using CXF together with Spring Security (Acegi). I have secured my WS
>  methods, with role constraints. I'm also using basic auth, which in most
>  cases leads to requests without credentials first, then I reply
>  HTTP401-USE BASIC AUTH (I have added a interceptor for doing this) Upon
>  receiving 401,  the client will resubmit the SOAP request and supply
>  credentials.
> 
> The problem here is that in the first request, the service (more precise a
>  Spring security interceptor on the POJO), will throw
>  org.springframework.security.AccessDeniedException (RunTime). As described
>  above, this is OK, hence I want the error consumed and nothing logged. BUT
>  reading CXF code, I note that
>  (org.apache.cxf.phase.PhaseInterceptorChain.java) where the exception is
>  caught, there is no possibility to turn off logging for this scenario. The
>  only possible way I found is to set log level ERROR, which will turn of
>  all logging of exceptions, which I don't. I just want this one to be
>  consumed.
> 
> Anyone solved something similar?
> 
> Thanks!
> Tomas
> 

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