Apologies to those who have seen this already...

I think I've got a bug here, but appreciate someone else to check, as well
as try to get any assistance anyone could offer about a workaround before
submitting a bug report. This is on Win2k, CFMX 6.1.

I am currently developing both "sides" of a web services application
(publishing CFC as web services and consuming them via .cfms). I have a few
facade-style cfcs that are being designed to only accept requests in the
form of web services. The system is not publicly-accessible in that every
request must be authenticated.

Using the "username" and "password" attributes of the <cfinvoke> tag makes
passing the credentials from my cfm pages to my web services facade cfcs
very easy. I am trying to have my facade cfcs extend a "security" cfc that
will validate the request via some code in its pseudo-constructor area. That
way, every method request in my facades will automatically get authenticated
by the security cfc.

But it appears that if I try to run the function getHTTPRequestData() in the
pseudo-constructor of the security cfc, I get an Axis error with a
"faultString" of "org.xml.sax.SAXParseException: Document root element is
missing." I have tried moving the actual function call into a cfc method and
having the pseudo-constructor call that method, but I get the same error.

I have created a simple test script (inline below) for those who want to
play along. By runnind test.cfm as pasted below, you will not have a
problem, and get a dump of the request data. However, if you un-comment the
pseudo-constructor in test.cfc and change test.cfm to call the method
"hello", you'll get the bomb.

I might be forced to use <cflogin>, but I'd prefer to have a little more
control over the nuts-n-bolts. Additionally, the example in the docs at
http://livedocs.macromedia.com/coldfusion/6.1/htmldocs/webser33.htm doesn't
work, if I'm reading it right. Sticking the code on that page in
Application.cfm and calling a CFC via web services produces an Axis error,
which leads me to believe that the <cflogin> tag does the same thing that
getHTTPRequestData() does behind the scenes.

If anyone has suggestions, I'd love to hear them.

Thanks,
NAT

Nat Papovich
Senior Partner & Lead Architect
Fusium, Inc.
503-226-7099

TEST SCRIPTS
//

test.cfm:
<cfinvoke webservice="http://localhost/test.cfc?wsdl"; method="getIt"
returnvariable="ret"/>
<cfdump var="#ret#">

test.cfc:
<cfcomponent>
        <!--- <cfset myVar=getHTTPRequestData() /> --->
        <cffunction name="hello" output="No" returntype="struct" access="remote">
                <cfreturn myVar />
        </cffunction>
        <cffunction name="getIt" output="No" returntype="struct" access="remote">
                <cfreturn getHTTPRequestData() />
        </cffunction>
</cfcomponent>

----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev' 
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]

Reply via email to