[Montag-users] Testing openlaszlo SOAP client -> XQueryService -> eXist DB
Status: Beta
Brought to you by:
sbtourist
|
From: <dl....@nt...> - 2005-08-07 14:24:16
|
This experiment is an attempt to invoke montag XQueryService -> eXist DB from a SOAP client in openlaszlo platform running on tomcat server. Test Requirement: Install lps-3.0.2 servlet in %tomcat_home%\webapps\ http://www.openlaszlo.com/download/ http://www.laszlosystems.com/developers/download/ ..... servlet only 10 MB _________________________________________ openlaszlo SOAP documents here .. http://www.laszlosystems.com/lps-2.2/docs/guide/rpc-soap.html#d0e23146 Example 40.10 XML schema array pattern The Laszlo SOAP WSDL parser expects the XML schema array pattern to look like: <xsd:complexType name="ARRAY_NAME"> <xsd:complexContent> <xsd:restriction base="soapenc:Array"> <xsd:attribute ref="soapenc:arrayType" wsdl:arrayType="ARRAY_TYPE[]"/> </xsd:restriction> </xsd:complexContent> </xsd:complexType> _________________________________________ Extract of XML schema from montag XQueryService.wsdl <wsdl:types> <schema elementFormDefault="qualified" targetNamespace="http://montag.sourceforge.net/ns/wsdl/local/types" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:types="http://montag.sourceforge.net/ns/wsdl/local/types"> <element name="query"> <complexType> <sequence> <element name="collection" type="xsd:string"/> <element name="query" type="xsd:string"/> <element maxOccurs="unbounded" minOccurs="0" name="namespaces" type="xsd:string"/> <element maxOccurs="unbounded" minOccurs="0" name="vars" type="xsd:string"/> </sequence> </complexType> </element> <element name="queryResponse"> <complexType> <sequence> <element name="queryReturn" type="xsd:string"/> </sequence> </complexType> </element> <element name="username"> <simpleType> <restriction base="xsd:string"/> </simpleType> </element> <element name="password"> <simpleType> <restriction base="xsd:string"/> </simpleType> </element> <element name="MontagSOAPFault"> <complexType> <sequence/> </complexType> </element> </schema> </wsdl:types> _________________________________________ Invoking the webservice and monitoring POST session using Microsoft Fiddler HTTP Debugging Proxy this is the textview of the POST fpv=7%2E19&lzr=swf6&proxied=true&lzpostbody=%3Ce%3E%3Ch%3E%3Cusernam e%3Eadmin%3C%2Fusername%3E%3Cpassword%3E%3C%2Fpassword%3E%3C% 2Fh%3E%3Cb%3E%3Cparams%3E%3Cparam%3E%253Cquery%2520xmlns%253A xsi%253D%2522http%253A%252F%252Fwww%252Ew3%252Eorg%252F2001%252 FXMLSchema%252Dinstance%2522%253E%253Cusername%253E%253C%252Fus ername%253E%253Cpassword%253E%253C%252Fpassword%253E%253Ccollectio n%253Eshakespeare%252Fplays%253C%252Fcollection%253E%253Cquery%253Ef or%2520%2524speech%2520in%2520%252F%252FSPEECH%255BSPEAKER%252 0%2526amp%253B%253D%2520%2527witch%2527%2520and%2520near%2528%2 52E%252C%2520%2527fenny%2520snake%2527%2529%255D%2520return%2520 %2524speech%253C%252Fquery%253E%253Cnamespaces%253E0%253C%252Fn amespaces%253E%253Cvars%253E0%253C%252Fvars%253E%253C%252Fquery %253E%3C%2Fparam%3E%3C%2Fparams%3E%3C%2Fb%3E%3C%2Fe%3E&opst yle=document&operation=query&port=XQueryService&service=XQueryServiceService &wsdl=http%3A%2F%2Flocalhost%3A8080%2Fmontag%2Fservices%2FXQueryServi ce%3FWSDL&request=invoke&url=soap%3A%2F%2Fsoap&reqtype=POST&lzt=data &ccache=false&cache=false&sendheaders=false _________________________________________ This POST decodes as follows ..( note the openlaszlo arguments at top and tail) fpv=7.19 &lzr=swf6 &proxied=true &lzpostbody= <e> <h> <username>admin</username> <password></password> </h> <b> <params> <param> <query xmlns:xsi="http://www.w3.org/2001/XMLSchema%2Dinstance"> <username></username> <password></password> <collection>shakespeare/plays</collection> <query>for $speech in //SPEECH[SPEAKER &= 'witch' and near(., 'fenny snake')] return $speech</query> <namespaces>0</namespaces> <vars>0</vars> </query> </param> </params> </b> </e> &opstyle=document&operation=query &port=XQueryService&service=XQueryServiceService &wsdl=http://localhost:8080/montag/services/XQueryService?WSDL &request=invoke&url=soap://soap&reqtype=POST &lzt=data &ccache=false &cache=false &sendheaders=false _________________________________________ However .. I am getting an AxisFault report in the SOAPclient log (the SOAP message POST does not reach the montag log and there is no response message) "<soapenv:Envelope 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"> <soapenv:Body> <soapenv:Fault> <faultcode>soapenv:Server.userException</faultcode> <faultstring>org.xml.sax.SAXException: operation description is missing parameter description!</faultstring> <detail> <ns1:hostname xmlns:ns1="http://xml.apache.org/axis/">mylocalhostname</ns1:hostname> </detail> </soapenv:Fault> </soapenv:Body> </soapenv:Envelope>" _________________________________________ Can you see any montag incompatibility in the openlaszlo SOAP message which results in SOAP message not being processed by montag .. not even being logged? _________________________________________ To demonstrate that montag/exist is setup correctly, I can invoke the same web service using a PHP5 SOAP client .. which correctly returns this test response .. QUERY PARAMETERS ARRAY: username: password: collection: shakespeare/plays query: for $speech in //SPEECH[SPEAKER &= 'witch' and near(., 'fenny snake')] return $speech namespaces: 0 vars: 0 SOAP FUNCTIONS: array(1) { [0]=> string(38) "queryResponse query(query $parameters)" } SOAP TYPES: array(5) { [0]=> string(85) "struct query { string collection; string query; string namespaces; string vars; }" [1]=> string(45) "struct queryResponse { string queryReturn; }" [2]=> string(15) "string username" [3]=> string(15) "string password" [4]=> string(26) "struct MontagSOAPFault { }" } LAST REQUEST HEADERS: string(196) "POST /montag/services/XQueryService HTTP/1.1 Host: localhost:8080 Connection: Keep-Alive User-Agent: PHP SOAP 0.1 Content-Type: text/xml; charset=utf-8 SOAPAction: "" Content-Length: 472 " LAST REQUEST: string(472) " shakespeare/playsfor $speech in //SPEECH[SPEAKER &= 'witch' and near(., 'fenny snake')] return $speech00 " LAST RESPONSE HEADERS: string(147) "HTTP/1.1 200 OK Content-Type: text/xml;charset=utf-8 Transfer- Encoding: chunked Date: Sun, 07 Aug 2005 14:02:25 GMT Server: Apache- Coyote/1.1 " LAST RESPONSE: string(1788) "<?xml version="1.0" encoding="UTF-8"?> <montag:result-set xmlns:montag="http://montag.sourceforge.net/ns/result-set" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://montag.sourceforge.net/ns/result-set http://montag.sourceforge.net/schema/resultSet.xsd"> <montag:content> <SPEECH> <SPEAKER> Second <exist:match xmlns:exist="http://exist.sourceforge.net/NS/exist">Witch</exist:match> </SPEAKER> <LINE> Fillet of a <exist:match xmlns:exist="http://exist.sourceforge.net/NS/exist">fenny</exist:match> <exist:match xmlns:exist="http://exist.sourceforge.net/NS/exist">snake</exist:match> , </LINE> <LINE>In the cauldron boil and bake;</LINE> <LINE>Eye of newt and toe of frog,</LINE> <LINE>Wool of bat and tongue of dog,</LINE> <LINE>Adder's fork and blind-worm's sting,</LINE> <LINE>Lizard's leg and owlet's wing,</LINE> <LINE>For a charm of powerful trouble,</LINE> <LINE>Like a hell-broth boil and bubble.</LINE> </SPEECH> </montag:content> </montag:result-set> " |