Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/355.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
javaweb服务中的方法重载_Java_Web Services_Axis - Fatal编程技术网

javaweb服务中的方法重载

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

我正在使用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 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=…)
注释,尽管这不是真正的重载