Galera, estou fazendo um pequeno exemplo com axis, de acordo com esse tutorial, muito bom por sinal:
http://www.imasters.com.br/artigo/2741/java/web_services_via_j2se_e_j2me/
Ao executar via url:
http://localhost:8080/axis/Servico.jws?method=soma&valor1=2&valor2=4.
Obtenho o seguinte resultado
<?xml version="1.0" encoding="UTF-8" ?>
- <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <soapenv:Body>
- <soapenv:Fault>
<faultcode>soapenv:Server.generalException</faultcode>
<faultstring>Tried to invoke method public int Servico.soma(int,int) with arguments java.lang.String,java.lang.String. The arguments do not match the signature.; nested exception is: java.lang.IllegalArgumentException: argument type mismatch</faultstring>
- <detail>
<ns1:hostname xmlns:ns1="http://xml.apache.org/axis/">SPTEC46</ns1:hostname>
</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
E não o esperado que seria esse:
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<somaResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<somaReturn xsi:type="xsd:int">6</somaReturn>
</somaResponse>
</soapenv:Body>
</soapenv:Envelope>
O que estou fazendo de errado?
