Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
Cannikinn #1
Returning XML with CFC call through URL
Hey peoples. What I'm doing is using JavsScript to call a CFC via a URL, and
this JavaScript can use XML that's returned and then do all kinds of neat stuff
(for anyone who's familiar with the term, I'm using this as part of an AJAX
implementation). Since I'm using a <cfreturn> in the CFC, it returns a WDDX
packet. Which is great, since it's XML, however there are dozens of blank
lines before the packet starts. As far as the JavaScript is concerned, I just
tried to return nothing. My guess is that the extra lines make the XML invalid
and JavaScript won't parse it. My CFC call is something like:
[url]http://www.mysite.com/components/general.cfm?method=getPrice&sku=1234[/url]
I've got whitespace management turned on in the Administrator, but it's not
cutting all of it out. Is there any way to get rid of this whitespace so
JavaScript will play nicely? In Flash there's a handy .ignoreWhite property
that would fix my problem lickety split!
I guess in the worst case senario I can run a RegEx on the returned text and
let JavaScript remove all of the extra white space, then parse what's left over
as XML, but I'd rather do it the "right" way. Thanks!
Cannikinn Guest
-
CFC Call Hanging on Second Call
I run the flex application localy using the demo/dev server and do a search using a CFC, and then do another and its fine. But when my boss tries,... -
connection_status() always returning 0
Dear all, My spec: RedHat 8.0 Apache 2.0.40 PHP 4.2.2 I used the following code: set_time_limit(0); -
Returning Dataset
I have been working on a .NET application architecture for a client for the past several months based on many of the patterns & practices described... -
Returning to a form
Hello I hope someone can help me. I have a form page a user needs to fill out. I want to be able to send the user back to the form once it is... -
remote call procedure call failed
Also, it says error 1726 "remote call procedure call failed" Help, Unable to save username and password in XP Home edition. It allows me to... -
Stressed_Simon #2
Re: Returning XML with CFC call through URL
Check out cfsilent and cfsetting:-
[url]http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/tags-pc6.htm#wp1103514[/url]
[url]http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/tags-pc7.htm#wp1103549[/url]
Stressed_Simon Guest
-
Cannikinn #3
Re: Returning XML with CFC call through URL
I thought of those, but how are you supposed to use those in a component or
application.cfc? I can't put <cfsilent> before the <cfcomponent> tag or else
it isn't a valid component anymore. If I put it after, then the actual
<cfcomponent> line itself causes a blank line.
Cannikinn Guest
-
Adam Cameron #4
Re: Returning XML with CFC call through URL
>I can't put <cfsilent> before the <cfcomponent> tag or else
You're not calling the component, though, are you? You're calling a> it isn't a valid component anymore.
*method* of the component. Make sure you've got output="false" on your
method, and consider using <cfcontent> to set the mime type of the returned
data to text/xml (or whatever the correct mime type for XML is... I'm
guessing at that).
--
Adam
Adam Cameron Guest
-
Cannikinn #5
Re: Returning XML with CFC call through URL
Hey, a fellow Cameron! I'm Rob Cameron. :)
You're right, I'm calling a method, but I think whitespace comes in even from
the Application.cfc page, and there's tons of whitespace all over that thing.
I ended up using a RegEx on the text that's returned by the call, seems to work
just as well. Plus I don't have to try and work my way through the XML tree,
just one long RegEx does it all. Thanks!
Cannikinn Guest



Reply With Quote

