Hello all. Was hoping someone could help me solve this irritating issue.
Curently I have a cfc called gateway.cfc setup to recieve incoming xml, perform
some operations and then pass back some xml.
Here is the component
<cffunction name="sfrequest" description="I take a method name and some
arguments as xml and call a cfc" access="remote" returntype="xml"
output="false">
<cfargument name="xmlRequest" type="xml" required="true">
<!---Take the xml input and do something with it --->
<cfoutput>
<cfxml variable="xmlOutput">
<response>
<result>SUCCESS</result>
<result_code>100</result_code>
<message>User
#xmlRequest.request.username.xmltext# Logged In</message>
</response>
</cfxml>
</cfoutput>
<cfreturn xmlOutput />
</cffunction>
I'm calling this function using the following code to create some xml and then
call the component as a webservice
<cfscript>
xmlRequest = XmlNew();
xmlRequest.xmlRoot = XmlElemNew(xmlRequest,"Request");
xmlRequest.Request.xmlChildren[1] = XmlElemNew(xmlRequest,"Username");
xmlRequest.Request.Username.XmlText = "Jim";
xmlRequest.Request.xmlChildren[2] = XmlElemNew(xmlRequest,"Password");
xmlRequest.Request.Password.XmlText = "password";
</cfscript>
<cfdump var="#xmlRequest#">
<cfscript>
ws = CreateObject("webservice", "#variables.wsURL#");
ret = ws.sfrequest(xmlRequest);
</cfscript>
<cfdump var="#ret#">
Now this works fine if I call the cfc locally, but I get an error when I access
it as a webservice. The webservice works fine if I just return the xmlRequest
variable and it also works fine I I just return the generated xmlOutput without
doing anything to the inputted xml. However as soon as I try to do anything
with the xmlRequest such as pulling some text from it as above, it errors.
Any ideas??
Cheers
Jim
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know
on the House of Fusion mailing lists
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:323152
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4