さて、私は接続を行っています... Webサービスを使用したSQLサーバー、j2meを使用したWebサービスですが、今は1つのhelloworldを実行しています...できましたが、今は1つの「hello world」+nombreを実行したい.. . パラメータは Web サービスで受信されません。ここでは Web サービス
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
// Para permitir que se llame a este servicio web desde un script, usando ASP.NET AJAX, quite la marca de comentario de la línea siguiente.
// [System.Web.Script.Services.ScriptService]
public class Service : System.Web.Services.WebService
{
public Service () {
}
[WebMethod]
public string HelloWorld(String nombre)
{
return "Que onda " + nombre;
}
}
これはksoapで呼び出すためのコードです...
String nombremetodo="HelloWorld";
String url="http://localhost:49175/WebSite1/Service.asmx";
String namespace="http://tempuri.org/";
String SOAP_ACTION=namespace+nombremetodo;
public void traer()
{
SoapObject busqueda =new SoapObject(namespace,nombremetodo);
HttpTransport transportacion = new HttpTransport(url);
busqueda.addProperty(new String("nombre"),new String("Angel"));
System.out.println("parametro agregado");
//busqueda.addProperty(PropertyInfo.OBJECT_TYPE, "Angel");
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
transportacion.debug=true;
envelope.bodyOut=busqueda;
System.out.println("todo ok");
try{
System.out.println("comenzando transportacion");
transportacion.call(SOAP_ACTION, envelope);
System.out.println("transportacion ok");
respuesta = envelope.getResponse().toString();
System.out.println("respuesta ok");
}
catch(Exception e)
{
texto.setString("fallo");
System.out.println("falla en el try");
System.out.println(e);
}
}
「que onda」をスペース付きで返すので、Webサービスに入れましたが、「que onda」+ nombreを返すことはありません...これはAndroid用ではなくj2me用のアプリケーションです。Android用ですすっごく...
PropertyInfo p1 = new PropertyInfo();
p1.setName("nombre");
p11.setValue("Angel");
busqueda.addProperty(p1);
しかし、j2me の ksoap にはこれらのメソッドがありません.. "setName, setValue"; このライブラリをダウンロードしましたが、醜いバグが発生し、アプリケーションが実行されません...これで、パラメーターが追加されていることがわかります..
busqueda.addProperty("nombre","Angel");
しかし、これは機能しません...動作しますが、バグはありませんが、Webサービスはパラメーターを受け取りません...
STACKOVERFLOW の皆さんありがとう