After working with CFCs these are my notes

CFCs invoked as webservices ignore "Coldfusion mappings" configured via the
admin. This is a known issue. (Odly any application.cfm available and
processed prior to the instantiation of the webservice happily uses cf
mappings as per usual)

if your webservice needs to reference other CFCs (or any other code like a
custom tag via cfmodule, or code via cfinclude) which are outside the web
accessible directory structure thus normally requiring a mapping you *must*
add the mappings to the jrun-web.xml file ( or create a virtual directory in
the webserver like IIS see further below).

<virtual-mapping>
        <resource-path>/mapping</resource-path>
        <system-path>C:/mapped dir path</system-path>
</virtual-mapping>

(I add one of these for each cf mapping i make)

Be aware the "resource-path" matching is case sensitive unlike anything
else, so after the above addition (and cf service restart)

<cfobject name="myObject" component="mapping.myComponent"> will work
<cfinclude template="mapping/myCode.cfm"> will work

<cfobject name="myObject" component="Mapping.myComponent"> will NOT work
<cfinclude template="Mapping/myCode.cfm"> will NOT work

often people don't notice these issues because their CFCs are in the web
accessible directory structure, just like their images and so their
component paths resolve easily

if you are unable to change the xml config file you can also make a virtual
directory called "mapping" (in the case of the above example) and point it
at the CFC(or code) directory. If you feel unhappy doing that, the virtual
directory can have no READ permissions and the mapping will still be
determined correctly (only tested in IIS). It doesn't need the url access
just a way of resolving the mappings.

Changes to webservices which involve a change of the wsdl (ie added
functions, changed parameters(arguments) ) are often not immediately
visible.

The following bit of undocumented magic will clear the cached info (CF admin
shows the list under webservices). I use this at the start of any code
testing the WS during development.

<cfobject action="CREATE" type="JAVA"
class="coldfusion.server.ServiceFactory" name="factory">

<cfset xmlRpc = factory.getXMLRPCService()>
<cfset services = xmlRpc.mappings>

<cfloop item="service" collection="#services#">
        <cfset xmlRpc.unregisterWebService(service)>
</cfloop>


Hope this helps you guys starting with webservices.

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Sunday, 25 April 2004 10:39 PM
Subject: [PERIODIC cfcdev DIGEST POSTING]



From: "Stephen Milligan" <[EMAIL PROTECTED]>
Subject: RE: [CFCDev] WS/Virtual Hosts issues
Date: Sat, 24 Apr 2004 08:24:46 -0700
Reply-To: [EMAIL PROTECTED]
Hi Ray,

I just set up my machine to test this.

I'm not having any problems at all...

My URL is:
http://mydomain/webservices/helloworld.cfc

My test script is:

http://mydomain/webservices/invoker.cfm

My Directory structure is:

C:\sites\dev\mysite\www

I am using Apache 2.048 and I have about 15 virtual hosts.

The website I tested it on is not the default host.

I don't seem to need the jrun-web mapping either.

I'm suspicious about your file path having '.' in it.

I remember having issues with that in the past, but I can't remember exactly
what they were.

Spike


>-----Original Message-----
>From: [EMAIL PROTECTED]
>[mailto:[EMAIL PROTECTED] On Behalf Of Raymond Camden
>Sent: Saturday, April 24, 2004 4:37 AM
>To: [EMAIL PROTECTED]
>Subject: [CFCDev] WS/Virtual Hosts issues
>
>(For those on cf-talk, forgive the cross post.)
>
>So, I've been trying like heck to solve a simple problem. I
>have a virtual host running with Apache, tasktracker.jedi.com.
>I normally keep my cfcs
>here:
>
>c:\projects\tasktracker.jedi.com\cfcs
>
>and my web root is here:
>
>c:\projects\tasktracker.jedi.com\wwwroot
>
>I needed to use a web service, so I added a CFC called
>tasktrackerproxy.cfc.
>When placed under the webroot, at first, I could not view the
>CFC. However, I simply added an alias for /CFIDE and
>everything worked fine.
>
>However, whenever I tried to call the CFC as a WS, I got an
>error saying the class could not be found. Nothing on google
>was helpful.
>
>Barney suggested I add an alias in jrun-web.xml. So I added this:
>
>    <virtual-mapping>
>    <resource-path>/tasktracker</resource-path>
>    <system-path>C:/projects/tasktracker.jedi.com/wwwroot</system-path>
>  </virtual-mapping>
>
>Now I tried to hit my WS like this:
>
>tasktracker.jedi.com/tasktracker/tasktrackerproxy.cfc?WSDL
>
>This time I got:
>
>Fault -
>[coldfusion.xml.rpc.SkeletonClassLoader$UnresolvedCFCDataTypeEx
>ception :
>Could not resolve CFC datatype: /tasktracker/temp.cfc][;
>nested exception
>is:
>       coldfusion.xml.rpc.CFCInvocationException:
>[coldfusion.xml.rpc.SkeletonClassLoader$UnresolvedCFCDataTypeEx
>ception :
>Could not resolve CFC datatype: /tasktracker/temp.cfc][
>
>
>This almost seems like I'm using a returntype or an extends to
>a cfc that MX can't find, but my CFC is extremely simple. It
>has one method that returns "hi".
>
>This is extremely frustrating and I can't believe I'm the only
>one trying to use WS under virtual servers.
>
>===============================================================
>============
>Raymond Camden, ColdFusion Jedi Master for Mindseye, Inc
>(www.mindseye.com) Member of Team Macromedia
>(http://www.macromedia.com/go/teammacromedia)
>
>Email    : [EMAIL PROTECTED]
>Blog     : www.camdenfamily.com/morpheus/blog
>Yahoo IM : morpheus
>
>"My ally is the Force, and a powerful ally it is." - Yoda
>
>
>----------------------------------------------------------
>You are subscribed to cfcdev. To unsubscribe, send an email to
>[EMAIL PROTECTED] with the words '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]


From: "Raymond Camden" <[EMAIL PROTECTED]>
Subject: RE: [CFCDev] WS/Virtual Hosts issues
Date: Sat, 24 Apr 2004 10:48:59 -0500
Reply-To: [EMAIL PROTECTED]
Shoot, I renamed the root folder. I removed my jrun alias to kinda restore
me back to my original state. Now I'm back to the class not found error.

===========================================================================
Raymond Camden, ColdFusion Jedi Master for Mindseye, Inc (www.mindseye.com)
Member of Team Macromedia (http://www.macromedia.com/go/teammacromedia)

Email    : [EMAIL PROTECTED]
Blog     : www.camdenfamily.com/morpheus/blog
Yahoo IM : morpheus

"My ally is the Force, and a powerful ally it is." - Yoda

> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Stephen Milligan
> Sent: Saturday, April 24, 2004 10:25 AM
> To: [EMAIL PROTECTED]
> Subject: RE: [CFCDev] WS/Virtual Hosts issues
>
> Hi Ray,
>
> I just set up my machine to test this.
>
> I'm not having any problems at all...
>
> My URL is:
> http://mydomain/webservices/helloworld.cfc
>
> My test script is:
>
> http://mydomain/webservices/invoker.cfm
>
> My Directory structure is:
>
> C:\sites\dev\mysite\www
>
> I am using Apache 2.048 and I have about 15 virtual hosts.
>
> The website I tested it on is not the default host.
>
> I don't seem to need the jrun-web mapping either.
>
> I'm suspicious about your file path having '.' in it.
>
> I remember having issues with that in the past, but I can't
> remember exactly what they were.
>
> Spike
>
>
> >-----Original Message-----
> >From: [EMAIL PROTECTED]
> >[mailto:[EMAIL PROTECTED] On Behalf Of Raymond Camden
> >Sent: Saturday, April 24, 2004 4:37 AM
> >To: [EMAIL PROTECTED]
> >Subject: [CFCDev] WS/Virtual Hosts issues
> >
> >(For those on cf-talk, forgive the cross post.)
> >
> >So, I've been trying like heck to solve a simple problem. I have a
> >virtual host running with Apache, tasktracker.jedi.com.
> >I normally keep my cfcs
> >here:
> >
> >c:\projects\tasktracker.jedi.com\cfcs
> >
> >and my web root is here:
> >
> >c:\projects\tasktracker.jedi.com\wwwroot
> >
> >I needed to use a web service, so I added a CFC called
> >tasktrackerproxy.cfc.
> >When placed under the webroot, at first, I could not view the CFC.
> >However, I simply added an alias for /CFIDE and everything
> worked fine.
> >
> >However, whenever I tried to call the CFC as a WS, I got an error
> >saying the class could not be found. Nothing on google was helpful.
> >
> >Barney suggested I add an alias in jrun-web.xml. So I added this:
> >
> >    <virtual-mapping>
> >    <resource-path>/tasktracker</resource-path>
> >
> <system-path>C:/projects/tasktracker.jedi.com/wwwroot</system-path>
> >  </virtual-mapping>
> >
> >Now I tried to hit my WS like this:
> >
> >tasktracker.jedi.com/tasktracker/tasktrackerproxy.cfc?WSDL
> >
> >This time I got:
> >
> >Fault -
> >[coldfusion.xml.rpc.SkeletonClassLoader$UnresolvedCFCDataTypeEx
> >ception :
> >Could not resolve CFC datatype: /tasktracker/temp.cfc][; nested
> >exception
> >is:
> >     coldfusion.xml.rpc.CFCInvocationException:
> >[coldfusion.xml.rpc.SkeletonClassLoader$UnresolvedCFCDataTypeEx
> >ception :
> >Could not resolve CFC datatype: /tasktracker/temp.cfc][
> >
> >
> >This almost seems like I'm using a returntype or an extends to a cfc
> >that MX can't find, but my CFC is extremely simple. It has
> one method
> >that returns "hi".
> >
> >This is extremely frustrating and I can't believe I'm the only one
> >trying to use WS under virtual servers.
> >
> >===============================================================
> >============
> >Raymond Camden, ColdFusion Jedi Master for Mindseye, Inc
> >(www.mindseye.com) Member of Team Macromedia
> >(http://www.macromedia.com/go/teammacromedia)
> >
> >Email    : [EMAIL PROTECTED]
> >Blog     : www.camdenfamily.com/morpheus/blog
> >Yahoo IM : morpheus
> >
> >"My ally is the Force, and a powerful ally it is." - Yoda
> >
> >
> >----------------------------------------------------------
> >You are subscribed to cfcdev. To unsubscribe, send an email to
> >[EMAIL PROTECTED] with the words '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]
>
> ----------------------------------------------------------
> You are subscribed to cfcdev. To unsubscribe, send an email
> to [EMAIL PROTECTED] with the words '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]
>



From: "Raymond Camden" <[EMAIL PROTECTED]>
Subject: RE: [CFCDev] WS/Virtual Hosts issues
Date: Sat, 24 Apr 2004 12:55:42 -0500
Reply-To: [EMAIL PROTECTED]
Well crap. So I tried it on another machine that has a fresh install of MX
6.1 and it works ok. I guess the next thing to do is uninstall/reinstall on
the original machine to see if it works.

===========================================================================
Raymond Camden, ColdFusion Jedi Master for Mindseye, Inc (www.mindseye.com)
Member of Team Macromedia (http://www.macromedia.com/go/teammacromedia)

Email    : [EMAIL PROTECTED]
Blog     : www.camdenfamily.com/morpheus/blog
Yahoo IM : morpheus

"My ally is the Force, and a powerful ally it is." - Yoda

> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Raymond Camden
> Sent: Saturday, April 24, 2004 10:49 AM
> To: [EMAIL PROTECTED]
> Subject: RE: [CFCDev] WS/Virtual Hosts issues
>
> Shoot, I renamed the root folder. I removed my jrun alias to
> kinda restore me back to my original state. Now I'm back to
> the class not found error.
>
> ==============================================================
> =============
> Raymond Camden, ColdFusion Jedi Master for Mindseye, Inc
> (www.mindseye.com) Member of Team Macromedia
> (http://www.macromedia.com/go/teammacromedia)
>
> Email    : [EMAIL PROTECTED]
> Blog     : www.camdenfamily.com/morpheus/blog
> Yahoo IM : morpheus
>
> "My ally is the Force, and a powerful ally it is." - Yoda
>
> > -----Original Message-----
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED] On Behalf Of Stephen Milligan
> > Sent: Saturday, April 24, 2004 10:25 AM
> > To: [EMAIL PROTECTED]
> > Subject: RE: [CFCDev] WS/Virtual Hosts issues
> >
> > Hi Ray,
> >
> > I just set up my machine to test this.
> >
> > I'm not having any problems at all...
> >
> > My URL is:
> > http://mydomain/webservices/helloworld.cfc
> >
> > My test script is:
> >
> > http://mydomain/webservices/invoker.cfm
> >
> > My Directory structure is:
> >
> > C:\sites\dev\mysite\www
> >
> > I am using Apache 2.048 and I have about 15 virtual hosts.
> >
> > The website I tested it on is not the default host.
> >
> > I don't seem to need the jrun-web mapping either.
> >
> > I'm suspicious about your file path having '.' in it.
> >
> > I remember having issues with that in the past, but I can't
> remember
> > exactly what they were.
> >
> > Spike
> >
> >
> > >-----Original Message-----
> > >From: [EMAIL PROTECTED]
> > >[mailto:[EMAIL PROTECTED] On Behalf Of Raymond Camden
> > >Sent: Saturday, April 24, 2004 4:37 AM
> > >To: [EMAIL PROTECTED]
> > >Subject: [CFCDev] WS/Virtual Hosts issues
> > >
> > >(For those on cf-talk, forgive the cross post.)
> > >
> > >So, I've been trying like heck to solve a simple problem. I have a
> > >virtual host running with Apache, tasktracker.jedi.com.
> > >I normally keep my cfcs
> > >here:
> > >
> > >c:\projects\tasktracker.jedi.com\cfcs
> > >
> > >and my web root is here:
> > >
> > >c:\projects\tasktracker.jedi.com\wwwroot
> > >
> > >I needed to use a web service, so I added a CFC called
> > >tasktrackerproxy.cfc.
> > >When placed under the webroot, at first, I could not view the CFC.
> > >However, I simply added an alias for /CFIDE and everything
> > worked fine.
> > >
> > >However, whenever I tried to call the CFC as a WS, I got an error
> > >saying the class could not be found. Nothing on google was helpful.
> > >
> > >Barney suggested I add an alias in jrun-web.xml. So I added this:
> > >
> > >    <virtual-mapping>
> > >    <resource-path>/tasktracker</resource-path>
> > >
> > <system-path>C:/projects/tasktracker.jedi.com/wwwroot</system-path>
> > >  </virtual-mapping>
> > >
> > >Now I tried to hit my WS like this:
> > >
> > >tasktracker.jedi.com/tasktracker/tasktrackerproxy.cfc?WSDL
> > >
> > >This time I got:
> > >
> > >Fault -
> > >[coldfusion.xml.rpc.SkeletonClassLoader$UnresolvedCFCDataTypeEx
> > >ception :
> > >Could not resolve CFC datatype: /tasktracker/temp.cfc][; nested
> > >exception
> > >is:
> > >   coldfusion.xml.rpc.CFCInvocationException:
> > >[coldfusion.xml.rpc.SkeletonClassLoader$UnresolvedCFCDataTypeEx
> > >ception :
> > >Could not resolve CFC datatype: /tasktracker/temp.cfc][
> > >
> > >
> > >This almost seems like I'm using a returntype or an
> extends to a cfc
> > >that MX can't find, but my CFC is extremely simple. It has
> > one method
> > >that returns "hi".
> > >
> > >This is extremely frustrating and I can't believe I'm the only one
> > >trying to use WS under virtual servers.
> > >
> > >===============================================================
> > >============
> > >Raymond Camden, ColdFusion Jedi Master for Mindseye, Inc
> > >(www.mindseye.com) Member of Team Macromedia
> > >(http://www.macromedia.com/go/teammacromedia)
> > >
> > >Email    : [EMAIL PROTECTED]
> > >Blog     : www.camdenfamily.com/morpheus/blog
> > >Yahoo IM : morpheus
> > >
> > >"My ally is the Force, and a powerful ally it is." - Yoda
> > >
> > >
> > >----------------------------------------------------------
> > >You are subscribed to cfcdev. To unsubscribe, send an email to
> > >[EMAIL PROTECTED] with the words '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]
> >
> > ----------------------------------------------------------
> > You are subscribed to cfcdev. To unsubscribe, send an email to
> > [EMAIL PROTECTED] with the words '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]
> >
>
>
> ----------------------------------------------------------
> You are subscribed to cfcdev. To unsubscribe, send an email
> to [EMAIL PROTECTED] with the words '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]
>


----------------------------------------------------------
You are subscribed to cfcdev in Digest Mode. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words '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]

----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words '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