【发布时间】:2011-12-28 10:11:08
【问题描述】:
我有一个来自 Web 服务的 xml,我想将其存储在 ClientDataSet 中。
使用 XML 映射器时,网格中不显示任何数据(使用 “创建和测试转换”),所以我无法使用 转换文件...
这是来自 C# Webservice 的一些响应 XML(一行数据)...
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<soap:Body>
<AllResponse xmlns="http://some.url.com/">
<AllResult>
<xs:schema xmlns="" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:xs="http://www.w3.org/2001/XMLSchema" id="NewDataSet">
<xs:element msdata:UseCurrentLocale="true" msdata:IsDataSet="true" name="NewDataSet">
<xs:complexType>
<xs:choice maxOccurs="unbounded" minOccurs="0">
<xs:element name="Table">
<xs:complexType>
<xs:sequence>
<xs:element name="Id" minOccurs="0" type="xs:string"/>
<xs:element name="UserName" minOccurs="0" type="xs:string"/>
<xs:element name="Name" minOccurs="0" type="xs:string"/>
<xs:element name="PhoneInt" minOccurs="0" type="xs:string"/>
<xs:element name="CostCentre" minOccurs="0" type="xs:int"/>
<xs:element name="GroupRoleNameDK" minOccurs="0" type="xs:string"/>
<xs:element name="GroupRoleNameUK" minOccurs="0" type="xs:string"/>
<xs:element name="Email" minOccurs="0" type="xs:string"/>
<xs:element name="Url" minOccurs="0" type="xs:string"/>
<xs:element name="PhoneAlt" minOccurs="0" type="xs:string"/>
<xs:element name="PhoneMobile" minOccurs="0" type="xs:string"/>
<xs:element name="Fax" minOccurs="0" type="xs:string"/>
<xs:element name="EducationNameDK" minOccurs="0" type="xs:string"/>
<xs:element name="EducationNameUK" minOccurs="0" type="xs:string"/>
<xs:element name="Location" minOccurs="0" type="xs:string"/>
<xs:element name="PhoneNote" minOccurs="0" type="xs:string"/>
<xs:element name="Personid" minOccurs="0" type="xs:int"/>
<xs:element name="GroupId" minOccurs="0" type="xs:int"/>
<xs:element name="GroupNameDK" minOccurs="0" type="xs:string"/>
<xs:element name="GroupNameUK" minOccurs="0" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
<diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
<NewDataSet xmlns="">
<Table diffgr:id="Table1" msdata:rowOrder="0">
<Id>P-4</Id>
<UserName>auser</UserName>
<Name>Somename</Name>
<PhoneInt>aPhone</PhoneInt>
<CostCentre>0</CostCentre>
<GroupRoleNameDK>WebService</GroupRoleNameDK>
<GroupRoleNameUK>WebService</GroupRoleNameUK>
<Email>aname@acompany.com</Email>
<Url>http://www.embarcadero.com</Url>
<PhoneMobile>12345678</PhoneMobile>
<Fax>87654321</Fax>
<Personid>4</Personid>
<GroupId>618</GroupId>
<GroupNameDK>Danish Group</GroupNameDK>
<GroupNameUK>GroupName</GroupNameUK>
</Table>
</NewDataSet>
</diffgr:diffgram>
</AllResult>
</AllResponse>
</soap:Body>
</soap:Envelope>
schema 似乎定义得很好,所以我有点疑惑,为什么会这样
不起作用。
我注意到有些字段有
知道我是怎么相处的吗?
-库尔特
【问题讨论】:
标签: xml web-services delphi soap delphi-xe2