Return-Path: Delivered-To: apmail-cxf-users-archive@www.apache.org Received: (qmail 91437 invoked from network); 1 May 2008 23:13:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 1 May 2008 23:13:18 -0000 Received: (qmail 93763 invoked by uid 500); 1 May 2008 23:13:18 -0000 Delivered-To: apmail-cxf-users-archive@cxf.apache.org Received: (qmail 93726 invoked by uid 500); 1 May 2008 23:13:18 -0000 Mailing-List: contact users-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@cxf.apache.org Delivered-To: mailing list users@cxf.apache.org Received: (qmail 93715 invoked by uid 99); 1 May 2008 23:13:18 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 May 2008 16:13:18 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [69.144.159.82] (HELO EVOX.fluxcorp.com) (69.144.159.82) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 01 May 2008 23:12:25 +0000 Received: from localhost ([127.0.0.1]) by EVOX.fluxcorp.com for users@cxf.apache.org; Thu, 1 May 2008 17:12:45 -0600 Message-ID: <481A4F35.3060303@fluxcorp.com> Date: Thu, 01 May 2008 17:16:05 -0600 From: Arul Dhesiaseelan User-Agent: Thunderbird 2.0.0.12 (Windows/20080213) MIME-Version: 1.0 To: users@cxf.apache.org Subject: Re: overloaded operation names in JAX-WS References: <481A499A.90507@fluxcorp.com> <481A4BB4.6060009@dcs.shef.ac.uk> In-Reply-To: <481A4BB4.6060009@dcs.shef.ac.uk> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Thanks Ian. I am using CXF on both ends. So, your solution works great for me. Cheers, Arul Ian Roberts wrote: > Arul Dhesiaseelan wrote: >> Hi, >> >> I am getting an IllegalArgumentException (An operation with name >> [{http://example.com}getGroups] already exists in this service) when >> I have overloaded methods in my web service. >> >> Is it not supported to have overloaded web service methods in JAX-WS? >> >> I have the following methods: >> >> public Groups getGroups(); >> public Groups getGroups(String pattern); > > No, all the operations must have different names in the WSDL. If you > are using CXF on both client and server side, you can do something like: > > @WebMethod > public Groups getGroups(); > > @WebMethod(operationName = "getGroupsByPattern") > public Groups getGroups(String pattern); > > This would give the two operations different names in the WSDL, but > you can use the Java interface as the serviceClass of a > JaxWsProxyFactoryBean and call both methods via their overloaded name. > > Ian > > P.S. If you were to generate code from the WSDL you would get public > Groups getGroupsByPattern(String arg0), of course. >