kathryn
11-07-2004, 06:52 PM
I'm attempting to write a small Laszlo client for a webservice (using Apache Axis) that searches through metadata of my photographs.
The web-based application is here:
http://www.photospace.org/kathryn
The wsdl file is here:
http://www.photospace.org/kathryn/services/Photospace?wsdl
I've successfully used this with Flash 7's SOAP implementation and Macromedia Flex, but with Laszlo I'm getting some sort of SAXException and I think it might be choking on the complex data types.
My LZX:
<canvas debug="true" height="400">
<simplelayout axis="y" spacing="5"/>
<text>Search Photospace:</text>
<edittext id="query" width="200">icelandtour</edittext>
<button text="submit" onclick="canvas.photospace.searchCall.invoke(); debug.write('invoking search');" />
<debug x="15" y="100" width="415" height="200" />
<soap name="photospace" wsdl="http://www.photospace.org/kathryn/services/Photospace?wsdl">
<method event="onload">
Debug.write('photospace soap service loaded');
Debug.write('proxy:');
Debug.inspect(this.proxy);
Debug.write('----------------');
Debug.write('photospace proto:');
Debug.inspect(photospace.proto)
Debug.write('----------------');
Debug.write('SearchResult proto:');
Debug.inspect(photospace.proto.SearchResult)
Debug.write('SearchResult members are:');
Debug.inspect(photospace.proto.SearchResult.member s)
</method>
<method event="onerror" args="error">
debug.write('error:', error);
</method>
<remotecall name="searchCall" funcname="Search">
<param value="${query.getText()}" />
<param value="1"/>
<param value="0"/>
<param value="10"/>
</remotecall>
</soap>
</canvas>
First, the debugging of the SOAP client gives me:
photospace soap service loaded
proxy:
«object#0| {}» {
search: «function| [type Function]»
get: «function| [type Function]»
browse: «function| [type Function]»
}
----------------
photospace proto:
----------------
SearchResult proto:
photospace.lzx:21: reference to undefined property 'SearchResult'
SearchResult members are:
photospace.lzx:23: reference to undefined property 'SearchResult'
photospace.lzx:23: undefined object does not have a property 'members'
photospace.lzx:23: reference to undefined property 'members'
----------------
So it's not able to inspect the service's proto at all.
Then, when I hit search, I get an error:
"org.xml.sax.SAXException: Deserializing parameter 'searchReturn': could not find deserializer for type {urn:Photospace}SearchResult. When I dug up the log file from lps-2.2\WEB-INF\lps\work\logs\lps.log, I see an exception beginning with:
05 Nov 2004 01:03:21 (127.0.0.1 366) ERROR soap.SchemaParser - skipping a complexType: only support single <restriction> in <complexContent> element
java.lang.Exception: only support single <restriction> in <complexContent> element
at com.laszlosystems.remote.soap.SchemaParser.checkCo mplexContent(SchemaParser.java:140)
at com.laszlosystems.remote.soap.SchemaParser.getComp lexType(SchemaParser.java:115)
We've played around with simpler examples and can get an Axis service to return a simple string, or even arrays of strings or simple objects. But we've been unable to get Laszlo to handle the return of "typed" responses, even though the examples, such as Google, returns typed responses:
http://api.google.com/GoogleSearch.wsdl
One difference we see is that Google has <ComplexType><all> while Axis is using <ComplexType><sequence>
Any ideas on what could be going on? This seems to work in every other web service client we've tried, so we're a bit stuck and I'm new to Laszlo and especially debugging issues on it.
The web-based application is here:
http://www.photospace.org/kathryn
The wsdl file is here:
http://www.photospace.org/kathryn/services/Photospace?wsdl
I've successfully used this with Flash 7's SOAP implementation and Macromedia Flex, but with Laszlo I'm getting some sort of SAXException and I think it might be choking on the complex data types.
My LZX:
<canvas debug="true" height="400">
<simplelayout axis="y" spacing="5"/>
<text>Search Photospace:</text>
<edittext id="query" width="200">icelandtour</edittext>
<button text="submit" onclick="canvas.photospace.searchCall.invoke(); debug.write('invoking search');" />
<debug x="15" y="100" width="415" height="200" />
<soap name="photospace" wsdl="http://www.photospace.org/kathryn/services/Photospace?wsdl">
<method event="onload">
Debug.write('photospace soap service loaded');
Debug.write('proxy:');
Debug.inspect(this.proxy);
Debug.write('----------------');
Debug.write('photospace proto:');
Debug.inspect(photospace.proto)
Debug.write('----------------');
Debug.write('SearchResult proto:');
Debug.inspect(photospace.proto.SearchResult)
Debug.write('SearchResult members are:');
Debug.inspect(photospace.proto.SearchResult.member s)
</method>
<method event="onerror" args="error">
debug.write('error:', error);
</method>
<remotecall name="searchCall" funcname="Search">
<param value="${query.getText()}" />
<param value="1"/>
<param value="0"/>
<param value="10"/>
</remotecall>
</soap>
</canvas>
First, the debugging of the SOAP client gives me:
photospace soap service loaded
proxy:
«object#0| {}» {
search: «function| [type Function]»
get: «function| [type Function]»
browse: «function| [type Function]»
}
----------------
photospace proto:
----------------
SearchResult proto:
photospace.lzx:21: reference to undefined property 'SearchResult'
SearchResult members are:
photospace.lzx:23: reference to undefined property 'SearchResult'
photospace.lzx:23: undefined object does not have a property 'members'
photospace.lzx:23: reference to undefined property 'members'
----------------
So it's not able to inspect the service's proto at all.
Then, when I hit search, I get an error:
"org.xml.sax.SAXException: Deserializing parameter 'searchReturn': could not find deserializer for type {urn:Photospace}SearchResult. When I dug up the log file from lps-2.2\WEB-INF\lps\work\logs\lps.log, I see an exception beginning with:
05 Nov 2004 01:03:21 (127.0.0.1 366) ERROR soap.SchemaParser - skipping a complexType: only support single <restriction> in <complexContent> element
java.lang.Exception: only support single <restriction> in <complexContent> element
at com.laszlosystems.remote.soap.SchemaParser.checkCo mplexContent(SchemaParser.java:140)
at com.laszlosystems.remote.soap.SchemaParser.getComp lexType(SchemaParser.java:115)
We've played around with simpler examples and can get an Axis service to return a simple string, or even arrays of strings or simple objects. But we've been unable to get Laszlo to handle the return of "typed" responses, even though the examples, such as Google, returns typed responses:
http://api.google.com/GoogleSearch.wsdl
One difference we see is that Google has <ComplexType><all> while Axis is using <ComplexType><sequence>
Any ideas on what could be going on? This seems to work in every other web service client we've tried, so we're a bit stuck and I'm new to Laszlo and especially debugging issues on it.