0

I try this code for sent data to MsSql using webservice. when I try to Sent data Manuely its working wery well but when I try to sent by this code is not working. Return value is always correct value but dont send to mydatabase

    SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);

        PropertyInfo pi = new PropertyInfo();
        pi.setName("DeviceId");
        pi.setValue("mumin burak");
        pi.setType(String.class);
        pi.setNamespace(NAMESPACE);
        request.addProperty(pi);


    request.addProperty("Lat", "21233232");

    SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
            SoapEnvelope.VER11);
    envelope.dotNet = true;
    envelope.setOutputSoapObject(request);

    AndroidHttpTransport httpTransport = new AndroidHttpTransport(URL);

    SoapPrimitive result = null;
    try {
        httpTransport.call(SOAP_ACTION, envelope);
        result = (SoapPrimitive) envelope.getResponse();
        twMsg.setText(result.toString());
    } catch (IOException e) {
        // TODO Auto-generated catch block
        twMsg.setText(e.getMessage());
    } catch (XmlPullParserException e) {
        // TODO Auto-generated catch block
        twMsg.setText(e.getMessage());
    }
teknodram
  • 11
  • 4

2 Answers2

2

i already suffered same problem with SOAP WS .... with lat/long and any double data type value... i must have to preferring "MarshalFloat class "
http://seesharpgears.blogspot.in/2010/11/implementing-ksoap-marshal-interface.html .

finally... no need to change whole logic. but just create instance of MarshalFloat and registered it with envelope it's done in my case..

MarshalFloat md = new MarshalFloat();

md.register(envelope);

GovindRathod
  • 867
  • 1
  • 8
  • 22
0

To sending double values, you should implement ksoap Marshal interface. For more information visit here: Implementing KSOAP Marshal Interface

Oguz Ozkeroglu
  • 3,025
  • 3
  • 38
  • 64