How to pass parameter to a webservice using ksoap2?

前端 未结 6 1659
后悔当初
后悔当初 2020-12-16 17:28

I\'m using Eclipse IDE to develop an android app. I\'m trying to connect to a .net webservice. I\'m using ksoap2 version 2.3

When I\'m calling a webmethod with no

6条回答
  •  生来不讨喜
    2020-12-16 17:55

    Calling webservice by passing parameters from j2me

    SoapObject request = new SoapObject("http://www.webserviceX.NET", "GetCitiesByCountry");
    String soapAction = "http://www.webserviceX.NET/GetCitiesByCountry";
    
    request.addProperty("CountryName", "india");
    SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
    envelope.bodyOut = request;
    envelope.dotNet = true;
    
    HttpTransport ht = new HttpTransport("http://www.webservicex.net/globalweather.asmx");
    ht.debug = true;
    //System.err.println( ht.requestDump );
    
    ht.call(soapAction,envelope);
    System.out.println("####################: " +envelope.getResponse());
    //SoapObject result = (SoapObject)envelope.getResponse();
    

提交回复
热议问题