Galera, gerei um wsdl que tem um metodo que recebe 2 parametros e retorna a soma dos dois.
Mas quando crio a seguinte classe webservice client
package servico.modelo;
import java.rmi.RemoteException;
import org.apache.axis2.AxisFault;
import servico.modelo.SomaServicoStub.SomaDoisNumeros;
import servico.modelo.SomaServicoStub.SomaDoisNumerosResponse;
public class TesteWS {
public static void main(String[] args) {
try {
SomaServicoStub stub = new SomaServicoStub();
SomaDoisNumeros soma = new SomaDoisNumeros();
soma.setNum1(5);
soma.setNum2(10);
SomaDoisNumerosResponse response = stub.somaDoisNumeros(soma); // linha que retorna o erro Unexpected subelement
System.out.println(response.get_return());
} catch (AxisFault e) {
e.printStackTrace();
} catch (RemoteException e) {
e.printStackTrace();
}
}
}
Me retorna este erro:
org.apache.axis2.AxisFault: org.apache.axis2.databinding.ADBException: Unexpected subelement {http://schemas.xmlsoap.org/soap/envelope/}Body
at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
at servico.modelo.SomaServicoStub.fromOM(SomaServicoStub.java:1499)
at servico.modelo.SomaServicoStub.somaDoisNumeros(SomaServicoStub.java:200)
at servico.modelo.TesteWS.main(TesteWS.java:20)
Caused by: java.lang.Exception: org.apache.axis2.databinding.ADBException: Unexpected subelement {http://schemas.xmlsoap.org/soap/envelope/}Body
at servico.modelo.SomaServicoStub$SomaDoisNumerosResponse$Factory.parse(SomaServicoStub.java:1405)
at servico.modelo.SomaServicoStub.fromOM(SomaServicoStub.java:1493)
... 2 more
Caused by: org.apache.axis2.databinding.ADBException: Unexpected subelement {http://schemas.xmlsoap.org/soap/envelope/}Body
at servico.modelo.SomaServicoStub$SomaDoisNumerosResponse$Factory.parse(SomaServicoStub.java:1399)
... 3 more
Alguém pode me ajudar, como poderia solucionar este problema?
Eu fiz se baseando: http://www.eclipse.org/webtools/community/tutorials/BottomUpAxis2WebService/bu_tutorial.html