The default for the return format for a remote cffunction call is WDDX.
Sounds like inside your CFC you are serializing the return value first.

So something like return serializeJson(myValue);

If the return "string" in this case is JSON, then your remote call to the
CFC should include a returnformat=plain, to return the string as is.

Byron Mann
Lead Engineer & Architect
HostMySite.com


On Fri, Mar 14, 2014 at 3:26 PM, Rixon Reed <[email protected]> wrote:

>
> I have a CFC that I'm trying to return JSON data in a web service.=20
> If I do a dump before I return the code to the calling program, the JSON
> is=
> fine. However it returns this to the calling program:"[\"\\n\\t\\n\\t\\t\\=
>
> n\\t\\t\\n\\t\\t\\n\\t\\t\\n\\t\\t\\n\\t\\t\\n\\t\\t\\n\\t\\t\\n\\t\\t\\n\\=
>
> t\\t\\n\\t\\t\\n\\t\\t\\n\\t<\\\/portfolio>\\n\\t\\n\\t\\t\\n\\t\\t\\n\\t\\=
>
> t\\n\\t\\t\\n\\t\\t\\n\\t\\t\\n\\t\\t\\n\\t\\t\\n\\t\\t\\n\\t<\\\/portfolio=
> \\n\\t\\n\\t\\t\\n\\t\\t\\n\\t\\t\\n\\t\\t\\n\\t<\\\/portfolio>\\n\\t\\n\\=
>
> t\\t\\n\\t\\t\\n\\t<\\\/portfolio>\\n\\t\\n\\t\\t\\n\\t\\t\\n\\t\\t\\n\\t\\=
>
> t\\n\\t\\t\\n\\t\\t\\n\\t\\t\\n\\t\\t\\n\\t\\t\\n\\t<\\\/portfolio>\\n\\t\\=
>
> n\\t\\t\\n\\t\\t\\n\\t\\t\\n\\t\\t\\n\\t\\t\\n\\t\\t\\n\\t\\t\\n\\t\\t\\n\\=
>
> t\\t\\n\\t\\t\\n\\t\\t\\n\\t\\t\\n\\t\\t\\n\\t\\t\\n\\t\\t\\n\\t\\t\\n\\t\\=
>
> t\\n\\t\\t\\n\\t\\t\\n\\t\\t\\n\\t\\t\\n\\t\\t\\n\\t\\t\\n\\t\\t\\n\\t\\t\\=
>
> n\\t<\\\/portfolio>\\n\\t\\n\\t\\t\\n\\t\\t\\n\\t\\t\\n\\t\\t\\n\\t\\t\\n\\=
>
> t<\\\/portfolio>\\n\\t\\n\\t\\t\\n\\t\\t\\t\\n\\t\\t\\t<\\\/category>\\n\\t=
>
> \\t<\\\/category>\\n\\t<\\\/category>\\n\\t\\n\\t\\t\\n\\t\\t<\\\/category>=
>
> \\n\\t\\t\\n\\t\\t\\t\\n\\t\\t<\\\/portfolio>\\n\\t\\t\\n\\t\\t<\\\/categor=
>
> y>\\n\\t\\t\\n\\t\\t<\\\/category>\\n\\t\\t\\n\\t\\t\\t\\n\\t\\t<\\\/portfo=
>
> lio>\\n\\t\\t\\n\\t\\t<\\\/portfolio>\\n\\t\\t\\n\\t\\t\\t\\n\\t\\t\\t\\t\\=
>
> n\\t\\t\\t\\t\\n\\t\\t\\t<\\\/portfolio>\\n\\t\\t\\t\\n\\t\\t\\t\\t\\n\\t\\=
>
> t\\t\\t\\n\\t\\t\\t<\\\/portfolio>\\n\\t\\t<\\\/category>\\n\\t\\t\\n\\t\\t=
>
> <\\\/portfolio>\\n\\t<\\\/category>\\n\\t\\n\\t<\\\/portfolio>\\n\\t\\n\\t<=
>
> \\\/portfolio>\\n\\t\\n\\t<\\\/portfolio>\\n<\\\/root>\",\"\\n\\t\\n\\t<\\\=
>
> /category>\\n\\t\\n\\t\\t\\n\\t\\t\\n\\t\\t\\n\\t\\t\\n\\t\\t\\n\\t\\t\\n\\=
>
> t\\t\\n\\t\\t\\n\\t\\t\\n\\t<\\\/portfolio>\\n\\t\\n\\t\\t\\n\\t\\t\\n\\t<\=
>
> \\/portfolio>\\n\\t\\n\\t<\\\/category>\\n\\t\\n\\t<\\\/category>\\n<\\\/ro=
> ot>\"]"
>
> What am I doing wrong? Thanks in advance.
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:357937
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to