Below is an XML file that I would like to parse and possibly store in a temp-table. What are my options? Should I define a dataset and use READ-XML? How would I define the prodataset?
- <GetCustomerPricingResponse xmlns="http://tempuri.org/" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
- <GetCustomerPricingResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<a:Errors><a:Errors />
<a:ResponseType>Success</a:ResponseType>
- <a:Result>
- <a:CustomerPrice>
- <a
ricing>
- <a
riceRecord>
<a
rice>123</a
rice>
<a:Quantity>1</a:Quantity>
<a:SiteId>0</a:SiteId>
</a
riceRecord>
- <a
riceRecord>
<a
rice>100</a
rice>
<a:Quantity>3</a:Quantity>
<a:SiteId>0</a:SiteId>
</a
riceRecord>
- <a
riceRecord>
<a
rice>143</a
rice>
<a:Quantity>1</a:Quantity>
<a:SiteId>1</a:SiteId>
</a
riceRecord>
- <a
riceRecord>
<a
rice>110</a
rice>
<a:Quantity>3</a:Quantity>
<a:SiteId>1</a:SiteId>
</a
riceRecord>
</a
ricing>
<a
roductId>10</a
roductId>
<a:Cono>2</a:Cono>
<a:CustomerId>12345</a:CustomerId>
</a:CustomerPrice>
</a:Result>
</GetCustomerPricingResult>
</GetCustomerPricingResponse>
I ran bprowsdldoc and got the following definitions:
<ns0:GetCustomerPricingResponse xmlns:ns0="http://tempuri.org/">
<!-- The following element is optional.
The following element may have the 'xsi:nil="true"` attribute (it is nillable). -->
<ns0:GetCustomerPricingResult>
<!-- The following element is optional.
The following element may have the 'xsi:nil="true"` attribute (it is nillable). -->
<ns1:Errors xmlns:ns1="http://schemas.datacontract.org/2004/07/CICWebservices.Common">
<!-- The following element may occur 0 or more times.
The following element may have the 'xsi:nil="true"` attribute (it is nillable). -->
<ns1:Error>
<!-- The following element is optional.
The following element may have the 'xsi:nil="true"` attribute (it is nillable). -->
<ns1:Message>string-value</ns1:Message>
<!-- The following element is optional. -->
<!-- This element must contain one of the following values:
Informational
Warning
Error -->
<ns1:Type>string-value</ns1:Type>
</ns1:Error>
</ns1:Errors>
<!-- The following element is optional. -->
<!-- This element must contain one of the following values:
Failure
Warning
Success -->
<ns1:ResponseType>string-value</ns1:ResponseType>
<!-- The following element is optional.
The following element may have the 'xsi:nil="true"` attribute (it is nillable). -->
<ns1:Result>
<!-- The following element may occur 0 or more times.
The following element may have the 'xsi:nil="true"` attribute (it is nillable). -->
<ns1:CustomerPrice>
<!-- The following element is optional.
The following element may have the 'xsi:nil="true"` attribute (it is nillable). -->
<ns1
ricing>
<!-- The following element may occur 0 or more times.
The following element may have the 'xsi:nil="true"` attribute (it is nillable). -->
<ns1
riceRecord>
<!-- The following element is optional. -->
<ns1
rice>double-value</ns1
rice>
<!-- The following element is optional. -->
<ns1:Quantity>int-value</ns1:Quantity>
<!-- The following element is optional. -->
<ns1:SiteId>int-value</ns1:SiteId>
</ns1
riceRecord>
</ns1
ricing>
<!-- The following element is optional. -->
<ns1
roductId>int-value</ns1
roductId>
<!-- The following element is optional. -->
<ns1:Cono>int-value</ns1:Cono>
<!-- The following element is optional. -->
<ns1:CustomerId>int-value</ns1:CustomerId>
</ns1:CustomerPrice>
</ns1:Result>
</ns0:GetCustomerPricingResult>
</ns0:GetCustomerPricingResponse>
Lastly, I do not have the XML schema (.xsd) so I cannot run bproxsdto4gl. Your help is appreciated.
- <GetCustomerPricingResponse xmlns="http://tempuri.org/" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
- <GetCustomerPricingResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<a:Errors><a:Errors />
<a:ResponseType>Success</a:ResponseType>
- <a:Result>
- <a:CustomerPrice>
- <a
- <a
<a
<a:Quantity>1</a:Quantity>
<a:SiteId>0</a:SiteId>
</a
- <a
<a
<a:Quantity>3</a:Quantity>
<a:SiteId>0</a:SiteId>
</a
- <a
<a
<a:Quantity>1</a:Quantity>
<a:SiteId>1</a:SiteId>
</a
- <a
<a
<a:Quantity>3</a:Quantity>
<a:SiteId>1</a:SiteId>
</a
</a
<a
<a:Cono>2</a:Cono>
<a:CustomerId>12345</a:CustomerId>
</a:CustomerPrice>
</a:Result>
</GetCustomerPricingResult>
</GetCustomerPricingResponse>
I ran bprowsdldoc and got the following definitions:
<ns0:GetCustomerPricingResponse xmlns:ns0="http://tempuri.org/">
<!-- The following element is optional.
The following element may have the 'xsi:nil="true"` attribute (it is nillable). -->
<ns0:GetCustomerPricingResult>
<!-- The following element is optional.
The following element may have the 'xsi:nil="true"` attribute (it is nillable). -->
<ns1:Errors xmlns:ns1="http://schemas.datacontract.org/2004/07/CICWebservices.Common">
<!-- The following element may occur 0 or more times.
The following element may have the 'xsi:nil="true"` attribute (it is nillable). -->
<ns1:Error>
<!-- The following element is optional.
The following element may have the 'xsi:nil="true"` attribute (it is nillable). -->
<ns1:Message>string-value</ns1:Message>
<!-- The following element is optional. -->
<!-- This element must contain one of the following values:
Informational
Warning
Error -->
<ns1:Type>string-value</ns1:Type>
</ns1:Error>
</ns1:Errors>
<!-- The following element is optional. -->
<!-- This element must contain one of the following values:
Failure
Warning
Success -->
<ns1:ResponseType>string-value</ns1:ResponseType>
<!-- The following element is optional.
The following element may have the 'xsi:nil="true"` attribute (it is nillable). -->
<ns1:Result>
<!-- The following element may occur 0 or more times.
The following element may have the 'xsi:nil="true"` attribute (it is nillable). -->
<ns1:CustomerPrice>
<!-- The following element is optional.
The following element may have the 'xsi:nil="true"` attribute (it is nillable). -->
<ns1
<!-- The following element may occur 0 or more times.
The following element may have the 'xsi:nil="true"` attribute (it is nillable). -->
<ns1
<!-- The following element is optional. -->
<ns1
<!-- The following element is optional. -->
<ns1:Quantity>int-value</ns1:Quantity>
<!-- The following element is optional. -->
<ns1:SiteId>int-value</ns1:SiteId>
</ns1
</ns1
<!-- The following element is optional. -->
<ns1
<!-- The following element is optional. -->
<ns1:Cono>int-value</ns1:Cono>
<!-- The following element is optional. -->
<ns1:CustomerId>int-value</ns1:CustomerId>
</ns1:CustomerPrice>
</ns1:Result>
</ns0:GetCustomerPricingResult>
</ns0:GetCustomerPricingResponse>
Lastly, I do not have the XML schema (.xsd) so I cannot run bproxsdto4gl. Your help is appreciated.