我正在使用 apache axis 1.2,我尝试在 java webservices 中实现方法重载,这是示例代码。
//Here i took method1 with two parameters
public String method1(String s1,String s2)
{
SampleLogger.error("In method1(1)");
return "method1(1)";
}
//Here i took method1 with three parameters
public String method1(String s1,String s2,String s3) throws RemoteException
{
SampleLogger.error("In method1(2)");
return "method1(2)";
}
//Here i took method1 with four parameters
public String method1(String s1,String s2,String s3,String s4) throws RemoteException
{
SampleLogger.error("In method1(3)");
return "method1(3)";
}
当我尝试将这些方法创建为 Web 服务方法时,我收到错误 IWAB0398E 从 Java 生成 WSDL 时出错:尝试写入重复
schema element : {http://service.codon.com}method1
AxisFault
faultCode: {http://xml.apache.org/axis/}Server.generalException
faultSubcode:
faultString: Attempted to write duplicate schema element :