SOAP body如下:
<soap12:Body>
    <MCSInterface xmlns="http://tempuri.org/">
      <dllName>string</dllName>
      <className>string</className>
      <MethodName>string</MethodName>
      <args>
        <anyType />
        <anyType />
      </args>
    </MCSInterface>用NSURLRequest请求如下的XML不行,
<?xml version=”1.0” encoding=”utf-8”?><soap12:Envelope xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xmlns:xsd=”http://www.w3.org/2001/XMLSchema” xmlns:soap12=”http://www.w3.org/2003/05/soap-envelope”><soap12:Body><MCSInterface xmlns=”http://tempuri.org/”><dllName>SysMaintain_Service</dllName><className>SysMaintain_Service.MySystem.SysMaintain</className><MethodName>getWebModules</MethodName><args><anyType>1</anyType><anyType></anyType></args></MCSInterface></soap12:Body></soap12:Envelope>。后来转用ksoap实现,成功了,soapObject请求结构如下:MCSInterface{dllName=*;className=*;MethodName=*;args=MCSInterface{anyType=1, anyType=""}}后来,在iOS的NSURLRequest请求<args>...</args>改成<MCSInterface><args>...</args></MCSInterface>也不行,不知怎么表达?郁闷啊

解决方案 »

  1.   

    工作了四天,终于发现要自己序列化XML了,利用ksoap2 httpTransportSE中的debug属性设为True,打印httpTranportSE.requestDump。结果如下:<v:Envelope xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:d="http://www.w3.org/2001/XMLSchema" xmlns:c="http://schemas.xmlsoap.org/soap/encoding/" xmlns:v="http://schemas.xmlsoap.org/soap/envelope/"><v:Header /><v:Body><MCSInterface xmlns="http://tempuri.org/" id="o0" c:root="1"><dllName i:type="d:string">SysMaintain_Service</dllName><className i:type="d:string">SysMaintain_Service.MySystem.SysMaintain</className><MethodName i:type="d:string">getWebModules</MethodName><n0:args i:type="n0:MCSInterface" xmlns:n0="http://tempuri.org/"><anyType i:type="d:int">1</anyType><anyType i:type="d:string"></anyType></n0:args></MCSInterface></v:Body></v:Envelope>然后利用这个xml请求,能够收到数据。基础工作啊,不过有方向了!
      

  2.   

    SOAPEngine 不能封装嵌套webservice
    ASIHttpRequest不能封装嵌套webservice
    用原始的HTTPRequest,和序列化好的XML(ksoap2 requestDump)替换HTTPBody