|
Mailing Lists
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
Returning XML via webservice, cont
Author: Chris Dempsey
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32935#165489
Tom,
I think you mean why do I not call the XML directly? Ie., have the
user hit http://www.graddiv.ucsb.edu/ssoNavigation.xml instead of
/sso.cfc?method=getNavigation
The reason why I'd like to work out going through the CFC is that a
future version will return a customized XML based on some input
parameters, such as userID.
Thanks,
Chris
On Jun 3, 2004, at 6:37 AM, Tom Kitta wrote:
----- Excess quoted text cut - see Original Post for more -----
--
***********************
Chris Dempsey
Director, Information Services
UCSB Graduate Division
Quis custodiet ipsos custodies
Author: Chris Dempsey
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32935#165487
Tom,
I think you mean why do I not call the XML directly? Ie., have the
user hit http://www.graddiv.ucsb.edu/ssoNavigation.xml instead of
/sso.cfc?method=getNavigation
The reason why I'd like to work out going through the CFC is that a
future version will return a customized XML based on some input
parameters, such as userID.
Thanks,
Chris
On Jun 3, 2004, at 6:37 AM, Tom Kitta wrote:
----- Excess quoted text cut - see Original Post for more -----
Author: Tom Kitta
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32935#165362
Yes, I see the same thing when I view the source, it is a WDDX pocket. It is
the way CF is sending the XML to the browser as XML encapsulated in WDDX.
You can always write the XML to a file and then you get straight XML. Why
this would be problem for your application?
TK
Tom,
The displayed output is correct, but when I view the source, I see the
<wddx> tags. Is that the same with you?
Chris
> I tryed the links you supplied and I got what I expected. Can you send
me
> what you get as your browser response? Maybe you need to clear browser
cache
> or something. I looked at the XML raw and one returned by your CFC call
and
> they are the same minus the formatting of the actual XML (mine doesn't
have
> the line feeds). Check it out and tell me whatever it works now, if it
works
> for me it should for you, right?
>
> TK
> Tom,
>
> I tried what you recommended,
>
> I have tried your method below, and it didn't work quite right. It
still
> returns a WDDX packet, but now all of the XML is escaped. The XML
file is
> at http://www.graddiv.ucsb.edu/ssoNavigation.xml
and I am calling the
> below code with
http://www.graddiv.ucsb.edu/sso.cfc?method=getNavigation
>
> Here is the code now. I tried it without using the closing /> and it
had
> no effect.
>
> <cffunction name="getNavigation" access="remote"
> returntype="any" displayname="Get SSO navigation XML document"
> hint="This method retrieves an XML document used for SSO navigation
> bar."
> output="false">
> <cffile action="read" file="D:\inetpub\wwwroot\ssoNavigation.xml"
> variable="myString" />
> <cfreturn toString(myString) />
> </cffunction>
>
> Totally bizarre. Also tried restarting the CF service and clearing
the
> browser cache, no effect.
>
> Thanks,
>
> Chri
>
>
>
>
Author: Christopher Dempsey
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32935#165329
Tom,
The displayed output is correct, but when I view the source, I see the
<wddx> tags. Is that the same with you?
Chris
----- Excess quoted text cut - see Original Post for more -----
Author: Tom Kitta
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32935#165313
I tryed the links you supplied and I got what I expected. Can you send me
what you get as your browser response? Maybe you need to clear browser cache
or something. I looked at the XML raw and one returned by your CFC call and
they are the same minus the formatting of the actual XML (mine doesn't have
the line feeds). Check it out and tell me whatever it works now, if it works
for me it should for you, right?
TK
Tom,
I tried what you recommended,
I have tried your method below, and it didn't work quite right. It still
returns a WDDX packet, but now all of the XML is escaped. The XML file is
at http://www.graddiv.ucsb.edu/ssoNavigation.xml and I am calling
the
below code with http://www.graddiv.ucsb.edu/sso.cfc?method=getNavigation
Here is the code now. I tried it without using the closing /> and it had
no effect.
<cffunction name="getNavigation" access="remote"
returntype="any" displayname="Get SSO navigation XML document"
hint="This method retrieves an XML document used for SSO navigation
bar."
output="false">
<cffile action="read" file="D:\inetpub\wwwroot\ssoNavigation.xml"
variable="myString" />
<cfreturn toString(myString) />
</cffunction>
Totally bizarre. Also tried restarting the CF service and clearing the
browser cache, no effect.
Thanks,
Chri
Author: Christopher Dempsey
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32935#165306
Tom,
I tried what you recommended,
I have tried your method below, and it didn't work quite right. It still
returns a WDDX packet, but now all of the XML is escaped. The XML file is
at http://www.graddiv.ucsb.edu/ssoNavigation.xml and I am calling
the
below code with http://www.graddiv.ucsb.edu/sso.cfc?method=getNavigation
Here is the code now. I tried it without using the closing /> and it had
no effect.
<cffunction name="getNavigation" access="remote"
returntype="any" displayname="Get SSO navigation XML document"
hint="This method retrieves an XML document used for SSO navigation bar."
output="false">
<cffile action="read" file="D:\inetpub\wwwroot\ssoNavigation.xml"
variable="myString" />
<cfreturn toString(myString) />
</cffunction>
Totally bizarre. Also tried restarting the CF service and clearing the
browser cache, no effect.
Thanks,
Chris
----- Excess quoted text cut - see Original Post for more -----
--
***********************
Chris Dempsey
Director, Information Services
UCSB Graduate Division
Quis custodiet ipsos
custodies
Author: Tom Kitta
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32935#165289
I have tryed your function, with code:
<cffunction name="getNavigation" access="remote" returntype="any"
output="false">
<cffile action="read" file="c:\inetpub\wwwroot\tk\gb\data\data1.xml"
variable="myString">
<cfreturn xmlFormat(toString(myString))>
</cffunction>
Works fine. Try to copy above exactly, maybe it is your /> at the tag ends.
Check the actual XML file, what is in it. Etc. Function works fine on CF6.1
TK
http://www.tomkitta.com
Oops, wrong version of the function. Here is the right code:
<cffunction name="getNavigation2" access="remote" returntype="any"
output="false">
<cffile action="read" file="D:\inetpub\wwwroot\ssoNavigation.xml"
variable="myString" />
<cfreturn toString(myString) />
</cffuncti
> Why is your function return type "void" it should be "string" if you
want to
> return a string[Tom Kitta] . Change it to string and give it a go.
>
> TK
> Dear List,
>
> I saw this thread a few days ago, about returning an XML document as a
> string from a CFC. I tried using returntype="any" and the toString()
> function - neither worked. What ends up happening is that the XML
> document gets returned as a WDDX packet. Is it possible to just
return
> it as a string, with no further changes?
>
> Here is the XML doc: http://www.graddiv.ucsb.edu/ssoNavigation.xml
>
> Here is the simplified CFC code:
>
> <cfcomponent extends="base">
> <cffunction name="getNavigation" access="remote"
> returntype="void" output="false">
> <cffile action="read" file="#path#ssoNavigation.xml"
> variable="myString" />
>
> <cfreturn toString(myString) />
> </cffunction>
> </cfcomponent>
>
> The cfc is located here: http://www.graddiv.ucsb.edu/sso.cfc
>
> Thanks!
>
> Chris
Author: Christopher Dempsey
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32935#165268
Oops, wrong version of the function. Here is the right code:
<cffunction name="getNavigation2" access="remote" returntype="any"
output="false">
<cffile action="read" file="D:\inetpub\wwwroot\ssoNavigation.xml"
variable="myString" />
<cfreturn toString(myString) />
</cffuncti
----- Excess quoted text cut - see Original Post for more -----
Author: Tom Kitta
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32935#165258
Why is your function return type "void" it should be "string" if you want to
return a string[Tom Kitta] . Change it to string and give it a go.
TK
Dear List,
I saw this thread a few days ago, about returning an XML document as a
string from a CFC. I tried using returntype="any" and the toString()
function - neither worked. What ends up happening is that the XML
document gets returned as a WDDX packet. Is it possible to just return
it as a string, with no further changes?
Here is the XML doc: http://www.graddiv.ucsb.edu/ssoNavigation.xml
Here is the simplified CFC code:
<cfcomponent extends="base">
<cffunction name="getNavigation" access="remote"
returntype="void" output="false">
<cffile action="read" file="#path#ssoNavigation.xml"
variable="myString" />
<cfreturn toString(myString) />
</cffunction>
</cfcomponent>
The cfc is located here: http://www.graddiv.ucsb.edu/sso.cfc
Thanks!
Chris
--
***********************
Chris Dempsey
Director, Information Services
UCSB Graduate Division
Quis custodiet ipsos custodies
Author: Chris Dempsey
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32935#165253
Dear List,
I saw this thread a few days ago, about returning an XML document as a
string from a CFC. I tried using returntype="any" and the toString()
function - neither worked. What ends up happening is that the XML
document gets returned as a WDDX packet. Is it possible to just return
it as a string, with no further changes?
Here is the XML doc: http://www.graddiv.ucsb.edu/ssoNavigation.xml
Here is the simplified CFC code:
<cfcomponent extends="base">
<cffunction name="getNavigation" access="remote"
returntype="void" output="false">
<cffile action="read" file="#path#ssoNavigation.xml"
variable="myString" />
<cfreturn toString(myString) />
</cffunction>
</cfcomponent>
The cfc is located here: http://www.graddiv.ucsb.edu/sso.cfc
Thanks!
Chris
--
***********************
Chris Dempsey
Director, Information Services
UCSB Graduate Division
Quis custodiet ipsos custodies
|
May 24, 2012
|
Latest Fusion Authority Articles
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||