[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Parsing error



Hi,
I did send an email to the company that we are consuming the webservice from and this was the response I received back:

The use of a robust XML Document Object Model (DOM) is advised in XML calling API's. Home grown parsers do not often permit otherwise "allowable" xml variations. It is recommended that you deploy a parser that supports the XML Document Object Model (DOM). The DOM defines a standard set of commands that parsers should expose so you can access HTML and XML document content from your programs. An XML parser that supports the DOM will take the data in an XML document and expose it via a set of objects that you can program against. This is probably a setup in your SOAP environment.

Do you know what they are trying to tell me?

Thanks
Laura

-----Original Message-----
From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Scott Klement
Sent: Sunday, October 21, 2012 6:02 PM
To: HTTPAPI and FTPAPI Projects
Subject: Re: Parsing error

Hi Laura,

Yes, this would work -- you could save it to the IFS (by calling http_url_post instead of http_url_post_xml) and change the IFS file.  
Then you can parse it with http_parse_xml_stmf() and it can call the same routine(s) you are using for parsing with post_xml.

However, I would also contact whomever generated the XML.  The & character has a special meaning in XML, and should not be provided "bare" in an XML document.  I don't know of any XML parser that would parse the document the way it's coded, so I would let whomever is generating it know about the bug, and ask them to fix it.

-SK



On 10/21/2012 1:37 PM, Laura Hamway (PHOENIX) wrote:
> I can't alter the response xml, so would I save the response to the IFS and then I would have to replace the & with &amp and then parse it?
>
> -----Original Message-----
> From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Steven Molinaro
> Sent: Friday, October 19, 2012 9:27 PM
> To: HTTPAPI and FTPAPI Projects
> Subject: RE: Parsing error
>
> I think it needs to be encoded as & before it is inserted into the response.
>
> -----Original Message-----
> From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Laura Hamway (PHOENIX)
> Sent: Friday, October 19, 2012 8:35 PM
> To: HTTPAPI and FTPAPI Projects
> Subject: Parsing error
>
>
> I am using the http_url_post_xml and parsing the xml response.  I get an error when a "&" is encountered.  Is there a way to get around this so the process doesn't just error out and stop?  The error is on line 45.
>
> Below is the return xml:
> <GetTaxResult>
> <DocCode>9202012</DocCode>
> <DocDate>2012-09-21</DocDate>
> <Timestamp>2012-10-20T00:16:47.2354009Z</Timestamp>
> <TotalAmount>1311</TotalAmount>
> <TotalDiscount>0</TotalDiscount>
> <TotalExemption>0</TotalExemption>
> <TotalTaxable>1311</TotalTaxable>
> <TotalTax>62.28</TotalTax>
> <TotalTaxCalculated>62.28</TotalTaxCalculated>
> <TaxDate>2012-09-21</TaxDate>
> <TaxLines><TaxLine><LineNo>1</LineNo>
> <TaxCode>P0000000</TaxCode>
> <Taxability>true</Taxability>
> <Taxable>696</Taxable>
> <Rate>0.047500</Rate>
> <Tax>33.06</Tax>
> <Discount>0</Discount>
> <TaxCalculated>33.06</TaxCalculated>
> <Exemption>0</Exemption>
> <TaxDetails><TaxDetail><Country>US</Country>
> <Region>CO</Region>
> <JurisType>State</JurisType>
> <Taxable>696</Taxable>
> <Rate>0.029000</Rate>
> <Tax>20.18</Tax>
> <JurisName>COLORADO</JurisName>
> <TaxName>CO STATE TAX</TaxName>
> </TaxDetail>
> <TaxDetail><Country>US</Country>
> <Region>CO</Region>
> <JurisType>County</JurisType>
> <Taxable>696</Taxable>
> <Rate>0.007500</Rate>
> <Tax>5.22</Tax>
> <JurisName>ADAMS</JurisName>
> <TaxName>CO COUNTY TAX</TaxName>
> </TaxDetail>
> <TaxDetail><Country>US</Country>
> <Region>CO</Region>
> <JurisType>Special</JurisType>
> <Taxable>696</Taxable>
> <Rate>0.001000</Rate>
> <Tax>0.7</Tax>
> <JurisName>SCIENTIFIC & CULTURAL FAC.(CD)</JurisName> <TaxName>CO SPECIAL TAX</TaxName> </TaxDetail> <TaxDetail><Country>US</Country> <Region>CO</Region> <JurisType>Special</JurisType> <Taxable>696</Taxable> <Rate>0.010000</Rate> <Tax>6.96</Tax> <JurisName>RTD GREATER DENVER</JurisName> <TaxName>CO SPECIAL TAX</TaxName> </TaxDetail> </TaxDetails> </TaxLine> <TaxLine><LineNo>2</LineNo> <TaxCode>P0000000</TaxCode> <Taxability>true</Taxability> <Taxable>615</Taxable> <Rate>0.047500</Rate> <Tax>29.22</Tax> <Discount>0</Discount> <TaxCalculated>29.22</TaxCalculated>
> <Exemption>0</Exemption>
> <TaxDetails><TaxDetail><Country>US</Country>
> <Region>CO</Region>
> <JurisType>State</JurisType>
> <Taxable>615</Taxable>
> <Rate>0.029000</Rate>
> <Tax>17.84</Tax>
> <JurisName>COLORADO</JurisName>
> <TaxName>CO STATE TAX</TaxName>
> </TaxDetail>
> <TaxDetail><Country>US</Country>
> <Region>CO</Region>
> <JurisType>County</JurisType>
> <Taxable>615</Taxable>
> <Rate>0.007500</Rate>
> <Tax>4.61</Tax>
> <JurisName>ADAMS</JurisName>
> <TaxName>CO COUNTY TAX</TaxName>
> </TaxDetail>
> <TaxDetail><Country>US</Country>
> <Region>CO</Region>
> <JurisType>Special</JurisType>
> <Taxable>615</Taxable>
> <Rate>0.001000</Rate>
> <Tax>0.62</Tax>
> <JurisName>SCIENTIFIC & CULTURAL FAC.(CD)</JurisName> <TaxName>CO SPECIAL TAX</TaxName> </TaxDetail> <TaxDetail><Country>US</Country> <Region>CO</Region> <JurisType>Special</JurisType> <Taxable>615</Taxable> <Rate>0.010000</Rate> <Tax>6.15</Tax> <JurisName>RTD GREATER DENVER</JurisName> <TaxName>CO SPECIAL TAX</TaxName> </TaxDetail> </TaxDetails> </TaxLine> </TaxLines>
> <TaxAddresses><TaxAddress><Address>7462 KEARNEY ST</Address> <AddressCode>1</AddressCode> <City>COMMERCE CITY</City> <Country>US</Country> <PostalCode>80022-1335</PostalCode>
> <Region>CO</Region>
> <TaxRegionId>2114686</TaxRegionId>
> <JurisCode>0800100000</JurisCode>
> </TaxAddress>
> </TaxAddresses>
> <ResultCode>Success</ResultCode>
> </GetTaxResult>
>
> Laura Hamway
> 757-754-1334
> www.phoenixbcinc.com
>
>
> -----------------------------------------------------------------------
> This is the FTPAPI mailing list.  To unsubscribe, please go to:
> http://www.scottklement.com/mailman/listinfo/ftpapi
> -----------------------------------------------------------------------
> -----------------------------------------------------------------------
> This is the FTPAPI mailing list.  To unsubscribe, please go to:
> http://www.scottklement.com/mailman/listinfo/ftpapi
> -----------------------------------------------------------------------
>

-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------