AW: Kuddi: xmlrpc'ing vectors
"Henrik Plate \(GMX\)" <[email protected]> Sat, 8 Mar 2003 14:54:07 +0100
| Newsgroups | gmane.comp.java.enhydra.kxmlrpc |
|---|---|
| Message-ID | <[email protected]> |
Great, the fixed parser works and vectors could be send from Apache XmlRp= c 1.1 to kXmlRpc 0.6. Thank you Thomas. Yet, I don't have much experience with kXmlRpc, but my first impressions = are good. One could easily transfer the most important data types to MIDlets. Due to restricted resources and the limited J2ME API, the transfer of cus= tom objects is difficult anyway. I wanted to do that first, but to transfer server-side objects to the MIDlet - and hence work with the same classes = on server- and client-side, you've got to keep them very simple (e.g. no use= of floats). For that reason, I decided to use simple String-based data-objec= ts on the MIDlet side, filled via kXmlRpc. In general, I miss a more concrete comparison of kSOAP and kXmlRpc. There= 's an article in the german JavaMagazin (edition 01/03) about both technologies, but it just repeats the (old) examples given on the Enhydra website ans stays unprecise. For example, I'd like to know the impact of both technologies on the invo= ice of my mobile provider. It's a pity, that the kXMLRPC project seems to be not supported any longer... hopefully the article could help reanimating it :-) Regards, Henrik > -----Urspr=FCngliche Nachricht----- > Von: Thomas Koch [mailto:[email protected]] > Gesendet: Freitag, 7. M=E4rz 2003 10:09 > An: [email protected] > Cc: [email protected] > Betreff: Re: Kuddi: xmlrpc'ing vectors > > > When starting our tests we used several 'online' XML-RPC services and > some worked with kxmlrpc lib while others didn't. I guess there are som= e > slight differences in the output format of the various server-side > XML-RPC implementations. kxmlrpc lib especially gets confused by extra > whitespaces (which are allowed by the standard I believe). > > We're using the Python (2.2) xmlrpc library at the server backend. > see http://www.pythonware.com/products/xmlrpc/ > > Regards > Thomas > > ----- Original Message ----- > From: "Nick Randell" <[email protected]> > To: <[email protected]> > Cc: <[email protected]> > Sent: Friday, March 07, 2003 9:38 AM > Subject: RE: Kuddi: xmlrpc'ing vectors > > > > I've used this successfully to do an MP3 player using the Lightfoot > Java > > processor that talks to JReceiver. This is all using J2ME cldc > technology > > and works great! > > > > Regards > > > > Nick > > > > > > > -----Original Message----- > > > From: [email protected] [mailto:[email protected]]O= n > > > Behalf Of Thomas Koch > > > Sent: 07 March 2003 08:16 > > > To: [email protected] > > > Cc: [email protected] > > > Subject: Re: Kuddi: xmlrpc'ing vectors > > > > > > > > > Henrik, > > > we've encoutered the same problem when starting our tests with the > > > kXmlRpc lib and found some fixes for this. I posted an according > message > > > to the list in September last year.It's attached for your > information. > > > > > > As there was no response on the list and also no updates of code or > list > > > archive I do now assume that the kxml-rpc project is 'on-hold'. Any > > > 'official' comment from the kxml-rpc maintainers would be highly > > > welcome. > > > > > > BTW, we're also doing work with kxml-rpc lib and J2ME midlets - I'd > be > > > interested in experience of other users with that technology > > > combination. > > > > > > kind regards, > > > > > > Thomas Koch > > > __________________________________________________________ > > > Thomas Koch [email protected] > > > OrbiTeam Software GmbH http://www.orbiteam.de > > > Endenicher Allee 35 phone: +49 228 4101400 > > > 53121 Bonn fax: +49 228 4101401 > > > Germany > > > > > > ----- Original Message ----- > > > From: "Henrik Plate (GMX)" <[email protected]> > > > To: <[email protected]> > > > Sent: Thursday, March 06, 2003 5:43 PM > > > Subject: Kuddi: xmlrpc'ing vectors > > > > > > > > > > Hi everybody! > > > > > > > > Beside (k)XMLRPC is really lightweight, easy to use/learn and > > > efficient I do > > > > have some problems transfering vectors from a XMLRPC server to a > > > MIDlet. > > > > > > > > I've got a servlet (source below, modified Apache class > > > > org.apache.xmlrpc.XmlRpcProxyServlet) which acts as a XMLRPC > server. > > > The > > > > servlet itself is registered as the default handler and got the > method > > > > getProviders, which simply returns a newly constructed Vector. > Other > > > methods > > > > like getServerInfo, which returns a String, succeed. > > > > > > > > When I call the servlet with a J2SE client (slightly modified > Apache > > > > example) the resulting object is a Vector. Fine. > > > > > > > > When I call the method from a MIDlet, the Wireless Toolkit prints > the > > > > following exception: > > > > > > > > org.kxml.io.ParseException: unexpected: StartTag <data> line: -1 > attr: > > > null > > > > @-1:-1 > > > > at org.kxml.parser.AbstractXmlParser.read(+53) > > > > at org.kxmlrpc.XmlRpcParser.parseValue(+15) > > > > at org.kxmlrpc.XmlRpcParser.parseArray(+23) > > > > at org.kxmlrpc.XmlRpcParser.parseValue(+241) > > > > at org.kxmlrpc.XmlRpcParser.parseParams(+46) > > > > at org.kxmlrpc.XmlRpcParser.parseResponse(+144) > > > > at org.kxmlrpc.XmlRpcClient.execute(+200) > > > > at midlet.ServerConnection.callMethod(+15) > > > > at midlet.XmlRpcTestControl$1.run(+18) > > > > > > > > The via HTTP transfered xml response of the servlet is > > > > > > > > <?xml version=3D"1.0" encoding=3D"ISO-8859-1"?> > > > > <methodResponse> > > > > <params> > > > > <param> > > > > <value> > > > > <array> > > > > <data> > > > > <value>String 1</value> > > > > <value>String 2</value> > > > > </data> > > > > </array> > > > > </value> > > > > </param> > > > > </params> > > > > </methodResponse> > > > > > > > > Seems to be OK. > > > > > > > > Does kXMLRPC miss the implementation of Vector transfers? I can't > > > imagine, > > > > cause the parser fails at the data-, not the array-tag. Is it > > > versioning > > > > problem? > > > > > > > > Here's my enviroment: > > > > > > > > kXMLRPC 0.6 > > > > XMLRPC 1.1 from Apache > > > > J2SE 1.4.1 > > > > Tomcat 4.0.1 > > > > > > > > Relevant part of the servlet source: > > > > > > > > import org.apache.xmlrpc.*; > > > > > > > > public class XmlRpcServlet extends HttpServlet { > > > > > > > > // The xml-rpc server. > > > > final XmlRpcServer server =3D new XmlRpcServer(); > > > > > > > > public void init(ServletConfig config)throws > ServletException{ > > > > > > > > // Config the xml-rpc server. > > > > XmlRpc.setDebug(true); > > > > server.addHandler("$default", this); > > > > } > > > > > > > > public String getServerInfo() { return "XmlRpcServlet"; } > > > > //"$Name$"; } > > > > > > > > public Vector getProviders() { > > > > final Vector v =3D new Vector(); > > > > v.add("String 1"); > > > > v.add("String 2"); > > > > return v; > > > > } > > > > > > > > public void service(HttpServletRequest req, > > > HttpServletResponse > > > > res)throws ServletException, IOException{ > > > > byte[] result =3D server.execute(req.getInputStream (= )); > > > > res.setContentType("text/xml"); > > > > res.setContentLength(result.length); > > > > OutputStream output =3D res.getOutputStream(); > > > > output.write(result); > > > > output.flush(); > > > > } > > > > } > > > > > > > > Another question: If a XMLRPC call fails, the XmlRpcClient class > > > returns the > > > > result of the previous call. Is that desireable? Not sure of this. > > > > > > > > Greetings und thanks in advance, > > > > Henrik > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > Kuddi mailing list > > > > [email protected] > > > > http://support.enhydra.org/mailman/listinfo.cgi/kxmlrpc > > > > > > > > > > > > > _______________________________________________ > > Kuddi mailing list > > [email protected] > > http://support.enhydra.org/mailman/listinfo.cgi/kxmlrpc > > >