I'm no PHP guy...but cfhttp is one of the most glaring weaknesses of
CF. Sounds like PHP is similar to Java in the sense of http being
extremely complicated though. That's why http objects exist...

http://php.resourceindex.com/Functions_and_Classes/Clients_and_Servers/HTTP/

-- 
 jon
 mailto:[EMAIL PROTECTED]

Thursday, April 3, 2003, 4:48:32 PM, you wrote:
HM> Alright, I am letting off a little steam here. It has been a long week, and
HM> Friday is still hours away.

HM> Coldfusion is king among dynamic Web technologies. Period. It is easy to use
HM> and does not require you to build an API every time you want to do
HM> something. I have known this for a long time, but sometimes I am forced to
HM> prove this fact via a practical demonstration (in much the same way as a
HM> gibbering idiot sometimes proves he cannot pound railroad spikes into
HM> concrete walls with his own forehead).

HM> I have a project where we need a low-cost data feed technology to distribute
HM> to regional offices. What will happen is the contents of a database will be
HM> thrown into a WDDX packet, which will be downloaded via a Web server to the
HM> central office. The data can be anything, but the transport protocol must be
HM> http. And the technology must already be installed or else freely available,
HM> meaning we can will use PHP, Perl or ASP.

HM> So I get to learn how to automatically post variables to a Web server in PHP
HM> and return the content.

HM> To do the following in CF: 

HM> <cfset login = structNew()>
HM> <cfset login.name = "someuser">
HM> <cfset login.pass = "somepass">
HM> <cfset login.call = "somecall">
HM> <cfwddx input="#login#" output="WXDDlogin" action="CFML2WDDX">
HM> <cfhttp url="http://www.somewhere.org/wddx_output.cfm"; method="POST"
HM> resolveurl="true" throwonerror="no">
HM>     <cfhttpparam name="login" value="#WXDDlogin#" type="FORMFIELD">
HM> </cfhttp>
HM> <cfwddx input="#cfhttp.fileContent#" output="data" action="WDDX2CFML">

HM> ...is insanely difficult to do in PHP.

HM> First off, their file system functions are restricted to local operations,
HM> meaning you have to connect to their server via a socket connection. Once
HM> that connection is open, you have to write the F***ING headers yourself to
HM> GET and POST data, which is not easy considering you have to write one for
HM> each and every piece of data you wish to post. The resulting content is not
HM> a WDDX packet, it is a raw HTTP packet which you then get to strip via regex
HM> functions. Then, if you are lucky and everything worked the way it was
HM> supposed to, you have a WDDX packet you can deserialize and start using. If
HM> you are unlucky and something goes wrong, poor you because the debug
HM> information is sparse at best.

HM> Now, this would not be such a big deal were it not for the nearly complete
HM> lack of information on how to do this. In the time it has taken me to figure
HM> out the steps in the code I could have rewritten the Bible. I have endured
HM> millions of pop-up ads going through 'tutorial' sites for info on how to
HM> make this work. I have posted dozens of questions to PHP lists and for each
HM> one received at least 10 responses from people who either didn't understand
HM> the question or think asking 'Why would you want to do that?' is an answer.

HM> I could go on, but the problem is now solved and the data client is now in
HM> place. At least I won't have to learn how to do this again. I built out all
HM> the functions into a class library, and now have the equivalent of CFHTTP in
HM> PHP to use on further development.

HM> It only took me about a week to complete a simple task that would have taken
HM> 15 minutes to set up in CF.

HM> Praise the king.

HM> M










 
HM> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=5
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=5
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.

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

Reply via email to