DataCollab
asked on
Where do I put a cfc file that describes a complex structure for a web service?
Hi!
I'm trying to create a web service in ColdFusion 9 that returns a complex structure or has a complex argument. I am placing the .cfc file that describes the structure in the same directory as the .cfc that is using the structure. RIght now I'm just trying to get a wsdl.
I currently have two functions in my .cfc, The first one returns a string. The second one ideally returns an array of strings. Saying returntype="string[]" gives an error that ColdFusion could not parse string
So I tried making a defined type with the individual element being a string:
<cfcomponent>
<cfproperty name="InfoSource" type="string">
<cfcomponent>
-------------------------- ----------
My code that uses this cfc is:
<cfcomponent>
<cffunction name="getzips" access="remote" returntype="string">
<cfset #resultsCommaDelimtedZips# = "this is the result">
<cfreturn CommaDelimitedZips>
</cffunction>
<cffunction name="getInfoSources" access="remote" returntype="InfoSources[]" >
</cffunction>
</cfcomponent>
The error that I get is:
AXIS error
Sorry, something seems to have gone wrong... here are the details:
Fault - Error attempting to create Java skeleton for CFC web service.; nested exception is:
coldfusion.xml.rpc.CFCInvo cationExce ption: [coldfusion.compiler.Parse Exception : Invalid CFML construct found on line 3 at column 1.ColdFusion was looking at the following text:<p><</p><p>The CFML compiler was processing:<ul>< marks the beginning of a ColdFusion tag.Did you mean LT or LTE?</ul>]
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.generalException
faultSubcode:
faultString: Error attempting to create Java skeleton for CFC web service.; nested exception is:
coldfusion.xml.rpc.CFCInvo cationExce ption: [coldfusion.compiler.Parse Exception : Invalid CFML construct found on line 3 at column 1.ColdFusion was looking at the following text:<p><</p><p>The CFML compiler was processing:<ul>< marks the beginning of a ColdFusion tag.Did you mean LT or LTE?</ul>]
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}hostname:ntc15
-------------------------- --
I have a similar problem if I use cfproperty:
<cfcomponent>
<cfproperty name="approved" type="string">
<cfproperty name="total_charged" type="string">
<cfproperty name="charge_error" type="string">
<cfproperty name="renewed_until" type="string">
<cfproperty name="reason" type="string">
<cfcomponent>
http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=webservices_20.html says
Note: If the component files are not in a directory under your web root, you must create a web server mapping to the directory that contains them. You cannot use ColdFusion mappings to access web services.
So I tried putting the .cfc file in a directory beneath my wwwroot folder rather than in it. That didn't help.
Any suggestions? I feel like I've done exactly what all the documentation I can find tells me to do!
Thanks!
-- Mabel :-)
mliang@datacollaborative.c om
I'm trying to create a web service in ColdFusion 9 that returns a complex structure or has a complex argument. I am placing the .cfc file that describes the structure in the same directory as the .cfc that is using the structure. RIght now I'm just trying to get a wsdl.
I currently have two functions in my .cfc, The first one returns a string. The second one ideally returns an array of strings. Saying returntype="string[]" gives an error that ColdFusion could not parse string
So I tried making a defined type with the individual element being a string:
<cfcomponent>
<cfproperty name="InfoSource" type="string">
<cfcomponent>
--------------------------
My code that uses this cfc is:
<cfcomponent>
<cffunction name="getzips" access="remote" returntype="string">
<cfset #resultsCommaDelimtedZips#
<cfreturn CommaDelimitedZips>
</cffunction>
<cffunction name="getInfoSources" access="remote" returntype="InfoSources[]"
</cffunction>
</cfcomponent>
The error that I get is:
AXIS error
Sorry, something seems to have gone wrong... here are the details:
Fault - Error attempting to create Java skeleton for CFC web service.; nested exception is:
coldfusion.xml.rpc.CFCInvo
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.generalException
faultSubcode:
faultString: Error attempting to create Java skeleton for CFC web service.; nested exception is:
coldfusion.xml.rpc.CFCInvo
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}hostname:ntc15
--------------------------
I have a similar problem if I use cfproperty:
<cfcomponent>
<cfproperty name="approved" type="string">
<cfproperty name="total_charged" type="string">
<cfproperty name="charge_error" type="string">
<cfproperty name="renewed_until" type="string">
<cfproperty name="reason" type="string">
<cfcomponent>
http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=webservices_20.html says
Note: If the component files are not in a directory under your web root, you must create a web server mapping to the directory that contains them. You cannot use ColdFusion mappings to access web services.
So I tried putting the .cfc file in a directory beneath my wwwroot folder rather than in it. That didn't help.
Any suggestions? I feel like I've done exactly what all the documentation I can find tells me to do!
Thanks!
-- Mabel :-)
mliang@datacollaborative.c
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hammo777,
Thanks! I had already found that post. I've finally gotten something to work by making my file names and component names be all lower case. It makes no sense to me, but I do finally have a WSDL.
FWIW, my files are all in the same directory.
Thanks for your help!
Thanks! I had already found that post. I've finally gotten something to work by making my file names and component names be all lower case. It makes no sense to me, but I do finally have a WSDL.
FWIW, my files are all in the same directory.
Thanks for your help!
ASKER
I still don't know how to specify an array of strings, and the answer provided didn't tell me where to put the other .cfc file.
ASKER
Thanks!