Hi
I tried to do the same with Sun's Web Services Development Pack (
http://java.sun.com/webservices/index.html). I overloaded a method of the tutorial example (HelloWorld) and made it generate the WSDL.
To develop a Web Service using Sun's WSDP you have to specify an interface and its implementation. The tutorial modified by me looks like this:
interface HelloIF.java
--------------------------------------------------
package hello;
import java.rmi.Remote;
import java.rmi.RemoteException;
public interface HelloIF extends Remote {
public
String sayHello(String s) throws RemoteException;
public String sayHello(float f) throws RemoteException;
}
--------------------------------------------------
implementation HelloImpl.java
--------------------------------------------------
package hello;
public class HelloImpl implements HelloIF {
public String message = new String("Hello ");
public String sayHello(String s) {
return new String(message + s);
}
public String sayHello(float f) {
return new String(message + f);
}
}
--------------------------------------------------
The WSDL automatically generated:
--------------------------------------------------
<?xml version="1.0" encoding="UTF-8" ?>
<definitions name="HelloWorldService" targetNamespace="http://hello.org/wsdl" xmlns:tns="http://hello.org/wsdl" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
<types />
<message name="sayHello">
<part name="float_1" type="xsd:float" />
</message>
<message name="sayHelloResponse">
<part name="result" type="xsd:string" />
</message>
<message name="sayHello2">
<part name="String_1" type="xsd:string" />
</message>
<message name="sayHello2Response">
<part name="result" type="xsd:string" />
</message>
<portType name="HelloIF">
<operation name="sayHello">
<input message="tns:sayHello" />
<output message="tns:sayHelloResponse" />
</operation>
<operation name="sayHello2">
<input message="tns:sayHello2" />
<output message="tns:sayHello2Response" />
</operation>
</portType>
<binding name="HelloIFBinding" type="tns:HelloIF">
<operation name="sayHello">
<input>
<
soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded" namespace="http://hello.org/wsdl" />
</input>
<output>
<soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded" namespace="http://hello.org/wsdl" />
</output>
<soap
peration soapAction="" />
</operation>
<operation name="sayHello2">
<input>
<soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded" namespace="http://hello.org/wsdl" />
</input>
<output>
<soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" use="encoded" namespace="http://hello.org/wsdl" />
</output>
<soap
peration soapAction="" />
</operation>
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc" />
</binding>
<service name="HelloWorld">
<port name="HelloIFPort" binding="tns:HelloIFBinding">
<soap:address location="REPLACE_WITH_ACTUAL_URL" />
</port>
</service>
</definitions>
--------------------------------------------------
So, it seems that WSDL does not support overloading as in the spec.
Or maybe there is something I am missing...
Marco