2017-11-29 4 views
0

웹 서비스에 연결하려고합니다.
이 웹 서비스에 대한 샘플 요청이 배열 포함 : 전에 비누로 전화를 걸 관리해야KSOAP2 비누 요청에 배열 추가

<Details> 
    <invoiceDetails> 
    <ItemID>int</ItemID> 
    <Price>decimal</Price> 
    <Quantity>decimal</Quantity> 
    <UOM>int</UOM> 
    </invoiceDetails> 
    <invoiceDetails> 
    <ItemID>int</ItemID> 
    <Price>decimal</Price> 
    <Quantity>decimal</Quantity> 
    <UOM>int</UOM> 
    </invoiceDetails> 
</Details> 

을하지만 배열, 그래서 내가 어떻게 내 요청이를 추가?

답변

0

이 코드를 시도

public String getservicecallmethod(String nameSpace, String methodName, 
      String soapAction, String Url, List<Info> mInfo) { 

     String mResponse = ""; 
     SoapObject request = new SoapObject(nameSpace, methodName); 

     SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
       SoapEnvelope.VER11); 
     if (mPropertyInfo != null) { 
      for (Info propertyInfo : mInfo) { 
       request.addProperty(propertyInfo); 
      } 
     } 
     envelope.dotNet = true; 
     envelope.setOutputSoapObject(request); 

     HttpTransportSE ht = new HttpTransportSE(Url); 
     ht.debug = true; 
     try { 
      ht.call(soapAction, envelope); 
     } catch (IOException e) { 
      e.printStackTrace(); 
     } catch (XmlPullParserException e) { 
      e.printStackTrace(); 
     } catch (Exception e) { 
      e.printStackTrace(); 
     } 
     try { 
      mResponse = envelope.getResponse().toString(); 
     } catch (Exception e) { 
      e.printStackTrace(); 
     } 
     return mResponse; 
    } 
관련 문제