This is a multi-part message in MIME format.
------=_NextPart_000_016A_01C01D81.9A9BC3A0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Re: CFHTTP, CFWDDX, cflock'ing it - cfcatch'in and cftry'ing.You can
certainly pickup a WDDX packet as cfhttp.filecontent, if the generating page
outputs it as content. The problem is that you have to strip all the
whitespace, carriage returns and other extraneous stuff off of it before you
attempt to use the resulting WDDX packet. While I am sure that someone has
a high-speed, low-drag RegEx for doing this, I have found that this code
will strip all out everything, leaving only a properly constructed WDDX
packet:
<cfhttp url="http://127.0.0.1/somewddx_generator.cfm" method="GET"
resolveurl="false">
</cfhttp>
<cfif findnocase("<wddx",cfhttp.filecontent)>
<cfset wddxstart=findnocase("<wddx",cfhttp.filecontent)>
<cfset wddxend=findnocase("</wddxPacket>",cfhttp.filecontent)>
<cfset wddxend=wddxend+14>
<cfset stringcount=wddxend-wddxstart>
<cfset mywddx=mid(cfhttp.filecontent,wddxstart,stringcount)>
<cfelse>
No WDDX found
</cfif>
-------------------
David E. Crawford
Director, Internet Development
Yale Security Group, Inc.
-----Original Message-----
From: Bud [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 12, 2000 18:37
To: [EMAIL PROTECTED]
Subject: Re: CFHTTP, CFWDDX, cflock'ing it - cfcatch'in and cftry'ing.
On 9/12/00, Ben Lowndes penned:
>I'm using CFHTTP to hit a page that produces WDDX, then trying to
>deserialise the wddx.
<snip>
><CFWDDX action="WDDX2CFML" input="#CFHTTP.FileContent#"
>output="RequestResult">
I may be wrong here. I'm on a roll with wrong answers lately. LOL
I'm not sure you CAN pick up a wddx packet as filecontent.
I just did a little test and I get XML errors and unknown element
found errors whenever I try and pick up any WDDX that is any kind of
complex structure like a query.
If I do the WDDX2CFML on the remote page then output that, it's fine.
If it's a page that people also access straightaway, then you could
output inside of html comment tags then strip out that part of the
cfhttp.filecontent. Of course, hopefully you have access to edit the
remote page to suit your needs.
This is my remote test page.
<cfset newquery = QueryNew("cell")>
<cfset temp = QueryAddRow(newquery)>
<cfset temp = QuerySetCell(newquery, "cell", test1)>
<cfset temp = QueryAddRow(newquery)>
<cfset temp = QuerySetCell(newquery, "cell", test2)>
<CFWDDX action="CFML2WDDX" input="#newquery#" output="content">
<CFWDDX action="WDDX2CFML" input="#content#" output="testquery">
<!--Start<CFOUTPUT query="testquery">#cell#<br></CFOUTPUT>End-->
This is the calling page:
<cfhttp url="http://192.168.0.5/testing/wddx/test.cfm" method="POST">
<cfhttpparam type="formfield" name="test1" value="This is row 1">
<cfhttpparam type="formfield" name="test2" value="This is row 2">
</cfhttp>
<cfset start = find("<!--Start", cfhttp.filecontent) + 9>
<cfset end = find("End-->", cfhttp.filecontent)>
<cfset length = end - start>
<CFOUTPUT>#mid(cfhttp.filecontent, start, length)#</CFOUTPUT>
This is what I see in the browser:
This is row 1
This is row 2
--
Bud Schneehagen - Tropical Web Creations
_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
ColdFusion Solutions / eCommerce Development
[EMAIL PROTECTED]
http://www.twcreations.com/
954.721.3452
--------------------------------------------------------------------------
----
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
------=_NextPart_000_016A_01C01D81.9A9BC3A0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Re: CFHTTP, CFWDDX, cflock'ing it - cfcatch'in and =
cftry'ing.</TITLE>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.3018.900" name=3DGENERATOR></HEAD>
<BODY>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN =
class=3D700464912-13092000>You=20
can certainly pickup a WDDX packet as cfhttp.filecontent, if the =
generating page=20
outputs it as content. The problem is that you have to strip all =
the=20
whitespace, carriage returns and other extraneous stuff off of it before =
you=20
attempt to use the resulting WDDX packet. While I am sure that =
someone has=20
a high-speed, low-drag RegEx for doing this, I have found that this =
code=20
will strip all out everything, leaving only a properly constructed WDDX=20
packet:</SPAN></FONT></DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN=20
class=3D700464912-13092000></SPAN></FONT> </DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN=20
class=3D700464912-13092000><cfhttp=20
url=3D"http://127.0.0.1/somewddx_generator.cfm" method=3D"GET"=20
resolveurl=3D"false"><BR></cfhttp><BR><cfif=20
findnocase("<wddx",cfhttp.filecontent)><BR><cfset=20
wddxstart=3Dfindnocase("<wddx",cfhttp.filecontent)><BR><cfset=20
wddxend=3Dfindnocase("</wddxPacket>",cfhttp.filecontent)><BR><=
;cfset=20
wddxend=3Dwddxend+14><BR><cfset=20
stringcount=3Dwddxend-wddxstart><BR><cfset=20
mywddx=3Dmid(cfhttp.filecontent,wddxstart,stringcount)></SPAN></FONT><=
/DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN=20
class=3D700464912-13092000><cfelse></SPAN></FONT></DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN=20
class=3D700464912-13092000> No WDDX =
found</SPAN></FONT></DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN=20
class=3D700464912-13092000></cfif></SPAN></FONT></DIV>
<DIV><FONT color=3D#0000ff face=3DArial size=3D2><SPAN=20
class=3D700464912-13092000></SPAN></FONT> </DIV>
<DIV>
<P><FONT size=3D2>-------------------<BR>David E. Crawford<BR>Director, =
Internet=20
Development<BR>Yale Security Group, Inc. </FONT></P></DIV>
<BLOCKQUOTE style=3D"MARGIN-RIGHT: 0px">
<DIV align=3Dleft class=3DOutlookMessageHeader dir=3Dltr><FONT =
face=3DTahoma=20
size=3D2>-----Original Message-----<BR><B>From:</B> Bud=20
[mailto:[EMAIL PROTECTED]]<BR><B>Sent:</B> Tuesday, September =
12,=20
2000 18:37<BR><B>To:</B> [EMAIL PROTECTED]<BR><B>Subject:</B> =
Re:=20
CFHTTP, CFWDDX, cflock'ing it - cfcatch'in and =
cftry'ing.<BR><BR></DIV></FONT>
<P><FONT size=3D2>On 9/12/00, Ben Lowndes penned:</FONT> <BR><FONT=20
size=3D2>>I'm using CFHTTP to hit a page that produces WDDX, then =
trying=20
to</FONT> <BR><FONT size=3D2>>deserialise the wddx.</FONT> </P>
<P><FONT size=3D2><snip></FONT> </P>
<P><FONT size=3D2>><CFWDDX action=3D"WDDX2CFML"=20
input=3D"#CFHTTP.FileContent#"</FONT> <BR><FONT=20
size=3D2>>output=3D"RequestResult"></FONT> </P>
<P><FONT size=3D2>I may be wrong here. I'm on a roll with wrong =
answers lately.=20
LOL</FONT> </P>
<P><FONT size=3D2>I'm not sure you CAN pick up a wddx packet as=20
filecontent.</FONT> </P>
<P><FONT size=3D2>I just did a little test and I get XML errors and =
unknown=20
element </FONT><BR><FONT size=3D2>found errors whenever I try and pick =
up any=20
WDDX that is any kind of </FONT><BR><FONT size=3D2>complex structure =
like a=20
query.</FONT> </P>
<P><FONT size=3D2>If I do the WDDX2CFML on the remote page then output =
that,=20
it's fine. </FONT><BR><FONT size=3D2>If it's a page that people also =
access=20
straightaway, then you could </FONT><BR><FONT size=3D2>output inside =
of html=20
comment tags then strip out that part of the </FONT><BR><FONT=20
size=3D2>cfhttp.filecontent. Of course, hopefully you have access to =
edit the=20
</FONT><BR><FONT size=3D2>remote page to suit your needs.</FONT> </P>
<P><FONT size=3D2>This is my remote test page.</FONT> </P>
<P><FONT size=3D2><cfset newquery =3D QueryNew("cell")></FONT> =
<BR><FONT=20
size=3D2><cfset temp =3D QueryAddRow(newquery)></FONT> <BR><FONT =
size=3D2><cfset temp =3D QuerySetCell(newquery, "cell", =
test1)></FONT>=20
<BR><FONT size=3D2><cfset temp =3D QueryAddRow(newquery)></FONT> =
<BR><FONT=20
size=3D2><cfset temp =3D QuerySetCell(newquery, "cell", =
test2)></FONT>=20
<BR><FONT size=3D2><CFWDDX action=3D"CFML2WDDX" =
input=3D"#newquery#"=20
output=3D"content"></FONT> <BR><FONT size=3D2><CFWDDX =
action=3D"WDDX2CFML"=20
input=3D"#content#" output=3D"testquery"></FONT> </P>
<P><FONT size=3D2><!--Start<CFOUTPUT=20
=
query=3D"testquery">#cell#<br></CFOUTPUT>End--></FONT> =
</P>
<P><FONT size=3D2>This is the calling page:</FONT> </P>
<P><FONT size=3D2><cfhttp url=3D"<A=20
href=3D"http://192.168.0.5/testing/wddx/test.cfm"=20
target=3D_blank>http://192.168.0.5/testing/wddx/test.cfm</A>"=20
method=3D"POST"></FONT> <BR><FONT size=3D2><cfhttpparam =
type=3D"formfield"=20
name=3D"test1" value=3D"This is row 1"></FONT> <BR><FONT =
size=3D2><cfhttpparam=20
type=3D"formfield" name=3D"test2" value=3D"This is row 2"></FONT> =
<BR><FONT=20
size=3D2></cfhttp></FONT> </P>
<P><FONT size=3D2><cfset start =3D find("<!--Start", =
cfhttp.filecontent) +=20
9></FONT> <BR><FONT size=3D2><cfset end =3D find("End-->",=20
cfhttp.filecontent)></FONT> <BR><FONT size=3D2><cfset length =3D =
end -=20
start></FONT> <BR><FONT =
size=3D2><CFOUTPUT>#mid(cfhttp.filecontent,=20
start, length)#</CFOUTPUT></FONT> </P>
<P><FONT size=3D2>This is what I see in the browser:</FONT> </P>
<P><FONT size=3D2>This is row 1</FONT> <BR><FONT size=3D2>This is row =
2</FONT>=20
<BR><FONT size=3D2>-- </FONT></P>
<P><FONT size=3D2>Bud Schneehagen - Tropical Web Creations</FONT> </P>
<P><FONT size=3D2>_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/</FONT> =
<BR><FONT=20
size=3D2>ColdFusion Solutions / eCommerce Development</FONT> <BR><FONT =
size=3D2>[EMAIL PROTECTED]</FONT> <BR><FONT size=3D2><A=20
href=3D"http://www.twcreations.com/"=20
target=3D_blank>http://www.twcreations.com/</A></FONT> <BR><FONT=20
size=3D2>954.721.3452</FONT> <BR><FONT=20
=
size=3D2>----------------------------------------------------------------=
--------------</FONT>=20
<BR><FONT size=3D2>Archives: <A=20
href=3D"http://www.mail-archive.com/[email protected]/"=20
=
target=3D_blank>http://www.mail-archive.com/[email protected]/</A=
></FONT>=20
<BR><FONT size=3D2>To Unsubscribe visit <A=20
=
href=3D"http://www.houseoffusion.com/index.cfm?sidebar=3Dlists&body=3D=
lists/cf_talk"=20
=
target=3D_blank>http://www.houseoffusion.com/index.cfm?sidebar=3Dlists&am=
p;body=3Dlists/cf_talk</A>=20
or send a message to [EMAIL PROTECTED] with =
'unsubscribe' in=20
the body.</FONT></P></BLOCKQUOTE></BODY></HTML>
------=_NextPart_000_016A_01C01D81.9A9BC3A0--
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.