Re: Kuddi: xmlrpc'ing vectors
"Thomas Koch" <[email protected]> Fri, 7 Mar 2003 10:08:34 +0100
| Newsgroups | gmane.comp.java.enhydra.kxmlrpc |
|---|---|
| Organization | OrbiTeam Software GmbH http://www.orbiteam.de |
| Message-ID | <[email protected]> |
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 some 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]]On > > 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="1.0" encoding="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 = 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 = new Vector(); > > > v.add("String 1"); > > > v.add("String 2"); > > > return v; > > > } > > > > > > public void service(HttpServletRequest req, > > HttpServletResponse > > > res)throws ServletException, IOException{ > > > byte[] result = server.execute(req.getInputStream ()); > > > res.setContentType("text/xml"); > > > res.setContentLength(result.length); > > > OutputStream output = 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 >