View Full Version : soap
sounddesignz
11-07-2004, 12:12 PM
hi there,
i'm trying to access a webservice (not public, sry) and get some exception (see at the end).
also, i'd like to know if there's a way to construct a call in 'real' xml instead of doing
var s = '<execute><request '+ model + '>' ...
(see reference->rpc->soap)
to get such a soap call sent:
<execute>
<request model="hoj.process-mydata">
<parameters>
<parameter name="mystring" value="10"/>
</parameters>
</request>
</execute>
finally, here we have the error mentioned earlier (the xml above belongs to the debugger message and is correct):
error: «string#0| XSD_ANYSIMPLETYPE : Exception stack: java.lang.NoSuchFieldError: XSD_ANYSIMPLETYPE at com.laszlosystems.remote.soap.LZDefaultTypeMapping .<init>(LZDefaultTypeMapping.java:115) at com.laszlosystems.remote.soap.LZDefaultTypeMapping .getSingleton(LZDefaultTypeMapping.java:90) at com.laszlosystems.remote.soap.LZSOAPService.<init>(LZSOAPService.java:115) at com.laszlosystems.remote.soap.WSDLParser.parseWSDL (WSDLParser.java:239) at com.laszlosystems.remote.soap.WSDLParser.parse(WSD LParser.java:92) at com.laszlosystems.remote.soap.WSDLParser.parse(WSD LParser.java:106) at com.laszlosystems.data.SOAPDataSource.fetchService (SOAPDataSource.java:314) at com.laszlosystems.data.SOAPDataSource.getService(S OAPDataSource.java:286) at com.laszlosystems.data.SOAPDataSource.getData(SOAP DataSource.java:138) at com.laszlosystems.data.DataSource.getAsSWF(DataSou rce.java:104) at com.laszlosystems.servlets.responders.ResponderCac he.respondImpl(ResponderCache.java:369) at com.laszlosystems.servlets.responders.R...»
thanks,
nils
pablo
11-08-2004, 10:54 AM
Hi nils,
also, i'd like to know if there's a way to construct a call in 'real' xml instead of doing
var s = '<execute><request '+ model + '>' ...
(see reference->rpc->soap)
Not at the moment. A future relase will address this issue.
Regarding your stack trace, do you get it for all webservices or your webservice in particular? If it's yours, would it be possible to post the WSDL?
Thanks,
pablo
sounddesignz
11-08-2004, 11:01 PM
hi pablo,
sure:
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://localhost/default/services/ModelService" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://localhost/default/services/ModelService" xmlns:intf="http://localhost/default/services/ModelService" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns1="http://server.axis.comm.keel.org" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><wsdl:types><schema targetNamespace="http://server.axis.comm.keel.org" xmlns="http://www.w3.org/2001/XMLSchema"><element name="execute" type="xsd:anyType"/></schema><schema targetNamespace="http://localhost/default/services/ModelService" xmlns="http://www.w3.org/2001/XMLSchema"><element name="executeReturn" type="xsd:anyType"/></schema></wsdl:types>
<wsdl:message name="executeRequest">
<wsdl:part element="tns1:execute" name="part"/>
</wsdl:message>
<wsdl:message name="executeResponse">
<wsdl:part element="impl:executeReturn" name="executeReturn"/>
</wsdl:message>
<wsdl:portType name="ModelService">
<wsdl:operation name="execute">
<wsdl:input message="impl:executeRequest" name="executeRequest"/>
<wsdl:output message="impl:executeResponse" name="executeResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="ModelServiceSoapBinding" type="impl:ModelService">
<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="execute">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="executeRequest">
<wsdlsoap:body namespace="http://server.axis.comm.keel.org" use="literal"/>
</wsdl:input>
<wsdl:output name="executeResponse">
<wsdlsoap:body namespace="http://localhost/default/services/ModelService" use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="ModelServiceService">
<wsdl:port binding="impl:ModelServiceSoapBinding" name="ModelService">
<wsdlsoap:address location="http://localhost/default/services/ModelService"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Behind that service lies a class that invokes other classes which are similar to Struts' Action classes. it takes the xml call and searches for attribute 'model' and attributes (name/value pair) of nodes 'parameters->parameter'. it then constructs an ordinary request and invokes the model. the result gets wrapped into xml and is then sent back via soap. i've tested it with other clients, e.g. flex.
pablo
11-10-2004, 09:43 AM
Hi Nils,
Can you tell me when you get the stack trace? Does it happen during startup or when you're invoking a method? Your WSDL loads fine.
I'd like to replicate your problem. It might be helpful to post the bits of your code that make the SOAP call.
Thanks,
pablo
sounddesignz
12-07-2004, 02:17 PM
hello pablo,
i am sorry it took that long for me to reply, last month was pretty busy.
the trace occurs upon loading/refreshing the lzx. all following stack traces throw this (upon clicking the button):
execute error: could not invoke; is remote service loaded?
i am a bit irritated that it seems the webservice is invoked upon loading the lzx since i get the trace of the debug.write(s) i inserted in the ws method. see complete lzx code below:
<canvas width="500" height="500">
<debug x="15" y="15" width="315" height="400" />
<soap name="ws"
wsdl="http://localhost/default/services/ModelService?wsdl">
<!-- Method to make a document for SOAP message requests -->
<method name="makedoc" args="func, av">
<![CDATA[
if (func == null) return;
var s = '<' + func + '>' +
'<request model="hoj.process-mydata">' +
'<parameters>' +
'<parameter name="mystring" value="' + av + '"/>' +
'</parameters>' +
'</request>' +
'</' + func + '>';
debug.write(s);
return s;
]]>
</method>
<method event="onload">
// make buttons visible once SOAP object is loaded
canvas.buttons.setAttribute('visible', true);
Debug.write('Amazon soap service loaded');
Debug.inspect(this.proxy);
</method>
<method event="onerror" args="error">
debug.write('error:', error);
</method>
<method event="ontimeout" args="error">
debug.write('timeout:', error);
</method>
<method event="ondata" args="value">
debug.write(value);
result.setText(value);
</method>
<remotecall funcname="execute">
<param value="${ canvas.ws.makedoc(parent.name, mystring.text) }" />
</remotecall>
</soap>
<window x="20" y="20" width="200" height="250" name="buttons"
title="Simple Window" resizable="true">
<simplelayout axis="y" spacing="10" />
<text>Enter some text:</text><edittext id="mystring" text="test"/>
<button text="add" onclick="canvas.ws.execute.invoke()" />
<text>result:</text><text id="result"/>
</window>
</canvas>
------------------------------------
i don't know if it helps, but a working flex version is this (know your 'enemy':):
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml">
<mx:WebService id="ws" wsdl="http://localhost/default/services/ModelService?wsdl">
<mx:operation name="execute" result="alert(event.result)" resultFormat="xml">
<mx:request format="xml">
<request model="hoj.process-mydata">
<parameters>
<parameter name="mystring" value="{mystring.text}"/>
</parameters>
</request>
</mx:request>
</mx:operation>
</mx:WebService>
<mx:Form>
<mx:FormItem label="mystring" required="true">
<mx:TextInput id="mystring" width="200"/>
</mx:FormItem>
<mx:FormItem>
<mx:Button label="Add" click="ws.execute.send()"/>
</mx:FormItem>
</mx:Form>
<mx:Label text="{ws.execute.result}" width="400"/>
<mx:Repeater id="errorList" dataProvider="{ws.execute.result.model.errors.item}">
<mx:Label text="{errorList.currentItem.message}"/>
</mx:Repeater>
</mx:Application>
i appreciate your interest/help in tracking this down,
Nils
ps: if the java files behind the ws help, i can post them
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.