long time lurker, first time poster here :)
so, I created a nifty method right below here and having issue with the
return type. Based on docs and reading, I can return a array of objects
like that, but its bombing out. If I change to returning a "array" things
are happy, but the WSDL is different loosing some type info. Not sure
what's the deal. This is CF 9.01.
Any pointers or ideas?
remote com.cubicleman.cfo.model.StateDTO[] function getAllStates()
{
//this guy does the DB work and returns com.cubicleman.cfo.model.StateDTO[]
return stateService.getAll();
}
Now, if I hit this method in a web browser
using
http://localhost:8080/cfobjective/CFOFacade.cfc?wsdl&method=getAllSTates
It works a treat, dumping out the states, all 50!
Now, when I use CFINVOKE in a CFM page to hit the same method I get this
error
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: coldfusion.xml.rpc.CFCInvocationException:
[java.lang.ClassCastException : java.util.ArrayList]
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:coldfusion.xml.rpc.CFCInvocationException:
[java.lang.ClassCastException : java.util.ArrayList]
at
coldfusion.xml.rpc.CFComponentSkeleton.__createCFCInvocationException(CFComponentSkeleton.java:733)
at
coldfusion.xml.rpc.CFComponentSkeleton.__cast(CFComponentSkeleton.java:409)
at
cfobjective.CFOFacade.getAllStates(/Servers/apache-tomcat-6.0.26_CF9_64bit_cfo/webapps/ROOT/cfobjective/CFOFacade.cfc)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.axis.providers.java.... ''
If I try and use Flex to invoke, I get this nasty bugger
<soapenv:Fault xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance">
<faultcode>
soapenv:Server.userException
</faultcode>
<faultstring>
coldfusion.xml.rpc.CFCInvocationException: [java.lang.ClassCastException
: java.util.ArrayList]
</faultstring>
<detail>
<ns1:stackTrace xmlns:ns1="http://xml.apache.org/axis/">
coldfusion.xml.rpc.CFCInvocationException:
[java.lang.ClassCastException : java.util.ArrayList]
at
coldfusion.xml.rpc.CFComponentSkeleton.__createCFCInvocationException(CFComponentSkeleton.java:733)
at
coldfusion.xml.rpc.CFComponentSkeleton.__cast(CFComponentSkeleton.java:409)
at
cfobjective.CFOFacade.getAllStates(/Servers/apache-tomcat-6.0.26_CF9_64bit_cfo/webapps/ROOT/cfobjective/CFOFacade.cfc)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:388)
at
org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:283)
at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:323)
at coldfusion.xml.rpc.CFCProvider.invoke(CFCProvider.java:54)
at
org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:453)
at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281)
at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699)
at coldfusion.xml.rpc.CFCServlet.doAxisPost(CFCServlet.java:270)
at coldfusion.filter.AxisFilter.invoke(AxisFilter.java:43)
at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:374)
at
coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:48)
at coldfusion.filter.MonitoringFilter.invoke(MonitoringFilter.java:40)
at coldfusion.filter.PathFilter.invoke(PathFilter.java:94)
at coldfusion.filter.LicenseFilter.invoke(LicenseFilter.java:27)
at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:70)
at
coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilter.java:28)
at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
at coldfusion.xml.rpc.CFCServlet.invoke(CFCServlet.java:138)
at coldfusion.xml.rpc.CFCServlet.doPost(CFCServlet.java:289)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at
org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:89)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
coldfusion.monitor.event.MonitoringServletFilter.doFilter(MonitoringServletFilter.java:42)
at coldfusion.bootstrap.BootstrapFilter.doFilter(BootstrapFilter.java:46)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:680)
</ns1:stackTrace>
<ns2:hostname xmlns:ns2="http://xml.apache.org/axis/">
dkmacbookpro
</ns2:hostname>
</detail>
</soapenv:Fault>
Douglas Knudsen
http://www.cubicleman.com
this is my signature, like it?