【发布时间】:2017-05-25 21:18:58
【问题描述】:
我有一个请求 xml,其中包含架构定义。如何创建需要传递给 retrofit 肥皂请求的 pojo 类。
下面是我的示例 xml 需要创建为 pojo 的数据
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:tem="http://tempuri.org/"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<soap:Header />
<soap:Body>
<gbr xmlns="http://tempuri.org/">
<objhandler>
<id>
<int>123</int>
</id>
<dp>true</dp>
<cid>12312</cid>
</objhandler>
<dtASNCondensed>
<xs:schema xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
xmlns:xs="http://www.w3.org/2001/XMLSchema" id="NewDataSet" xmlns="">
<xs:element name="NewDataSet" msdata:IsDataSet="true"
msdata:MainDataTable="dtASNCondensed" msdata:UseCurrentLocale="true">
<xs:complexType>
<xs:choice maxOccurs="unbounded" minOccurs="0">
<xs:element name="dtASNCondensed">
<xs:complexType>
<xs:sequence>
<xs:element name="id" minOccurs="0" type="xs:string" />
<xs:element name="gid" minOccurs="0" type="xs:string" />
<xs:element name="te" minOccurs="0" type="xs:string" />
<xs:element name="rec" minOccurs="0" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
<diffgr:diffgram xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1"
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<DocumentElement xmlns="">
<dtASNCondensed diffgr:hasChanges="inserted" diffgr:id="dtASNCondensed1"
msdata:rowOrder="0">
<id>123</id>
<gid>3000037430</gid>
<te>102</te>
<rec>1</rec>
</dtASNCondensed>
</DocumentElement>
</diffgr:diffgram>
</dtASNCondensed>
</gbr>
</soap:Body>
【问题讨论】:
标签: java android xml soap retrofit2