How can I cast a String to a SoapObject in ksoap2?

前端 未结 3 922
既然无缘
既然无缘 2021-01-07 14:29

In my Android app I use ksoap2 for communication with a server. I download a certain complex sports information structure via soap request and parse it later in my program.<

3条回答
  •  清酒与你
    2021-01-07 14:46

    This here seems to work:

    public SoapObject createSoapObjectFromSoapObjectString(String soapObjectString)
    {
    // Create a SoapSerializationEnvelope with some config
    SoapSerializationEnvelope env = new SoapSerializationEnvelope(SoapEnvelope.VER11);
    env.dotNet = true;
    
    // Set your string as output
    env.setOutputSoapObject(soapObjectString);
    
    // Get response
    SoapObject so = (SoapObject) env.getResponse();
    
    return so;
    }
    

提交回复
热议问题