Hi I am creating a coldfsion webservice that is to be used by other platforms ( asp etc). In my webservice I have a method that I want to return data as XML which can then be read easily by these different platforms. At the moment I have something like this....
<cffunction name="getBlogs" hint="I search the live blogs" access="remote" returntype="xml">
<cfargument name="limit" required="No" default="" type="any">
<cfargument name="blogCategoryTypeName" required="No" default="Web analytics" type="any">
<cfset var qrySearch = "">
<cfset var strXML = "">
<cfquery name="qrySearch" datasource="#variables.dsn#">
blogslive.blogStatusId = 2
<cfsetting enablecfoutputonly="true" />
<cfloop array="#results#" index="b">
<cfset strXML = #ToString(objXML)#>
<cfset strXML = #replace(strXML,"<?xml version=""1.0"" encoding=""UTF-8""?>","")#>
The problem I am having is that when calling this webservice via classic ASP for example it sees the xml as a string and hence it quite difficult to manipulate. I would like to return the data like the following example:
How can i get the webservice to return data like the link above? So for example if i call mty webservice like link above i get the same type of result?
Any help much appreciated
I've had similar issues. I've been asked to write web services for asp.net apps and basically, if you include the opening xml tag, asp can't consume it. I handled my own problem by including an argument that determined whether to return the data with the xml tag or without.