I have an xml from a webservice that I want to store in a ClientDataSet.
When using the XML mapper no data is shown in the grid (when using the
“Create and Test Transformation”), so I’m not able to use the
transformation file…
Here is some of the response XML from the C# Webservice (one row of data)…
<?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>
The schema seems to be well defined, so I’m a bit puzzled, why it
doesn’t work.
I have noticed that some of the fields have <Field/> instead of
<Field></Field> when the field is empty – doesn’t know if that matters…
Any idea how I get along?
-Kurt
The answer was that I needed to change the .XTR file very first line
See Deepak’s article http://www.agnisoft.com/white_papers/soap1.asp
Quote:
This is not fixed in Delphi XE2…
-Kurt