2
一個Web服務:
package axis2;
public class Number {
public numb getNumber(numb nr){
return nr;
}
}
類麻木:
package axis2;
public class numb {
private int val;
public numb(int val)
{
this.val = val;
}
public int getVal() {
return val;
}
public void setVal(int val) {
this.val= val;
}
}
我怎麼能作爲參數傳遞給服務對象,並返回一個對象?
package axis2;
import java.rmi.RemoteException;
import axis2.NumberStub.GetNumberResponse;
public class ServiceTest {
public static void main(String[] args) throws RemoteException {
numb nr=new numb(4);
NumberStub stub = new NumberStub();
GetNumberResponse res = stub.getNumber(nr);
System.out.println(res.get_return());
}
}
我得到一個錯誤:
The method getNumber(NumberStub.GetNumber) in the type NumberStub is not applicable for the arguments (numb)
當我嘗試這一點。