You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by SBixby <St...@inovis.com> on 2007/12/15 03:29:25 UTC

Overloaded methods - XFire->CXF with Aegis

I have a WebService class that has a pair of overloaded methods.

One has two parameters - an object reference and a long value, returning an
array of objects.  The other adds a third parameter, a String.

I'm using Spring and jaxws:endpoint tags to load the service, per many of
the examples on the CXF site, and most of this stuff works, but it appears
to be complaining about overloaded methods when I fire up Tomcat:

org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'TradingPartnershipService': Invocation of init method failed;
nested exception is java.lang.IllegalArgumentException: An operation with
name [{http://ws.catalog.inovis.com}getRetailersWithAccess] already exists
in this service
Caused by: 
java.lang.IllegalArgumentException: An operation with name
[{http://ws.catalog.inovis.com}getRetailersWithAccess] already exists in
this service
	at
org.apache.cxf.service.model.InterfaceInfo.addOperation(InterfaceInfo.java:71)
	at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.createOperation(ReflectionServiceFactoryBean.java:454)

My interface defines these as follows:

    public RetailerAccess[] getRetailersWithAccess(
            @WebParam(name = "UserIdentifier", targetNamespace =
TNS)UserIdentifier userId,
            @WebParam(name = "vendorAccountNumber", targetNamespace =
TNS)long vendorAccountId
    );

    public RetailerAccess[] getRetailersWithAccess(
            @WebParam(name = "UserIdentifier", targetNamespace =
TNS)UserIdentifier userId,
            @WebParam(name = "vendorAccountNumber", targetNamespace =
TNS)long vendorAccountId,
            @WebParam(name = "selcode", targetNamespace = TNS)String selcode
    ) throws WebServiceException;


Is there some additional configuration I can do for CXF to handle these
overloads correctly?  Or should I plan to rename one of them?

Thanks in advance.
-- 
View this message in context: http://www.nabble.com/Overloaded-methods---XFire-%3ECXF-with-Aegis-tp14339900p14339900.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: Overloaded methods - XFire->CXF with Aegis

Posted by Daniel Kulp <dk...@apache.org>.
On Monday 17 December 2007, Steven Bixby wrote:
> I'm still trying to figure this out; it's easy enough to change method
> names, since they're not customer-enabled (yet, anyway).  But I'd like
> to better understand why CXF complained when XFire didn't.

The main reason is that CXF is really trying to hard to be WSI-BP 
compliant as much as possible.   By doing so, it should ensure that 
webservices deployed with CXF should be interoperable with other WSI-BP 
compatible toolkits.  

On of the things that the WSI-BP explicitly forbits is operation 
overloading in the wsdl.   As soon as that occurs, you WILL end up with 
interoperability issues as lots of toolkits don't support it.   

Dan


>
> Until more-recently, I/we just went with sample code and took the
> technology layout for granted.  But now with this CXF migration, I'm
> being forced to take a closer look at the stack composition to
> understand how these technologies interrelate in the WS stack.
>
> If anyone knows a good top-level map of such things on the web, feel
> free to share. :)
>
>
> -----Original Message-----
> From: Dain Sundstrom [mailto:dain@iq80.com]
> Sent: Monday, December 17, 2007 1:50 PM
> To: cxf-user@incubator.apache.org
> Subject: Re: Overloaded methods - XFire->CXF with Aegis
>
> Specifically, I believe you can not have to methods mapped to the
> same operation name in JaxWS, but you can change the operation name
> of one of the methods using the @WebMethod annotation (see the
> example in the linked example [1]).
>
> Unfortunately, there doesn't seem to be any equivalent xml (or
> annotation for aegis).  Is this something XFire supports and CXF
> doesn't?
>
> -dain
>
> On Dec 15, 2007, at 12:05 AM, Glen Mazza wrote:
> > Am Freitag, den 14.12.2007, 18:29 -0800 schrieb SBixby:
> >> I have a WebService class that has a pair of overloaded methods.
> >
> > I don't believe you can do that with web services[1]--JAX-WS doesn't
> > support overloaded methods.
> >
> > Glen
> >
> > [1] http://forums.java.net/jive/thread.jspa?threadID=29300



-- 
J. Daniel Kulp
Principal Engineer, IONA
dkulp@apache.org
http://www.dankulp.com/blog

RE: Overloaded methods - XFire->CXF with Aegis

Posted by Steven Bixby <St...@inovis.com>.
I'm still trying to figure this out; it's easy enough to change method
names, since they're not customer-enabled (yet, anyway).  But I'd like
to better understand why CXF complained when XFire didn't.

Until more-recently, I/we just went with sample code and took the
technology layout for granted.  But now with this CXF migration, I'm
being forced to take a closer look at the stack composition to
understand how these technologies interrelate in the WS stack.

If anyone knows a good top-level map of such things on the web, feel
free to share. :)


-----Original Message-----
From: Dain Sundstrom [mailto:dain@iq80.com] 
Sent: Monday, December 17, 2007 1:50 PM
To: cxf-user@incubator.apache.org
Subject: Re: Overloaded methods - XFire->CXF with Aegis

Specifically, I believe you can not have to methods mapped to the  
same operation name in JaxWS, but you can change the operation name  
of one of the methods using the @WebMethod annotation (see the  
example in the linked example [1]).

Unfortunately, there doesn't seem to be any equivalent xml (or  
annotation for aegis).  Is this something XFire supports and CXF  
doesn't?

-dain

On Dec 15, 2007, at 12:05 AM, Glen Mazza wrote:

> Am Freitag, den 14.12.2007, 18:29 -0800 schrieb SBixby:
>> I have a WebService class that has a pair of overloaded methods.
>
> I don't believe you can do that with web services[1]--JAX-WS doesn't
> support overloaded methods.
>
> Glen
>
> [1] http://forums.java.net/jive/thread.jspa?threadID=29300
>
>
>


Re: Overloaded methods - XFire->CXF with Aegis

Posted by Dain Sundstrom <da...@iq80.com>.
Specifically, I believe you can not have to methods mapped to the  
same operation name in JaxWS, but you can change the operation name  
of one of the methods using the @WebMethod annotation (see the  
example in the linked example [1]).

Unfortunately, there doesn't seem to be any equivalent xml (or  
annotation for aegis).  Is this something XFire supports and CXF  
doesn't?

-dain

On Dec 15, 2007, at 12:05 AM, Glen Mazza wrote:

> Am Freitag, den 14.12.2007, 18:29 -0800 schrieb SBixby:
>> I have a WebService class that has a pair of overloaded methods.
>
> I don't believe you can do that with web services[1]--JAX-WS doesn't
> support overloaded methods.
>
> Glen
>
> [1] http://forums.java.net/jive/thread.jspa?threadID=29300
>
>
>


Re: Overloaded methods - XFire->CXF with Aegis

Posted by Glen Mazza <gl...@verizon.net>.
Am Freitag, den 14.12.2007, 18:29 -0800 schrieb SBixby:
> I have a WebService class that has a pair of overloaded methods.

I don't believe you can do that with web services[1]--JAX-WS doesn't
support overloaded methods.

Glen

[1] http://forums.java.net/jive/thread.jspa?threadID=29300