> I'm using <CFHTTP> to post a xml request to a USPS testing 
> server, which runs a compiled program to return some XML 
> as a response. I'd like to take the response and convert 
> part of it into a CF variable that I can then do things 
> with in CF.
> 
> The request I'm running through CF looks like this:
> 
> <CFHTTP method="POST" 
> url="http://testing.shippingapis.com/ShippingAPITest.dll"; 
> resolveurl="yes">
> <CFHTTPPARAM name="API"  type="FORMFIELD" value="Rate">
> <CFHTTPPARAM name="xml"  type="FORMFIELD" value="#XMLRequest#">
> </CFHTTP>
> 
> When I try to display the result using <CFOUTPUT> and 
> #cfhttp.FileContent#, I get the following error:
> 
> The requested file is not ASCII text and can not be rendered.
> 
> Additionally, when I check the statuscode on the request, I 
> get the following:
> 200 Success
> 
> mime type:
> Unable to determine MIME type of file
> 
> Does anyone have any ideas on how to solve this problem? If 
> I could just get CF to ingest the response information, I 
> can move on to trying to parse it using regular expressions.
> 
> Thanks for any and all suggestions!

First, I'd suggest that you confirm that the remote server is actually
returning something useful. You can do that by sending a request manually
using telnet, netcat or the like, or by using a packet sniffer or recording
proxy between your CF server and the remote server.

Second, if it is returning valid data, it should also return a MIME type. If
CF doesn't know the MIME type, I wouldn't be surprised if it simply doesn't
try to render the data as a string. In that case, you could save the
response to the filesystem, then open it with CFFILE and do what you like.
If it's returning XML, and you're using CFMX, you can use the built-in XML
parser rather than doing all the parsing work yourself.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq

Host with the leader in ColdFusion hosting. 
Voted #1 ColdFusion host by CF Developers. 
Offering shared and dedicated hosting options. 
www.cfxhosting.com/default.cfm?redirect=10481

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to