Although the WSDL 1.1 specification allows overloaded operations, the WS-I Basic Profile does not permit it, and WSDL 2.0 will not permit it.
Per the WS-I BP:
<wsiExcerpt>
5.4.3 Distinctive Operations
Operation name overloading in a wsdl:portType is disallowed by the Profile.R2304 A wsdl:portType in a DESCRIPTION MUST have operations with distinct values for their name attributes.
Note that this requirement applies only to the wsdl:operations within a given wsdl:portType. A wsdl:portType may have wsdl:operations with names that are the same as those found in other wsdl:portTypes.
</wsiExcerpt>
The reason why it disallows it is that the specs don't define how to process overloaded operations, therefore it is a source of interoperability issues.
Anne
At 02:08 PM 3/30/2004, you wrote:
Hell All.
I have a WSDL that uses overloaded operations at a few
places. My application provieds a bridge between an
existing J2EE application and a .NET GUI client.
In my WSDL, my TestInterface has two operations:
"TestMethod" that takes two strings
"TestMethod" that takes three strings
<message name="TestInterface.TestMethod"> ...
</message>
<message name="TestInterface.TestMethodResponse"> ...
</message>
<message name="TestInterface.TestMethod_"> ...
</message>
<message name="TestInterface.TestMethod_Response"> ...
</message>
... ...
... ...
<operation name="TestMethod">
<input message="tns:TestInterface.TestMethod"
name="TestMethod" />
<output
message="tns:TestInterface.TestMethodResponse"
name="TestMethodResponse" />
</operation>
<operation name="TestMethod">
<input message="tns:TestInterface.TestMethod_"
name="TestMethod_" />
<output
message="tns:TestInterface.TestMethod_Response"
name="TestMethod_Response" />
</operation>
Please note that to make the message names unique, I
am using an underscore at the end of the message name.
Also, I am using unique element names and part names
in the messages.
When I generate Java code, the generated methods look
alright (as shown below)
public org.apache.ka.TestObject testMethod(
String a, String b
) throws ...;
public org.apache.ka.TestObject testMethod(
String aa, Stirng bb, String cc
) throws ...;
I could build, deploy and run the application as
expected.
Now, here is the question. I read somewhere that WSI
basic profile is going to prohibit use of overloaded
operations (in general more than one operations with
the same operation name - regarless of equality of the
number of arguments they take)! Can someone confirm
that for Axis and if that's the case, does anyone know
the reason? I am planning to use WebServices for
three major languages - Java, C# and C++. And all the
three languages support overloaded methods. Why would
WSI not allow it?
Thanks.
Kartik
__________________________________
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html
Anne Thomas Manes
VP & Research Director
Burton Group
