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

Re: Buffer size?



Hi David,

I don't really understand your scenario.

As a one-time diagnostic, can you replace your call to http_url_post_xml 
with a call to http_url_post so it will save the actual document to disk 
instead of parsing it?  Then, post the document here so we can see what 
it looks like.

It's fairly commonplace for a web site to send a response in a SOAP 
element, and have one of the parameters in the SOAP (often the ONLY 
parmaeter in the SOAP) contain a separate XML document as a payload.  If 
that's the situation you are encountering, then you need to parse the 
XML twice -- once to get the XML payload out of the SOAP document, and 
again to get the data from the embedded XML.

But, you also say that Expat isn't handling CDATA, and that's a new one 
for me...  and makes me worry that there's something else wrong. It 
would be much easier to help you if I had a clear idea of what you are 
being sent.

-SK



On 2/2/2012 11:33 AM, David Baugh wrote:
> Scott, Mike(LOL that was funny!) thanks for staying with me...
>
> I have some more information which goes some way to explain my confusion with what I was seeing.
>
> You guessed right Mike this is a feed of valuation data for an insured location, so it does contain a huge amount of data related to its insurability.
>
> I was using the %str function as a quick and dirty way to verify that the data at the given address was something like what I expected to see (for debugging purposes). Part of my original confusion lay in not knowing the limitations of the debugger (being 1024), even though I knew I wouldn't be getting all the data in the string variable. I'm not comfortable with pointers, but in view of what I saw in my log, and in the variable I was using, it appeared as though the buffer contained a lot of attributes that needed parsing out of a huge element(s). This was confusing since I had expected to see values in the Attrs array, but there are none.
>
> This huge string begins with an element containing header information in the form of a large number of attributes, which extend beyond 1024 bytes.
>
> <CONTEXT>  <RESIDENTIAL_REPORT createdByLabel="Created By"
>   enteredByFirstName="xxxxx" enteredByLastName="Underwriter"
> valuationType="7" schemaVersion="20110115" valuati
> onId="xxxxxx" recalculated="0" hasMinimalPushPinInfo="1" pr
> iceListName="xxxxxxx" htmlWindowTitle="xxxxxxxxx" seismicZone="4" iteration="1"
>   ownerLastName="Underwriter" locale="en_US" localeCountry="U
> S" enteredByName="xxxxxxxxxxxx" ownerFirstName="xxx" companyName="xxxxxx" enteredById="xxxxx" etc., etc.
>
> There lay part of the confusion.. why weren't these attributes loaded into the attr array? I missed the fact that there's a<CONTEXT>  tag right there, which should have been a red flag....
>
> I've since revisited the wsdl in Soapui. Discovered that the whole thing is embedded in CDATA, which magically disappeared both in the log and the data in my val variable. Ugh !
>
> So two questions to put out there to anyone with experience..
>
> 1. How to parse XML when CDATA is being used, since the parser won't like it, and
> 2. How best to get to the data in the event I end up needing to use pointers.
>
>
> Thanks all for the great advice!
>
> -----------------------------------------------------------------------
> 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
-----------------------------------------------------------------------