2013-07-11 2 views
0

Я борюсь с созданием SOAP Request для последующего запроса мыла:Как создать ksoap2 объекта запроса

<?xml version="1.0"?> 
     <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAPSDK1="http://www.w3.org/2001/XMLSchema" xmlns:SOAPSDK2="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAPSDK3="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema"> 
<SOAP-ENV:Header/><SOAP-ENV:Body><ns1:Authenticate xmlns:ns1="urn:Login" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> 
    <msgstr xsi:type="xsd:string"><Message messageid="0"> 
       <Entity name="REF_LOGIN"> 
       <Property name="login_cd" value="ABC" type="STRING"/> 
       <Property name="password" value="ABC" type="STRING"/> 
       <Property name="machine_name" value="iPhone Simulator" type="STRING"/> 
       <Property name="language_code" value="en" type="STRING"/&gt; 
       <Property name="client_version_cd" value="XL7.11" type="STRING"/> 
       </Entity> 
      </Message></msgstr></ns1:Authenticate></SOAP-ENV:Body></SOAP-ENV:Envelope> 
+0

http://stackoverflow.com/questions/14563306/using-web-services-in-android/14563386#14563386 – Nirmal

+0

прочитать мою статью Http: //www.c-sharpcor ner.com/UploadFile/88b6e5/how-to-call-web-service-in-android-using-soap/ –

+0

@ChintanRathod, мои объекты вложены. можете ли вы предоставить небольшую помощь для вложенности объекта –

ответ

0

Надежда эта помощь: я отправил мой надрез код здесь: соответственно заменить ур значения

 SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME); 
     PropertyInfo propInfo1 = new PropertyInfo(); 
     propInfo1.setName("Input_if_any"); 
     propInfo1.setValue(1); 
     propInfo1.setType(int.class); 
     request.addProperty(propInfo1); 
     SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
       SoapEnvelope.VER11); 
     envelope.dotNet = true; // put this only if the web service is .NET one 
     envelope.setOutputSoapObject(request); 
     HttpTransportSE androidHttpTransport = new HttpTransportSE(URL); 
     try { 
      androidHttpTransport.call(SOAP_ACTION, envelope); 
      // SoapPrimitive response = (SoapPrimitive)envelope.getResponse(); 
      Object response1 = envelope.getResponse(); 
      SoapObject response = (SoapObject) response1; 

      Log.i("myApp", response1.toString()); 
      if (response1.toString().equalsIgnoreCase("true")) { 
       result = true; 
      } 
+0

мои объекты вложены. вы можете мало помочь в вложенности объекта –

Смежные вопросы