Hi,
I'm connecting to a SOAP server and I'm retrieving a lot of information. I'm wanting to utilise the ObjectToSoap and SoapToObject methods, so that I can store what I've received into a file, and then read it back from a file and work through the data at a later date without having to connect to the service and download the information again.
I'm having problems where the file being created is blank or empty, yet the data coming through from the server is significant. (I can view the data and save it to an XML file by using the AfterExecute Event and accessing the data stream).
I've struggled to find the references to help me, and the following is what I've obtained from reading other newsgroup posts I've googled, but it doesn't appear to be working for me:
_Resp := (RIO1 as ReferenceDataService.GenericCodeSet).GenericCodeSet(Param1, Param2, Param3);
XMLDoc1.Active := False;
XMLDoc1.XML.Clear;
XMLDoc1.Active := true;
ARootNode := XMLDoc1.CreateNode('MyRemotable');
NewNode := _Resp.ObjectToSOAP(ARootNode, ARootNode, Rio1.Converter, '', '', '', [], RefID);
XMLDoc1.SaveToFile('c:\temp\MyResponse.xml');
My plan then was to use SOAPToObject to load back into a new instance of _Resp which I thought would just be the reverse process.
Am I trying to achieve this the wrong way? Or can anyone see why the above would result in a blank file?
I'm not sure if it's relevant, but the data returning from the server looks like:
<S:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<env:Header/>
<S:Body>
<ns1:GenericCodeSetResponse xmlns:ns1="http://agriculture.gov.au/nexdoc/GenericCodeSetSoap_1.0">
<ns1:genericCodeSetResponse>
<ns1:codeSetName>ECM_AHECC_CODE</ns1:codeSetName>
<ns1:listCodeSet>
<ns1:listPosition>1</ns1:listPosition>
<ns1:listItemCodeSet>
<ns1:key>CODE</ns1:key>
<ns1:value>02011010</ns1:value>
<ns1:type>string</ns1:type>
</ns1:listItemCodeSet>
<ns1:listItemCodeSet>
<ns1:key>DESCRIPTION</ns1:key>
<ns1:value>BOVINE CARCASSES AND HALF-CARCASSES, FRESH OR CHILLED - BEEF</ns1:value>
<ns1:type>string</ns1:type>
</ns1:listItemCodeSet>
<ns1:listItemCodeSet>
<ns1:key>START_DATE</ns1:key>
<ns1:value>1990-01-01T00:00:00.0</ns1:value>
<ns1:type>dateTime</ns1:type>
</ns1:listItemCodeSet>
<ns1:listItemCodeSet>
<ns1:key>END_DATE</ns1:key>
<ns1:value>null</ns1:value>
<ns1:type>dateTime</ns1:type>
</ns1:listItemCodeSet>
<ns1:listItemCodeSet>
<ns1:key>UPDATED_DATE</ns1:key>
<ns1:value>2017-12-08T18:31:50.828</ns1:value>
<ns1:type>dateTime</ns1:type>
</ns1:listItemCodeSet>
</ns1:listCodeSet>
<ns1:listCodeSet>
<ns1:listPosition>2</ns1:listPosition>
<ns1:listItemCodeSet>
<ns1:key>CODE</ns1:key>
<ns1:value>02011040</ns1:value>
<ns1:type>string</ns1:type>
</ns1:listItemCodeSet>
<ns1:listItemCodeSet>
<ns1:key>DESCRIPTION</ns1:key>
<ns1:value>MEAT OF BOVINE ANIMALS, FRESH OR CHILLED BOVINE CARCASSES AND HALF-CARCASSES, FRESH OR CHILLED</ns1:value>
<ns1:type>string</ns1:type>
</ns1:listItemCodeSet>
<ns1:listItemCodeSet>
<ns1:key>START_DATE</ns1:key>
<ns1:value>2012-01-01T00:00:00.0</ns1:value>
<ns1:type>dateTime</ns1:type>
</ns1:listItemCodeSet>
<ns1:listItemCodeSet>
<ns1:key>END_DATE</ns1:key>
<ns1:value>null</ns1:value>
<ns1:type>dateTime</ns1:type>
</ns1:listItemCodeSet>
<ns1:listItemCodeSet>
<ns1:key>UPDATED_DATE</ns1:key>
<ns1:value>2017-12-08T18:31:50.833</ns1:value>
<ns1:type>dateTime</ns1:type>
</ns1:listItemCodeSet>
</ns1:listCodeSet>
...
Thanks & Regards
Adam.
Connect with Us