Galera que saca de web service é o seguinte.
Tenho uma web service neste endereço: http://200.194.103.10:8080/axis/Servico.jws pelos teste feitos no browse ele esta ok. http://200.194.103.10:8080/axis/Servico.jws?wsdl
existe um metodo chamado soma que também esta funcionando pelo browse. http://200.194.103.10:8080/axis/Servico.jws?method=soma&valor1=2&valor2=4
O problema é que minha aplicação em J2ME não esta conseguindo conectar com esse web service. Quando tento da erro de HTTP.
O código da minha aplicação é o seguinte:
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import org.ksoap.SoapObject;
import org.ksoap.transport.HttpTransport;
/**
*
* @author Igo Coelho
* @version
*/
public class ClienteJ2ME extends MIDlet {
private Display display;
//private String url = "http://localhost:8080/axis/Servico.jws";
private String url = "http://200.194.103.10:8080/axis/Servico.jws";
TextBox textbox = null;
public void startApp(){
display = Display.getDisplay(this);
try{
testWebService();
}catch(Exception e){
System.out.println(e);
}
}
public void pauseApp(){}
public void destroyApp(boolean unconditional){}
public void testWebService() throws Exception{
StringBuffer stringBuffer = new StringBuffer();
TextBox textBox = null;
try{
// Chama o WebService
SoapObject client = new SoapObject(url,"soma");
client.addProperty("valor1",new Integer(2));
client.addProperty("valor2",new Integer(4));
HttpTransport ht = new HttpTransport(url,"soma");
stringBuffer.append("Resultado: " + ht.call(client));
// mostra o valor do resultado na tela.
textBox = new TextBox("Teste WebService", stringBuffer.toString(), 1024, 0);
display.setCurrent(textBox);
}catch(Exception e){
textBox = new TextBox("Teste WebService", e.toString(), 1024, 0);
display.setCurrent(textBox);
}
}
}