You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by "I-Sampige, Srinivas" <sr...@boeing.com> on 2003/11/06 21:48:16 UTC
Method overloading
Does SOAP support overloading? If I want to expose two methods-
1. sayHello(String firstName)
2. sayHello(String firstName, String lastName)
Then how do I do it in AXIS. Can somebody point me to some samples and materials where I can learn more about this aspect of web services? I haven't been able to find much information about this on the web.
Thanks
Srinivas
Re: Method overloading
Posted by Tom Oinn <tm...@ebi.ac.uk>.
Just to follow up my own post (and apologies!)
From http://www.w3.org/TR/2002/WD-wsdl12-20020709/
-----
[CLOSED] Issue (issue-operation-overloading):
Should operation overloading be disallowed?
Source: Joyce Yang
WSDL 1.1 allows overloaded operations- operations with the same name but
different messages. If they are to be disallowed then we must require
the operation name to be unique within a portType.
Resolution:
Do not allow operation overloading. See minutes for telecon on June 27,
2002 and follow-on email discussion.
-----
Axis does indeed support overloading of methods, but the services thus
generated do not expose a WSDL1.2 compliant interface. There are
workarounds to this; one is to manually split the WSDL into two parts
that just 'happen' to have the same concrete endpoint, with one version
of the method in each one. This is a horrible hack but we've used it
where we need to get the workflow engine to introspect on a service we
don't control and where the authors have not replied to our email :) The
better solution for interoperability is to avoid using this feature. Of
course, if you're only using the autogenerated client stub classes from
WSDL2Java then you're (probably) not going to see a problem here, just
bear in mind that anyone who is trying to access your webservice without
this luxury will almost certainly run into problems.
Cheers,
Tom
Tom Oinn wrote:
> No, this is not allowed as of WSDL1.2 and rightly so, it causes
> immense confusion with dynamic systems such as workflow engines (our
> project). Under WSDL1.1 I believe it was allowed but fortunately
> someone saw sense and removed it.
>
> Cheers,
>
> Tom Oinn
>
> http://taverna.sf.net
>
> I-Sampige, Srinivas wrote:
>
>> Does SOAP support overloading? If I want to expose two methods-
>>
>> 1. sayHello(String firstName)
>> 2. sayHello(String firstName, String lastName)
>>
>>
>> Then how do I do it in AXIS. Can somebody point me to some samples
>> and materials where I can learn more about this aspect of web
>> services? I haven't been able to find much information about this on
>> the web.
>>
>> Thanks
>> Srinivas
>>
>>
>>
>
>
Re: Method overloading
Posted by Tom Oinn <tm...@ebi.ac.uk>.
Ingrid Falk wrote:
>>>>>>"Tom" == Tom Oinn <tm...@ebi.ac.uk> writes:
>>>>>
>
> Tom> Quite correct, and if you are only ever going to use axis and
> Tom> noone else will ever ever need to access your services then
> Tom> it's reasonable. However, in this case you should probably
> Tom> be using CORBA :)
> Maybe, but i still think AXIS is easier to use than CORBA.
Oh, it is. It's worth bearing in mind though that ease of use from our
perspective isn't always the main criteria when deciding upon an
architecture. If any of my students gave that as their sole
justification for using web services over CORBA I'd probably fail them*,
there are plenty of other reasons but as always there is no one right
solution that fits all needs. Good thing too, or many of us would be out
of a job ;)
Tom
* In this case, 'fail them' translates directly to 'make them buy me
guinness', it's more productive and less antagonistic :)
Re: Method overloading
Posted by Ingrid Falk <in...@loria.fr>.
>>>>> "Tom" == Tom Oinn <tm...@ebi.ac.uk> writes:
Tom> Quite correct, and if you are only ever going to use axis and
Tom> noone else will ever ever need to access your services then
Tom> it's reasonable. However, in this case you should probably
Tom> be using CORBA :)
Maybe, but i still think AXIS is easier to use than CORBA.
Ingrid
Re: Method overloading
Posted by Tom Oinn <tm...@ebi.ac.uk>.
Ingrid Falk wrote:
> Tom> No, this is not allowed as of WSDL1.2
> -- but still supported by Axis. I have services whith overloaded
> methods that work. This is possible, because as far as I know, AXIS
> doesn't really make use of the wsdl when calling a service method,
> only to generate stubs.
>
> best,
>
> Ingrid
Quite correct, and if you are only ever going to use axis and noone else
will ever ever need to access your services then it's reasonable.
However, in this case you should probably be using CORBA :)
Tom
Re: Method overloading
Posted by Ingrid Falk <in...@loria.fr>.
>>>>> "Tom" == Tom Oinn <tm...@ebi.ac.uk> writes:
>> Does SOAP support overloading? If I want to expose two methods-
>>
>> 1. sayHello(String firstName) 2. sayHello(String firstName,
>> String lastName)
>>
>>
>> Then how do I do it in AXIS. Can somebody point me to some
>> samples and materials where I can learn more about this aspect
>> of web services? I haven't been able to find much information
>> about this on the web.
>>
>> Thanks Srinivas
>>
>>
>>
Tom> No, this is not allowed as of WSDL1.2
-- but still supported by Axis. I have services whith overloaded
methods that work. This is possible, because as far as I know, AXIS
doesn't really make use of the wsdl when calling a service method,
only to generate stubs.
best,
Ingrid
Re: Method overloading
Posted by Tom Oinn <tm...@ebi.ac.uk>.
No, this is not allowed as of WSDL1.2 and rightly so, it causes immense
confusion with dynamic systems such as workflow engines (our project).
Under WSDL1.1 I believe it was allowed but fortunately someone saw sense
and removed it.
Cheers,
Tom Oinn
http://taverna.sf.net
I-Sampige, Srinivas wrote:
>Does SOAP support overloading? If I want to expose two methods-
>
> 1. sayHello(String firstName)
> 2. sayHello(String firstName, String lastName)
>
>
>Then how do I do it in AXIS. Can somebody point me to some samples and materials where I can learn more about this aspect of web services? I haven't been able to find much information about this on the web.
>
>Thanks
>Srinivas
>
>
>