ksoap访问webservice上送自定义对象如何处理 2C

服务端wsdl定于如下:

 <element name="doSelect”>//doSelect 为调用的方法
    <complexType>
    <sequence>
        <element name="sid" type="xsd:int"/>
        <element name="objectType" type="xsd:string"/>
        <element name="whereClause" type="xsd:string"/>
        <element name="maxRows" type="xsd:int"/>
        <element name="attributes" type="impl:ArrayOfString"/>
    </sequence>
    </complexType>
</element>
<element name="doSelectResponse”>//调用返回定义
    <complexType>
    <sequence>
        <element name="doSelectReturn" type="xsd:string"/>
    </sequence>
    </complexType>
</element>

//调用方法中一个参数定义(attributes)

 <complexType name="ArrayOfString">
    <sequence>
        <element maxOccurs="unbounded" name="string" type="xsd:string"/>
    </sequence>
</complexType>

以上都是服务端定义,没有服务端代码。其中一个参数attributes,type="impl:ArrayOfString" 不知道怎么传入,尝试了几种方法没有解决。

以下是代码:

 SoapObject request = new SoapObject(data.getServiceNameSpace(),"doSelect");

request.addProperty("sid", “26354758596”);

request.addProperty("objectType", "wf");

request.addProperty("whereClause", "assignee.last_name=‘liming’ AND status='PEND'");

request.addProperty("maxRows", 100);

request.addProperty("attributes”,_null);  //此处问题所在!!!!!!

SoapSerializationEnvelope envelope;

envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);

envelope.bodyOut = request;

HttpTransportSE transport = new HttpTransportSE(data.getServerUrl());

transport.debug = true;

//调用WebService

try {

    transport.call(null, envelope);

    if (envelope.getResponse() != null) 
    {

        SoapObject loginresopnse = (SoapObject)envelope.bodyIn;
        String retStr = loginresopnse.getProperty("doSelectReturn").toString();

        Log.d("debug",retStr);

        return true;

    }
    
    return false;

} catch (IOException e) {
 
   Log.d("debug","in IOException");

   Log.d("info",e.getMessage());
   return false;

} catch (XmlPullParserException e) {

    Log.d("debug","in XmlPullParserException");

    Log.d("info",e.getMessage());
    return false;

}


1个回答

没有人熟悉这方面么?

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐