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

RE: Looking for best option



Hi Scott,

I was viewing the value after it has been through the parser so now it make
sense why < and > had been converted.

I don't see any characters that are not in the base64 alphabet.  

Sorry I missed the return value on the base64_decode().  In this case it is
returning the same value as what is in the <IMAGESIZE> tag but I will change
my code to use the value returned from base64_decode().

I've attached the response from the soap call and the debug log.

Thanks again,
Bruce

-----Original Message-----
From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
[mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Scott Klement
Sent: Tuesday, January 06, 2009 5:16 PM
To: HTTPAPI and FTPAPI Projects
Subject: Re: Looking for best option

Bruce,

> THE <BASE64DATA> tag is not encoded.  When I view the data returned 
> for the GetImageDataResult tag it has <BASE64DATA> rather than 
> &lt;BASE64DATA&gt; which surprised me that the parser didn't parse it out.

If that were really the case, the parser WOULD parse it out, believe me it
would.  HOWEVER... the XML parser *will* convert the &lt; to < and the &gt;
to >.  So if you're checking this by looking at the 'value' 
parameter that's passed to your end handler, then indeed it will look like
<BASE64DATA>

That's why I asked you to check it in the httpapi_debug.txt file, and NOT in
the value parameter. :)

> Right now I am just trying to get a good image so the 64k is not a
problem.
> Once I get everything working I will use the HTTP_XmlReturnPtr() and 
> add error logic as you suggest.

That's fine as long as your tests use images smaller than 64k.  I just want
to make sure the diff between working and failing in your tests don't come
from the image being chopped up.

> I changed val2 to be a fixed length for now and below are the changes 
> to the procedure.  I added a scan for x'0D' and x'25' and put the 
> program into debug for testing and I didn't find any.

Hopefully you get the idea.  Any characters that aren't in the base64
alphabet (A-Z a-z 0-9 + / =) need to be removed.  x'0D' and x'25' were just
likely examples... you need to remove everything besides the base64
alphabet.

> I had overlooked the point you made in (D).  There is tag 
> <IMAGESIZE>8908</IMAGESIZE> which I should be able to use to determine 
> the output length.

Once again...  base64_decode() will RETURN the output length.  You don't
need to go to the extent of parsing the XML for it.  Just do:

    len = base64_decode( ... parameters here ...);


If that doesn't help, please call the service with http_url_post() (instead
of POST_XML) and send me the XML document you get from your provider.  (Send
it to me off-list if it contains sensitive information).  That would make it
a lot easier for me to help you.

-----------------------------------------------------------------------
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
-----------------------------------------------------------------------