Java 如何在android中解析复杂类型的web服务xml响应和数据类型

Java 如何在android中解析复杂类型的web服务xml响应和数据类型,java,android,webservice-client,Java,Android,Webservice Client,我的web服务基本上是WCF。我正在使用ksoap2,它工作正常,但我需要一个解决方案,该解决方案提供类似wsimport的功能 我在中的soap响应看起来像 <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" > <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="h

我的web服务基本上是
WCF
。我正在使用ksoap2,它工作正常,但我需要一个解决方案,该解决方案提供类似
wsimport
的功能

我在中的soap响应看起来像

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" >

    <s:Body
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:xsd="http://www.w3.org/2001/XMLSchema" >

        <UserLoginResponse xmlns="http://tempuri.org/" >

            <UserLoginResult>

                <DocumentElement xmlns="" >

                    <xs:schema
                        xmlns:xs="http://www.w3.org/2001/XMLSchema"
                        xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
                        id="DocumentElement" >

                        <xs:element
                            name="DocumentElement"
                            msdata:IsDataSet="true"
                            msdata:UseCurrentLocale="true" >

                            <xs:complexType>

                                <xs:choice
                                    maxOccurs="unbounded"
                                    minOccurs="0" >

                                    <xs:element name="Table" >

                                        <xs:complexType>

                                            <xs:attribute
                                                name="UserID"
                                                type="xs:int" />

                                            <xs:attribute
                                                name="UserName"
                                                type="xs:string" />

                                            <xs:attribute
                                                name="LevelID"
                                                type="xs:int" />

                                            <xs:attribute
                                                name="LevelName"
                                                type="xs:string" />

                                            <xs:attribute
                                                name="RoleID"
                                                type="xs:int" />

                                            <xs:attribute
                                                name="RoleName"
                                                type="xs:string" />

                                            <xs:attribute
                                                name="ServiceProviderID"
                                                type="xs:int" />

                                            <xs:attribute
                                                name="ServiceProvider"
                                                type="xs:string" />

                                            <xs:attribute
                                                name="ClientID"
                                                type="xs:int" />

                                            <xs:attribute
                                                name="ClientName"
                                                type="xs:string" />
                                        </xs:complexType>
                                    </xs:element>
                                </xs:choice>
                            </xs:complexType>
                        </xs:element>
                    </xs:schema>

                    <Table
                        ClientID="0"
                        ClientName=""
                        LevelID="1"
                        LevelName="IT Team"
                        RoleID="1"
                        RoleName="IT Admin"
                        ServiceProvider=""
                        ServiceProviderID="0"
                        UserID="1"
                        UserName="Admin" />
                </DocumentElement>
            </UserLoginResult>
        </UserLoginResponse>
    </s:Body>

</s:Envelope>

我已经尝试过wsdl2code为我的
WCF
生成代理类,但它只生成请求而不生成响应。android中是否有其他用于
WCF
的工具。NET用户可以轻松地将上述xml作为数据集解析为datatable。我可以在android中使用类似的功能吗


请引导我找到一个灵活的解决方案。

。选中此复选框我的web服务包含160个方法。。。编写这些类是非常痛苦的