javaweb服务中的方法重载
我正在使用ApacheAxis1.2,并尝试在JavaWebServices中实现方法重载。这是示例代码javaweb服务中的方法重载,java,web-services,axis,Java,Web Services,Axis,我正在使用ApacheAxis1.2,并尝试在JavaWebServices中实现方法重载。这是示例代码 //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
//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)";
}
当我试图将这些方法创建为webservice方法时,我遇到了一个错误
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 :
尽管如此,您仍然可以使用
@WebMethod(operationName=…)
注释,尽管这不是真正的重载。不过,您可以使用@WebMethod(operationName=…)
注释,尽管这不是真正的重载