Pessoal, estou criando um Web Service (tah, na verdade to brincando para aprender!) e segui o tutorial no link abaixo:
http://www.javafree.org/content/view.jf?idContent=4
Construi o Servico.jws:
[code]public class Servico {
public int soma (int valor1, int valor2){
return valor1 + valor2;
}
}[/code]
Construi o client:
[code]import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
public class Cliente {
public static void main(String[] args) throws Exception {
// Endereço, local onde encontra-se o Web Service
String local = "http://localhost:8080/axis/Servico.jws";
// Criando e configurando o serviço
Call call = (Call) new Service().createCall();
// Configurando o endereço.
call.setTargetEndpointAddress(local);
// Marcando o método a ser chamado.
call.setOperationName("soma");
// Parâmetros da função soma.
Object[] param = new Object[] { new Integer(2), new Integer(4) };
// Retorno da Função
Integer ret = (Integer) call.invoke(param);
// Imprime o resultado: ret = 2 + 4.
System.out.println("Resultado da Soma: " + ret);
}
}[/code]
Ao Executar no Eclipse a classe Cliente ele tambem retorna:
- Unable to find required classes (javax.activation.DataHandler and javax.mail.internet.MimeMultipart). Attachment support is disabled.
Resultado da Soma: 6
Como posso limpar o erro descrito???
Olhando no Validation do Axis, verifiquei…
Optional Components
Warning: could not find class javax.mail.internet.MimeMessage from file mail.jar
Attachments will not work.
See http://java.sun.com/products/javamail/
Warning: could not find class org.apache.xml.security.Init from file xmlsec.jar
XML Security is not supported.
See http://xml.apache.org/security/
Ideias?