cvleon
10-12-2004, 06:09 AM
Hello. Now that I've got Laszlo up and running on my Mac (couldn't get JRun to work, so I'm using the Tomcat package), I'm trying to get a simple Laszlo / ColdFusion MX (CFMX) application going.
I've got a Coldfusion Component (CFC) set up as a web service. It has one simple function, getData(), that returns a query (CF parlance for recordset). It seems that Laszlo can't automatically handle this complex datatype, even though it seems to be described in the WSDL. I hope someone can help me figure this out, since it would be great to be able to easily work with CFMX's native recordsets.
The specific error I'm getting is:
org.xml.sax.SAXException: Deserializing parameter 'getDataReturn': could not find deserializer for type {http://rpc.xml.coldfusion}QueryBean
Here's the Laszlo code (sorry, but I don't know how to make this format nicely):
<canvas debug="true" width="800" height="600" bgcolor="gray">
<debug x="15" y="15" width="415" height="500" />
<dataset name="myDset" />
<soap name="testSoap" wsdl="http://testapp.localhost/test.cfc?wsdl">
<method event="onload">
Debug.write('test soap service loaded');
Debug.inspect(this.proxy);
testSoap.getData.invoke();
</method>
<remotecall funcname="getData" dataobject="myDset">
<method event="ondata" args="value">
//debug.write('dataset:\n', value);
</method>
</remotecall>
</soap>
<text>This is my test app</text>
</canvas>
Here's the WSDL returned by CFMX:
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://DefaultNamespace" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns1="http://rpc.xml.coldfusion" xmlns:impl="http://DefaultNamespace" xmlns:intf="http://DefaultNamespace" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns="http://schemas.xmlsoap.org/wsdl/"><wsdl:types><schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://DefaultNamespace"><import namespace="http://schemas.xmlsoap.org/soap/encoding/"/><complexType name="ArrayOf_xsd_string"><complexContent><restriction base="soapenc:Array"><attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:string[]"/></restriction></complexContent></complexType><complexType name="ArrayOfArrayOf_xsd_anyType"><complexContent><restriction base="soapenc:Array"><attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:anyType[][]"/></restriction></complexContent></complexType></schema><schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://rpc.xml.coldfusion"><import namespace="http://schemas.xmlsoap.org/soap/encoding/"/><complexType name="QueryBean"><sequence><element name="columnList" nillable="true" type="impl:ArrayOf_xsd_string"/><element name="data" nillable="true" type="impl:ArrayOfArrayOf_xsd_anyType"/></sequence></complexType><complexType name="CFCInvocationException"><sequence/></complexType></schema></wsdl:types>
<wsdl:message name="CFCInvocationException">
<wsdl:part name="fault" type="tns1:CFCInvocationException"/>
</wsdl:message>
<wsdl:message name="getDataRequest">
</wsdl:message>
<wsdl:message name="getDataResponse">
<wsdl:part name="getDataReturn" type="tns1:QueryBean"/>
</wsdl:message>
<wsdl:portType name="test">
<wsdl:operation name="getData">
<wsdl:input name="getDataRequest" message="impl:getDataRequest"/>
<wsdl:output name="getDataResponse" message="impl:getDataResponse"/>
<wsdl:fault name="CFCInvocationException" message="impl:CFCInvocationException"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="test.cfcSoapBinding" type="impl:test">
<wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="getData">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="getDataRequest">
<wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://DefaultNamespace"/>
</wsdl:input>
<wsdl:output name="getDataResponse">
<wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://DefaultNamespace"/>
</wsdl:output>
<wsdl:fault name="CFCInvocationException">
<wsdlsoap:fault use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://DefaultNamespace"/>
</wsdl:fault>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="testService">
<wsdl:port name="test.cfc" binding="impl:test.cfcSoapBinding">
<wsdlsoap:address location="http://testapp.localhost/test.cfc"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
And finally, the XML returned by the getData() method:
<wddxPacket version='1.0'><header/><data><recordset rowCount='3' fieldNames='foo,bar' type='coldfusion.sql.QueryTable'><field name='foo'><string>a</string><string>b</string><string>c</string></field><field name='bar'><string>1</string><string>2</string><string>3</string></field></recordset></data></wddxPacket>
I've got a Coldfusion Component (CFC) set up as a web service. It has one simple function, getData(), that returns a query (CF parlance for recordset). It seems that Laszlo can't automatically handle this complex datatype, even though it seems to be described in the WSDL. I hope someone can help me figure this out, since it would be great to be able to easily work with CFMX's native recordsets.
The specific error I'm getting is:
org.xml.sax.SAXException: Deserializing parameter 'getDataReturn': could not find deserializer for type {http://rpc.xml.coldfusion}QueryBean
Here's the Laszlo code (sorry, but I don't know how to make this format nicely):
<canvas debug="true" width="800" height="600" bgcolor="gray">
<debug x="15" y="15" width="415" height="500" />
<dataset name="myDset" />
<soap name="testSoap" wsdl="http://testapp.localhost/test.cfc?wsdl">
<method event="onload">
Debug.write('test soap service loaded');
Debug.inspect(this.proxy);
testSoap.getData.invoke();
</method>
<remotecall funcname="getData" dataobject="myDset">
<method event="ondata" args="value">
//debug.write('dataset:\n', value);
</method>
</remotecall>
</soap>
<text>This is my test app</text>
</canvas>
Here's the WSDL returned by CFMX:
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://DefaultNamespace" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns1="http://rpc.xml.coldfusion" xmlns:impl="http://DefaultNamespace" xmlns:intf="http://DefaultNamespace" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns="http://schemas.xmlsoap.org/wsdl/"><wsdl:types><schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://DefaultNamespace"><import namespace="http://schemas.xmlsoap.org/soap/encoding/"/><complexType name="ArrayOf_xsd_string"><complexContent><restriction base="soapenc:Array"><attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:string[]"/></restriction></complexContent></complexType><complexType name="ArrayOfArrayOf_xsd_anyType"><complexContent><restriction base="soapenc:Array"><attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:anyType[][]"/></restriction></complexContent></complexType></schema><schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://rpc.xml.coldfusion"><import namespace="http://schemas.xmlsoap.org/soap/encoding/"/><complexType name="QueryBean"><sequence><element name="columnList" nillable="true" type="impl:ArrayOf_xsd_string"/><element name="data" nillable="true" type="impl:ArrayOfArrayOf_xsd_anyType"/></sequence></complexType><complexType name="CFCInvocationException"><sequence/></complexType></schema></wsdl:types>
<wsdl:message name="CFCInvocationException">
<wsdl:part name="fault" type="tns1:CFCInvocationException"/>
</wsdl:message>
<wsdl:message name="getDataRequest">
</wsdl:message>
<wsdl:message name="getDataResponse">
<wsdl:part name="getDataReturn" type="tns1:QueryBean"/>
</wsdl:message>
<wsdl:portType name="test">
<wsdl:operation name="getData">
<wsdl:input name="getDataRequest" message="impl:getDataRequest"/>
<wsdl:output name="getDataResponse" message="impl:getDataResponse"/>
<wsdl:fault name="CFCInvocationException" message="impl:CFCInvocationException"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="test.cfcSoapBinding" type="impl:test">
<wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="getData">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="getDataRequest">
<wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://DefaultNamespace"/>
</wsdl:input>
<wsdl:output name="getDataResponse">
<wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://DefaultNamespace"/>
</wsdl:output>
<wsdl:fault name="CFCInvocationException">
<wsdlsoap:fault use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://DefaultNamespace"/>
</wsdl:fault>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="testService">
<wsdl:port name="test.cfc" binding="impl:test.cfcSoapBinding">
<wsdlsoap:address location="http://testapp.localhost/test.cfc"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
And finally, the XML returned by the getData() method:
<wddxPacket version='1.0'><header/><data><recordset rowCount='3' fieldNames='foo,bar' type='coldfusion.sql.QueryTable'><field name='foo'><string>a</string><string>b</string><string>c</string></field><field name='bar'><string>1</string><string>2</string><string>3</string></field></recordset></data></wddxPacket>