From xmlrpcadamswilliam@example.net Tue Sep 05 22:34:56 2006 Return-Path: <xmlrpcadamswilliam@example.net> Delivered-To: adamswilliam@example.net Received: (qmail 96309 invoked from network); 5 Sep 2006 22:34:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 5 Sep 2006 22:34:54 -0000 Received: (qmail 59281 invoked by uid 500); 5 Sep 2006 22:34:54 -0000 Delivered-To: adamswilliam@example.net Received: (qmail 59260 invoked by uid 500); 5 Sep 2006 22:34:53 -0000 Mailing-List: contact adamswilliam@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:adamswilliam@example.net> List-Unsubscribe: <mailto:adamswilliam@example.net> List-Post: <mailto:adamswilliam@example.net> List-Id: <xmlrpc-auto.ws.apache.org> Reply-To: adamswilliam@example.net Delivered-To: mailing list adamswilliam@example.net Received: (qmail 59251 invoked by uid 99); 5 Sep 2006 22:34:53 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Sep 2006 15:34:53 -0700 X-ASF-Spam-Status: No, hits=0.1 required=10.0 tests=SUBJECT_NOVOWEL X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO brutus.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Sep 2006 15:34:52 -0700 Received: from brutus (localhost [83.161.120.155]) by brutus.apache.org (Postfix) with ESMTP id 538E871430A for <adamswilliam@example.net>; Tue, 5 Sep 2006 22:31:22 +0000 (GMT) Message-ID: <11076928.1157495482339.JavaMail.jira@brutus> Date: Tue, 5 Sep 2006 15:31:22 -0700 (PDT) From: "sreedhar somishetty (JIRA)" <adamswilliam@example.net> To: adamswilliam@example.net Subject: [jira] Created: (XMLRPC-110) org.apache.xmlrpc.XmlRpcClientException: Error decoding XML-RPC response MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N org.apache.xmlrpc.XmlRpcClientException: Error decoding XML-RPC response ------------------------------------------------------------------------ Key: XMLRPC-110 URL: http://issues.apache.org/jira/browse/XMLRPC-110 Project: XML-RPC Issue Type: Bug Affects Versions: 2.0 Environment: client side: java, xml-rpc 2.0 server side: activeperl 5.8.6 , IIS6 on windows 2003 Reporter: sreedhar somishetty Hi , I tried xmlrpc communication between java client and a PERL( active perl 5.8.6 installed on tomcat server) server and that worked fine. But when I try the same activeperl 5.8.6 with IIS6 installed on windows 2003 I am getting an error . I would like to know what is causing this problem org.apache.xmlrpc.XmlRpcClientException: Error decoding XML-RPC adamswilliam@example.net(XmlRpcClientResponseProcessor.java:78) at org.apache.xmlrpc.XmlRpcClientWorker.execute(XmlRpcClientWorker.java:72) at org.apache.xmlrpc.XmlRpcClient.execute(XmlRpcClient.java:193) at org.apache.xmlrpc.XmlRpcClient.execute(XmlRpcClient.java:184) at org.apache.xmlrpc.XmlRpcClient.execute(XmlRpcClient.java:177) at perlClientExample.XmlRpcClientExample.say_hello(XmlRpcClientExample.java:33) at perlClientExample.XmlRpcClientExample.main(XmlRpcClientExample.java:92) Caused by: org.apache.xmlrpc.XmlRpcClientException: Error decoding XML-RPC exception adamswilliam@example.net(XmlRpcClientResponseProcessor.java:109) at org.apache.xmlrpc.XmlRpcClientResponseProcessor.decodeResponse(XmlRpcClientResponseProcessor.java:69) ... 6 more Caused by: java.lang.NumberFormatException: For input string: "Client" at java.lang.NumberFormatException.forInputString(Unknown Source) at java.lang.Integer.parseInt(Unknown Source) at java.lang.Integer.parseInt(Unknown Source) at org.apache.xmlrpc.XmlRpcClientResponseProcessor.decodeException(XmlRpcClientResponseProcessor.java:102) ... 7 more Thanks in advance -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira From xmlrpcadamswilliam@example.net Wed Sep 06 08:02:03 2006 Return-Path: <xmlrpcadamswilliam@example.net> Delivered-To: adamswilliam@example.net Received: (qmail 17529 invoked from network); 6 Sep 2006 08:02:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 6 Sep 2006 08:02:02 -0000 Received: (qmail 32497 invoked by uid 500); 6 Sep 2006 08:02:02 -0000 Delivered-To: adamswilliam@example.net Received: (qmail 32378 invoked by uid 500); 6 Sep 2006 08:02:01 -0000 Mailing-List: contact adamswilliam@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:adamswilliam@example.net> List-Unsubscribe: <mailto:adamswilliam@example.net> List-Post: <mailto:adamswilliam@example.net> List-Id: <xmlrpc-auto.ws.apache.org> Reply-To: adamswilliam@example.net Delivered-To: mailing list adamswilliam@example.net Received: (qmail 32367 invoked by uid 99); 6 Sep 2006 08:02:01 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Sep 2006 01:02:01 -0700 X-ASF-Spam-Status: No, hits=0.1 required=10.0 tests=SUBJECT_NOVOWEL X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO brutus.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Sep 2006 01:01:58 -0700 Received: from brutus (localhost [83.161.120.155]) by brutus.apache.org (Postfix) with ESMTP id 09FD97142D5 for <adamswilliam@example.net>; Wed, 6 Sep 2006 07:58:28 +0000 (GMT) Message-ID: <18192620.1157529508037.JavaMail.jira@brutus> Date: Wed, 6 Sep 2006 00:58:28 -0700 (PDT) From: "Jochen Wiedmann (JIRA)" <adamswilliam@example.net> To: adamswilliam@example.net Subject: [jira] Resolved: (XMLRPC-110) org.apache.xmlrpc.XmlRpcClientException: Error decoding XML-RPC response In-Reply-To: <11076928.1157495482339.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/XMLRPC-110?page=all ] Jochen Wiedmann resolved XMLRPC-110. ------------------------------------ Resolution: Invalid > Caused by: java.lang.NumberFormatException: For input string: "Client" > at java.lang.NumberFormatException.forInputString(Unknown Source) > at java.lang.Integer.parseInt(Unknown Source) > at java.lang.Integer.parseInt(Unknown Source) > at org.apache.xmlrpc.XmlRpcClientResponseProcessor.decodeException(XmlRpcClientResponseProcessor.java:102) > ... 7 more This smells *very* much like an error in the servers response, for example <value><i4>Client</i4></value> or something like that. Use a tool like tcpmon or wireshark to log the servers response and most possibly you'll find the answer there. Further discussion on the mailing list adamswilliam@example.net, please. Should it turn out that I am wrong, and the bug is in Apache XML-RPC, you are of course free to reopen this bug. > org.apache.xmlrpc.XmlRpcClientException: Error decoding XML-RPC response > ------------------------------------------------------------------------ > > Key: XMLRPC-110 > URL: http://issues.apache.org/jira/browse/XMLRPC-110 > Project: XML-RPC > Issue Type: Bug > Affects Versions: 2.0 > Environment: client side: java, xml-rpc 2.0 > server side: activeperl 5.8.6 , IIS6 on windows 2003 > Reporter: sreedhar somishetty > > Hi , > I tried xmlrpc communication between java client and a PERL( active perl 5.8.6 installed on tomcat server) server and that worked fine. But when I try the same activeperl 5.8.6 with IIS6 installed on windows 2003 I am getting an error . I would like to know what is causing this problem > org.apache.xmlrpc.XmlRpcClientException: Error decoding XML-RPC response > at org.apache.xmlrpc.XmlRpcClientResponseProcessor.decodeResponse(XmlRpcClientResponseProcessor.java:78) > at org.apache.xmlrpc.XmlRpcClientWorker.execute(XmlRpcClientWorker.java:72) > at org.apache.xmlrpc.XmlRpcClient.execute(XmlRpcClient.java:193) > at org.apache.xmlrpc.XmlRpcClient.execute(XmlRpcClient.java:184) > at org.apache.xmlrpc.XmlRpcClient.execute(XmlRpcClient.java:177) > at perlClientExample.XmlRpcClientExample.say_hello(XmlRpcClientExample.java:33) > at perlClientExample.XmlRpcClientExample.main(XmlRpcClientExample.java:92) > Caused by: org.apache.xmlrpc.XmlRpcClientException: Error decoding XML-RPC exception response > at org.apache.xmlrpc.XmlRpcClientResponseProcessor.decodeException(XmlRpcClientResponseProcessor.java:109) > at org.apache.xmlrpc.XmlRpcClientResponseProcessor.decodeResponse(XmlRpcClientResponseProcessor.java:69) > ... 6 more > Caused by: java.lang.NumberFormatException: For input string: "Client" > at java.lang.NumberFormatException.forInputString(Unknown Source) > at java.lang.Integer.parseInt(Unknown Source) > at java.lang.Integer.parseInt(Unknown Source) > at org.apache.xmlrpc.XmlRpcClientResponseProcessor.decodeException(XmlRpcClientResponseProcessor.java:102) > ... 7 more > Thanks in advance -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira From xmlrpcadamswilliam@example.net Wed Sep 06 20:39:39 2006 Return-Path: <xmlrpcadamswilliam@example.net> Delivered-To: adamswilliam@example.net Received: (qmail 65706 invoked from network); 6 Sep 2006 20:39:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 6 Sep 2006 20:39:39 -0000 Received: (qmail 72942 invoked by uid 500); 6 Sep 2006 20:39:38 -0000 Delivered-To: adamswilliam@example.net Received: (qmail 72925 invoked by uid 500); 6 Sep 2006 20:39:38 -0000 Mailing-List: contact adamswilliam@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:adamswilliam@example.net> List-Unsubscribe: <mailto:adamswilliam@example.net> List-Post: <mailto:adamswilliam@example.net> List-Id: <xmlrpc-auto.ws.apache.org> Reply-To: adamswilliam@example.net Delivered-To: mailing list adamswilliam@example.net Received: (qmail 72916 invoked by uid 99); 6 Sep 2006 20:39:38 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Sep 2006 13:39:38 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Sep 2006 13:39:37 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 543B81A981D; Wed, 6 Sep 2006 13:39:17 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r440860 - in /webservices/xmlrpc: branches/XMLRPC_3_0_BRANCH/src/site/apt/server.apt trunk/src/site/apt/server.apt Date: Wed, 06 Sep 2006 20:39:16 -0000 To: adamswilliam@example.net From: adamswilliam@example.net X-Mailer: svnmailer-1.1.0 Message-Id: <adamswilliam@example.net> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: jochen Date: Wed Sep 6 13:39:15 2006 New Revision: 440860 URL: http://svn.apache.org/viewvc?view=rev&rev=440860 Log: Removed an extraneous line from the examples. Modified: webservices/xmlrpc/branches/XMLRPC_3_0_BRANCH/src/site/apt/server.apt webservices/xmlrpc/trunk/src/site/apt/server.apt Modified: webservices/xmlrpc/branches/XMLRPC_3_0_BRANCH/src/site/apt/server.apt URL: http://svn.apache.org/viewvc/webservices/xmlrpc/branches/XMLRPC_3_0_BRANCH/src/site/apt/server.apt?view=diff&rev=440860&r1=440859&r2=440860 ============================================================================== --- webservices/xmlrpc/branches/XMLRPC_3_0_BRANCH/src/site/apt/server.apt (original) +++ webservices/xmlrpc/branches/XMLRPC_3_0_BRANCH/src/site/apt/server.apt Wed Sep 6 13:39:15 2006 @@ -315,7 +315,6 @@ private static final int port = 8080; public static void main(String[] args) throws Exception { - ClassLoader cl = Thread.currentThread().getContextClassLoader(); XmlRpcServlet servlet = new XmlRpcServlet(); ServletWebServer webServer = new ServletWebServer(servlet, port); webServer.start(); Modified: webservices/xmlrpc/trunk/src/site/apt/server.apt URL: http://svn.apache.org/viewvc/webservices/xmlrpc/trunk/src/site/apt/server.apt?view=diff&rev=440860&r1=440859&r2=440860 ============================================================================== --- webservices/xmlrpc/trunk/src/site/apt/server.apt (original) +++ webservices/xmlrpc/trunk/src/site/apt/server.apt Wed Sep 6 13:39:15 2006 @@ -315,7 +315,6 @@ private static final int port = 8080; public static void main(String[] args) throws Exception { - ClassLoader cl = Thread.currentThread().getContextClassLoader(); XmlRpcServlet servlet = new XmlRpcServlet(); ServletWebServer webServer = new ServletWebServer(servlet, port); webServer.start(); From xmlrpcadamswilliam@example.net Thu Sep 07 12:32:11 2006 Return-Path: <xmlrpcadamswilliam@example.net> Delivered-To: adamswilliam@example.net Received: (qmail 51002 invoked from network); 7 Sep 2006 12:32:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 7 Sep 2006 12:32:06 -0000 Received: (qmail 50590 invoked by uid 500); 7 Sep 2006 12:32:01 -0000 Delivered-To: adamswilliam@example.net Received: (qmail 50537 invoked by uid 500); 7 Sep 2006 12:32:01 -0000 Mailing-List: contact adamswilliam@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:adamswilliam@example.net> List-Unsubscribe: <mailto:adamswilliam@example.net> List-Post: <mailto:adamswilliam@example.net> List-Id: <xmlrpc-auto.ws.apache.org> Reply-To: adamswilliam@example.net Delivered-To: mailing list adamswilliam@example.net Received: (qmail 50501 invoked by uid 99); 7 Sep 2006 12:32:01 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Sep 2006 05:32:01 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO brutus.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Sep 2006 05:32:00 -0700 Received: from brutus (localhost [83.161.120.155]) by brutus.apache.org (Postfix) with ESMTP id 85D36714303 for <adamswilliam@example.net>; Thu, 7 Sep 2006 12:28:28 +0000 (GMT) Message-ID: <28894173.1157632108386.JavaMail.jira@brutus> Date: Thu, 7 Sep 2006 05:28:28 -0700 (PDT) From: "Jochen Wiedmann (JIRA)" <adamswilliam@example.net> To: adamswilliam@example.net Subject: [jira] Created: (XMLRPC-111) Support Cookie Handling MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Support Cookie Handling ----------------------- Key: XMLRPC-111 URL: http://issues.apache.org/jira/browse/XMLRPC-111 Project: XML-RPC Issue Type: Improvement Affects Versions: 3.0 Reporter: Jochen Wiedmann Assigned To: Jochen Wiedmann Fix For: 3.1 Cookie handling is not possible or at least hard to perform with the current framework. This could be fixed by adding a CookieManager interface. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira From xmlrpcadamswilliam@example.net Thu Sep 07 12:33:54 2006 Return-Path: <xmlrpcadamswilliam@example.net> Delivered-To: adamswilliam@example.net Received: (qmail 51670 invoked from network); 7 Sep 2006 12:33:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 7 Sep 2006 12:33:53 -0000 Received: (qmail 54177 invoked by uid 500); 7 Sep 2006 12:33:53 -0000 Delivered-To: adamswilliam@example.net Received: (qmail 54152 invoked by uid 500); 7 Sep 2006 12:33:53 -0000 Mailing-List: contact adamswilliam@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:adamswilliam@example.net> List-Unsubscribe: <mailto:adamswilliam@example.net> List-Post: <mailto:adamswilliam@example.net> List-Id: <xmlrpc-auto.ws.apache.org> Reply-To: adamswilliam@example.net Delivered-To: mailing list adamswilliam@example.net Received: (qmail 54143 invoked by uid 99); 7 Sep 2006 12:33:53 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Sep 2006 05:33:53 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Sep 2006 05:33:52 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 185D41A981A; Thu, 7 Sep 2006 05:33:32 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r441071 - in /webservices/xmlrpc: branches/XMLRPC_3_0_BRANCH/client/src/main/java/org/apache/xmlrpc/client/ branches/XMLRPC_3_0_BRANCH/src/changes/ branches/XMLRPC_3_0_BRANCH/src/site/apt/ trunk/client/src/main/java/org/apache/xmlrpc/client... Date: Thu, 07 Sep 2006 12:33:31 -0000 To: adamswilliam@example.net From: adamswilliam@example.net X-Mailer: svnmailer-1.1.0 Message-Id: <adamswilliam@example.net> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: jochen Date: Thu Sep 7 05:33:31 2006 New Revision: 441071 URL: http://svn.apache.org/viewvc?view=rev&rev=441071 Log: Cookie handling has been impossible so far. It is now possible to add cookie manually by deriving subclasses. This is also documented. Modified: webservices/xmlrpc/branches/XMLRPC_3_0_BRANCH/client/src/main/java/org/apache/xmlrpc/client/XmlRpcCommonsTransport.java webservices/xmlrpc/branches/XMLRPC_3_0_BRANCH/client/src/main/java/org/apache/xmlrpc/client/XmlRpcSunHttpTransport.java webservices/xmlrpc/branches/XMLRPC_3_0_BRANCH/src/changes/changes.xml webservices/xmlrpc/branches/XMLRPC_3_0_BRANCH/src/site/apt/advanced.apt webservices/xmlrpc/trunk/client/src/main/java/org/apache/xmlrpc/client/XmlRpcCommonsTransport.java webservices/xmlrpc/trunk/client/src/main/java/org/apache/xmlrpc/client/XmlRpcSunHttpTransport.java webservices/xmlrpc/trunk/src/changes/changes.xml webservices/xmlrpc/trunk/src/site/apt/advanced.apt Modified: webservices/xmlrpc/branches/XMLRPC_3_0_BRANCH/client/src/main/java/org/apache/xmlrpc/client/XmlRpcCommonsTransport.java URL: http://svn.apache.org/viewvc/webservices/xmlrpc/branches/XMLRPC_3_0_BRANCH/client/src/main/java/org/apache/xmlrpc/client/XmlRpcCommonsTransport.java?view=diff&rev=441071&r1=441070&r2=441071 ============================================================================== --- webservices/xmlrpc/branches/XMLRPC_3_0_BRANCH/client/src/main/java/org/apache/xmlrpc/client/XmlRpcCommonsTransport.java (original) +++ webservices/xmlrpc/branches/XMLRPC_3_0_BRANCH/client/src/main/java/org/apache/xmlrpc/client/XmlRpcCommonsTransport.java Thu Sep 7 05:33:31 2006 @@ -44,7 +44,7 @@ * HTTP Client. */ public class XmlRpcCommonsTransport extends XmlRpcHttpTransport { - private final HttpClient client = new HttpClient(); + private final HttpClient client = newHttpClient(); private static final String userAgent = USER_AGENT + " (Jakarta Commons httpclient Transport)"; private PostMethod method; private int contentLength = -1; @@ -60,6 +60,10 @@ protected void setContentLength(int pLength) { contentLength = pLength; } + + protected HttpClient newHttpClient() { + return new HttpClient(); + } protected void initHttpHeaders(XmlRpcRequest pRequest) throws XmlRpcClientException { config = (XmlRpcHttpClientConfig) pRequest.getConfig(); Modified: webservices/xmlrpc/branches/XMLRPC_3_0_BRANCH/client/src/main/java/org/apache/xmlrpc/client/XmlRpcSunHttpTransport.java URL: http://svn.apache.org/viewvc/webservices/xmlrpc/branches/XMLRPC_3_0_BRANCH/client/src/main/java/org/apache/xmlrpc/client/XmlRpcSunHttpTransport.java?view=diff&rev=441071&r1=441070&r2=441071 ============================================================================== --- webservices/xmlrpc/branches/XMLRPC_3_0_BRANCH/client/src/main/java/org/apache/xmlrpc/client/XmlRpcSunHttpTransport.java (original) +++ webservices/xmlrpc/branches/XMLRPC_3_0_BRANCH/client/src/main/java/org/apache/xmlrpc/client/XmlRpcSunHttpTransport.java Thu Sep 7 05:33:31 2006 @@ -3,6 +3,7 @@ import java.io.IOException; import java.io.InputStream; import java.net.HttpURLConnection; +import java.net.URL; import java.net.URLConnection; import org.apache.xmlrpc.XmlRpcException; @@ -26,10 +27,14 @@ super(pClient, userAgent); } + protected URLConnection newURLConnection(URL pURL) throws IOException { + return pURL.openConnection(); + } + public Object sendRequest(XmlRpcRequest pRequest) throws XmlRpcException { XmlRpcHttpClientConfig config = (XmlRpcHttpClientConfig) pRequest.getConfig(); try { - conn = config.getServerURL().openConnection(); + conn = newURLConnection(config.getServerURL()); conn.setUseCaches(false); conn.setDoInput(true); conn.setDoOutput(true); Modified: webservices/xmlrpc/branches/XMLRPC_3_0_BRANCH/src/changes/changes.xml URL: http://svn.apache.org/viewvc/webservices/xmlrpc/branches/XMLRPC_3_0_BRANCH/src/changes/changes.xml?view=diff&rev=441071&r1=441070&r2=441071 ============================================================================== --- webservices/xmlrpc/branches/XMLRPC_3_0_BRANCH/src/changes/changes.xml (original) +++ webservices/xmlrpc/branches/XMLRPC_3_0_BRANCH/src/changes/changes.xml Thu Sep 7 05:33:31 2006 @@ -3,6 +3,13 @@ <title>Changes in Apache XML-RPC</title> </properties> <body> + <release version="3.0.1-SNAPSHOT" date="Not yet released"> + <action dev="jochen" type="fix"> + Make the HttpClient creation in XmlRpcCommonsTransport and the + URLConnection creation in XmlRpcSunHttpTransport protected. + This is required for cookie support. + </action> + </release> <release version="3.0" date="30-Aug-2006"> <action dev="jochen" type="fix" due-to="Matt Preston" due-to-email="adamswilliam@example.net" issue="XMLRPC-100"> Modified: webservices/xmlrpc/branches/XMLRPC_3_0_BRANCH/src/site/apt/advanced.apt URL: http://svn.apache.org/viewvc/webservices/xmlrpc/branches/XMLRPC_3_0_BRANCH/src/site/apt/advanced.apt?view=diff&rev=441071&r1=441070&r2=441071 ============================================================================== --- webservices/xmlrpc/branches/XMLRPC_3_0_BRANCH/src/site/apt/advanced.apt (original) +++ webservices/xmlrpc/branches/XMLRPC_3_0_BRANCH/src/site/apt/advanced.apt Thu Sep 7 05:33:31 2006 @@ -82,6 +82,77 @@ XmlRpcException, then you'll need to catch the XmlRpcException. Otherwise, it's UndeclaredThrowableException. +* Cookie handling + + Cookie has not yet been generalized. In other words, it depends on the + transport. + + * The XmlRpcLiteHttpTransport doesn't have support for cookies. + * The XmlRpcSunHttpTransport requires hand written code for setting + and getting the cookies or using a cookie library. (The latter is + recommended, of course.) In either way, you've got to use a custom + transport and overwrite the methods newURLConnection(URL), + initHttpHeaders(XmlRpcRequest), and close(): +----------------------------------------------------------------------------------- + import java.net.URLConnection; + import org.apache.xmlrpc.client.XmlRpcClient; + import org.apache.xmlrpc.client.XmlRpcSunHttpTransport; + import org.apache.xmlrpc.client.XmlRpcTransport; + import org.apache.xmlrpc.client.XmlRpcTransportFactory; + + final XmlRpcClient client = new XmlRpcClient(); + XmlRpcTransportFactory factory = new XmlRpcTransportFactory(){ + public XmlRpcTransport getTransport(){ + private URLConnection conn; + protected URLConnection newURLConnection(URL pURL) throws IOException { + conn = super.newURLConnection(pURL); + return conn; + } + protected void initHttpHeaders(XmlRpcRequest pRequest) { + super.initHttpHeaders(pRequest); + setCookies(conn); + } + protected void close() throws XmlRpcClientException { + getCookies(conn); + } + private void setCookies(URLConnection pConn) { + // Implement me ... + } + private void getCookies(URLConnection pConn) { + // Implement me ... + } + } + }; + client.setTransportFactory(factory); +----------------------------------------------------------------------------------- + * The XmlRpcCommonsHttpTransport requires that the HttpClient is being + reused. (By default, a new HttpClient is created for any connection.) + To reuse the HttpClient, use a transport factory like the following: +----------------------------------------------------------------------------------- + import org.apache.commons.httpclient.HttpClient; + import org.apache.xmlrpc.client.XmlRpcClient; + import org.apache.xmlrpc.client.XmlRpcCommonsHttpTransport; + import org.apache.xmlrpc.client.XmlRpcTransport; + import org.apache.xmlrpc.client.XmlRpcTransportFactory; + + final XmlRpcClient client = new XmlRpcClient(); + final HttpClient httpClient = new HttpClient(); + XmlRpcTransportFactory factory = new XmlRpcTransportFactory(){ + public XmlRpcTransport getTransport(){ + return new XmlRpcCommonsHttpTransport(client){ + protected HttpClient newHttpClient() { + return httpClient; + } + }; + } + }; + client.setTransportFactory(factory); +----------------------------------------------------------------------------------- + Note, that this means losing the XmlRpcClients multithreading abilities! + The factory above is obviously bound to the HttpClient, which must be + bound to a thread. If you need to set cookies initially, overwrite the + transport method initHttpHeaders(XmlRpcRequest) as well. + * Custom data types Apache XML-RPC was built with extensibility in mind. In particular, it was Modified: webservices/xmlrpc/trunk/client/src/main/java/org/apache/xmlrpc/client/XmlRpcCommonsTransport.java URL: http://svn.apache.org/viewvc/webservices/xmlrpc/trunk/client/src/main/java/org/apache/xmlrpc/client/XmlRpcCommonsTransport.java?view=diff&rev=441071&r1=441070&r2=441071 ============================================================================== --- webservices/xmlrpc/trunk/client/src/main/java/org/apache/xmlrpc/client/XmlRpcCommonsTransport.java (original) +++ webservices/xmlrpc/trunk/client/src/main/java/org/apache/xmlrpc/client/XmlRpcCommonsTransport.java Thu Sep 7 05:33:31 2006 @@ -44,7 +44,7 @@ * HTTP Client. */ public class XmlRpcCommonsTransport extends XmlRpcHttpTransport { - private final HttpClient client = new HttpClient(); + private final HttpClient client = newHttpClient(); private static final String userAgent = USER_AGENT + " (Jakarta Commons httpclient Transport)"; private PostMethod method; private int contentLength = -1; @@ -60,6 +60,10 @@ protected void setContentLength(int pLength) { contentLength = pLength; } + + protected HttpClient newHttpClient() { + return new HttpClient(); + } protected void initHttpHeaders(XmlRpcRequest pRequest) throws XmlRpcClientException { config = (XmlRpcHttpClientConfig) pRequest.getConfig(); Modified: webservices/xmlrpc/trunk/client/src/main/java/org/apache/xmlrpc/client/XmlRpcSunHttpTransport.java URL: http://svn.apache.org/viewvc/webservices/xmlrpc/trunk/client/src/main/java/org/apache/xmlrpc/client/XmlRpcSunHttpTransport.java?view=diff&rev=441071&r1=441070&r2=441071 ============================================================================== --- webservices/xmlrpc/trunk/client/src/main/java/org/apache/xmlrpc/client/XmlRpcSunHttpTransport.java (original) +++ webservices/xmlrpc/trunk/client/src/main/java/org/apache/xmlrpc/client/XmlRpcSunHttpTransport.java Thu Sep 7 05:33:31 2006 @@ -3,6 +3,7 @@ import java.io.IOException; import java.io.InputStream; import java.net.HttpURLConnection; +import java.net.URL; import java.net.URLConnection; import org.apache.xmlrpc.XmlRpcException; @@ -26,10 +27,14 @@ super(pClient, userAgent); } + protected URLConnection newURLConnection(URL pURL) throws IOException { + return pURL.openConnection(); + } + public Object sendRequest(XmlRpcRequest pRequest) throws XmlRpcException { XmlRpcHttpClientConfig config = (XmlRpcHttpClientConfig) pRequest.getConfig(); try { - conn = config.getServerURL().openConnection(); + conn = newURLConnection(config.getServerURL()); conn.setUseCaches(false); conn.setDoInput(true); conn.setDoOutput(true); Modified: webservices/xmlrpc/trunk/src/changes/changes.xml URL: http://svn.apache.org/viewvc/webservices/xmlrpc/trunk/src/changes/changes.xml?view=diff&rev=441071&r1=441070&r2=441071 ============================================================================== --- webservices/xmlrpc/trunk/src/changes/changes.xml (original) +++ webservices/xmlrpc/trunk/src/changes/changes.xml Thu Sep 7 05:33:31 2006 @@ -3,6 +3,13 @@ <title>Changes in Apache XML-RPC</title> </properties> <body> + <release version="3.0.1-SNAPSHOT" date="Not yet released"> + <action dev="jochen" type="fix"> + Make the HttpClient creation in XmlRpcCommonsTransport and the + URLConnection creation in XmlRpcSunHttpTransport protected. + This is required for cookie support. + </action> + </release> <release version="3.0" date="30-Aug-2006"> <action dev="jochen" type="fix" due-to="Matt Preston" due-to-email="adamswilliam@example.net" issue="XMLRPC-100"> Modified: webservices/xmlrpc/trunk/src/site/apt/advanced.apt URL: http://svn.apache.org/viewvc/webservices/xmlrpc/trunk/src/site/apt/advanced.apt?view=diff&rev=441071&r1=441070&r2=441071 ============================================================================== --- webservices/xmlrpc/trunk/src/site/apt/advanced.apt (original) +++ webservices/xmlrpc/trunk/src/site/apt/advanced.apt Thu Sep 7 05:33:31 2006 @@ -82,6 +82,77 @@ XmlRpcException, then you'll need to catch the XmlRpcException. Otherwise, it's UndeclaredThrowableException. +* Cookie handling + + Cookie has not yet been generalized. In other words, it depends on the + transport. + + * The XmlRpcLiteHttpTransport doesn't have support for cookies. + * The XmlRpcSunHttpTransport requires hand written code for setting + and getting the cookies or using a cookie library. (The latter is + recommended, of course.) In either way, you've got to use a custom + transport and overwrite the methods newURLConnection(URL), + initHttpHeaders(XmlRpcRequest), and close(): +----------------------------------------------------------------------------------- + import java.net.URLConnection; + import org.apache.xmlrpc.client.XmlRpcClient; + import org.apache.xmlrpc.client.XmlRpcSunHttpTransport; + import org.apache.xmlrpc.client.XmlRpcTransport; + import org.apache.xmlrpc.client.XmlRpcTransportFactory; + + final XmlRpcClient client = new XmlRpcClient(); + XmlRpcTransportFactory factory = new XmlRpcTransportFactory(){ + public XmlRpcTransport getTransport(){ + private URLConnection conn; + protected URLConnection newURLConnection(URL pURL) throws IOException { + conn = super.newURLConnection(pURL); + return conn; + } + protected void initHttpHeaders(XmlRpcRequest pRequest) { + super.initHttpHeaders(pRequest); + setCookies(conn); + } + protected void close() throws XmlRpcClientException { + getCookies(conn); + } + private void setCookies(URLConnection pConn) { + // Implement me ... + } + private void getCookies(URLConnection pConn) { + // Implement me ... + } + } + }; + client.setTransportFactory(factory); +----------------------------------------------------------------------------------- + * The XmlRpcCommonsHttpTransport requires that the HttpClient is being + reused. (By default, a new HttpClient is created for any connection.) + To reuse the HttpClient, use a transport factory like the following: +----------------------------------------------------------------------------------- + import org.apache.commons.httpclient.HttpClient; + import org.apache.xmlrpc.client.XmlRpcClient; + import org.apache.xmlrpc.client.XmlRpcCommonsHttpTransport; + import org.apache.xmlrpc.client.XmlRpcTransport; + import org.apache.xmlrpc.client.XmlRpcTransportFactory; + + final XmlRpcClient client = new XmlRpcClient(); + final HttpClient httpClient = new HttpClient(); + XmlRpcTransportFactory factory = new XmlRpcTransportFactory(){ + public XmlRpcTransport getTransport(){ + return new XmlRpcCommonsHttpTransport(client){ + protected HttpClient newHttpClient() { + return httpClient; + } + }; + } + }; + client.setTransportFactory(factory); +----------------------------------------------------------------------------------- + Note, that this means losing the XmlRpcClients multithreading abilities! + The factory above is obviously bound to the HttpClient, which must be + bound to a thread. If you need to set cookies initially, overwrite the + transport method initHttpHeaders(XmlRpcRequest) as well. + * Custom data types Apache XML-RPC was built with extensibility in mind. In particular, it was From xmlrpcadamswilliam@example.net Thu Sep 07 12:41:58 2006 Return-Path: <xmlrpcadamswilliam@example.net> Delivered-To: adamswilliam@example.net Received: (qmail 54512 invoked from network); 7 Sep 2006 12:41:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 7 Sep 2006 12:41:57 -0000 Received: (qmail 64496 invoked by uid 500); 7 Sep 2006 12:41:57 -0000 Delivered-To: adamswilliam@example.net Received: (qmail 64358 invoked by uid 500); 7 Sep 2006 12:41:57 -0000 Mailing-List: contact adamswilliam@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:adamswilliam@example.net> List-Unsubscribe: <mailto:adamswilliam@example.net> List-Post: <mailto:adamswilliam@example.net> List-Id: <xmlrpc-auto.ws.apache.org> Reply-To: adamswilliam@example.net Delivered-To: mailing list adamswilliam@example.net Received: (qmail 64349 invoked by uid 99); 7 Sep 2006 12:41:57 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Sep 2006 05:41:57 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Sep 2006 05:41:56 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 2EC861A981A; Thu, 7 Sep 2006 05:41:36 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r441076 - in /webservices/xmlrpc: branches/XMLRPC_3_0_BRANCH/src/site/apt/advanced.apt trunk/src/site/apt/advanced.apt Date: Thu, 07 Sep 2006 12:41:36 -0000 To: adamswilliam@example.net From: adamswilliam@example.net X-Mailer: svnmailer-1.1.0 Message-Id: <adamswilliam@example.net> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: jochen Date: Thu Sep 7 05:41:35 2006 New Revision: 441076 URL: http://svn.apache.org/viewvc?view=rev&rev=441076 Log: Fixed an apt format bug. Modified: webservices/xmlrpc/branches/XMLRPC_3_0_BRANCH/src/site/apt/advanced.apt webservices/xmlrpc/trunk/src/site/apt/advanced.apt Modified: webservices/xmlrpc/branches/XMLRPC_3_0_BRANCH/src/site/apt/advanced.apt URL: http://svn.apache.org/viewvc/webservices/xmlrpc/branches/XMLRPC_3_0_BRANCH/src/site/apt/advanced.apt?view=diff&rev=441076&r1=441075&r2=441076 ============================================================================== --- webservices/xmlrpc/branches/XMLRPC_3_0_BRANCH/src/site/apt/advanced.apt (original) +++ webservices/xmlrpc/branches/XMLRPC_3_0_BRANCH/src/site/apt/advanced.apt Thu Sep 7 05:41:35 2006 @@ -93,6 +93,7 @@ recommended, of course.) In either way, you've got to use a custom transport and overwrite the methods newURLConnection(URL), initHttpHeaders(XmlRpcRequest), and close(): + ----------------------------------------------------------------------------------- import java.net.URLConnection; import org.apache.xmlrpc.client.XmlRpcClient; @@ -125,9 +126,11 @@ }; client.setTransportFactory(factory); ----------------------------------------------------------------------------------- + * The XmlRpcCommonsHttpTransport requires that the HttpClient is being reused. (By default, a new HttpClient is created for any connection.) To reuse the HttpClient, use a transport factory like the following: + ----------------------------------------------------------------------------------- import org.apache.commons.httpclient.HttpClient; import org.apache.xmlrpc.client.XmlRpcClient; @@ -148,6 +151,7 @@ }; client.setTransportFactory(factory); ----------------------------------------------------------------------------------- + Note, that this means losing the XmlRpcClients multithreading abilities! The factory above is obviously bound to the HttpClient, which must be bound to a thread. If you need to set cookies initially, overwrite the Modified: webservices/xmlrpc/trunk/src/site/apt/advanced.apt URL: http://svn.apache.org/viewvc/webservices/xmlrpc/trunk/src/site/apt/advanced.apt?view=diff&rev=441076&r1=441075&r2=441076 ============================================================================== --- webservices/xmlrpc/trunk/src/site/apt/advanced.apt (original) +++ webservices/xmlrpc/trunk/src/site/apt/advanced.apt Thu Sep 7 05:41:35 2006 @@ -93,6 +93,7 @@ recommended, of course.) In either way, you've got to use a custom transport and overwrite the methods newURLConnection(URL), initHttpHeaders(XmlRpcRequest), and close(): + ----------------------------------------------------------------------------------- import java.net.URLConnection; import org.apache.xmlrpc.client.XmlRpcClient; @@ -125,9 +126,11 @@ }; client.setTransportFactory(factory); ----------------------------------------------------------------------------------- + * The XmlRpcCommonsHttpTransport requires that the HttpClient is being reused. (By default, a new HttpClient is created for any connection.) To reuse the HttpClient, use a transport factory like the following: + ----------------------------------------------------------------------------------- import org.apache.commons.httpclient.HttpClient; import org.apache.xmlrpc.client.XmlRpcClient; @@ -148,6 +151,7 @@ }; client.setTransportFactory(factory); ----------------------------------------------------------------------------------- + Note, that this means losing the XmlRpcClients multithreading abilities! The factory above is obviously bound to the HttpClient, which must be bound to a thread. If you need to set cookies initially, overwrite the From xmlrpcadamswilliam@example.net Mon Sep 11 11:28:28 2006 Return-Path: <xmlrpcadamswilliam@example.net> Delivered-To: adamswilliam@example.net Received: (qmail 65852 invoked from network); 11 Sep 2006 11:28:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 11 Sep 2006 11:28:28 -0000 Received: (qmail 80850 invoked by uid 500); 11 Sep 2006 11:28:28 -0000 Delivered-To: adamswilliam@example.net Received: (qmail 80711 invoked by uid 500); 11 Sep 2006 11:28:27 -0000 Mailing-List: contact adamswilliam@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:adamswilliam@example.net> List-Unsubscribe: <mailto:adamswilliam@example.net> List-Post: <mailto:adamswilliam@example.net> List-Id: <xmlrpc-auto.ws.apache.org> Reply-To: adamswilliam@example.net Delivered-To: mailing list adamswilliam@example.net Received: (qmail 80702 invoked by uid 99); 11 Sep 2006 11:28:27 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Sep 2006 04:28:27 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Sep 2006 04:28:25 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 40A271A981A; Mon, 11 Sep 2006 04:28:05 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r442177 - in /webservices/xmlrpc/trunk: client/src/main/java/org/apache/xmlrpc/client/ client/src/main/java/org/apache/xmlrpc/client/util/ common/src/main/java/org/apache/xmlrpc/ common/src/main/java/org/apache/xmlrpc/common/ common/src/mai... Date: Mon, 11 Sep 2006 11:28:04 -0000 To: adamswilliam@example.net From: adamswilliam@example.net X-Mailer: svnmailer-1.1.0 Message-Id: <adamswilliam@example.net> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: jochen Date: Mon Sep 11 04:28:03 2006 New Revision: 442177 URL: http://svn.apache.org/viewvc?view=rev&rev=442177 Log: Added the "enabledForExceptions" property. Added: webservices/xmlrpc/trunk/common/src/main/java/org/apache/xmlrpc/common/XmlRpcInvocationException.java Modified: webservices/xmlrpc/trunk/client/src/main/java/org/apache/xmlrpc/client/XmlRpcLocalTransport.java webservices/xmlrpc/trunk/client/src/main/java/org/apache/xmlrpc/client/XmlRpcStreamTransport.java webservices/xmlrpc/trunk/client/src/main/java/org/apache/xmlrpc/client/util/ClientFactory.java webservices/xmlrpc/trunk/common/src/main/java/org/apache/xmlrpc/XmlRpcException.java webservices/xmlrpc/trunk/common/src/main/java/org/apache/xmlrpc/common/XmlRpcHttpRequestConfigImpl.java webservices/xmlrpc/trunk/common/src/main/java/org/apache/xmlrpc/common/XmlRpcStreamRequestConfig.java webservices/xmlrpc/trunk/common/src/main/java/org/apache/xmlrpc/parser/XmlRpcResponseParser.java webservices/xmlrpc/trunk/common/src/main/java/org/apache/xmlrpc/serializer/XmlRpcWriter.java webservices/xmlrpc/trunk/server/src/main/java/org/apache/xmlrpc/server/ReflectiveXmlRpcHandler.java webservices/xmlrpc/trunk/server/src/main/java/org/apache/xmlrpc/server/XmlRpcHttpServerConfig.java webservices/xmlrpc/trunk/server/src/main/java/org/apache/xmlrpc/server/XmlRpcServerConfigImpl.java webservices/xmlrpc/trunk/server/src/main/java/org/apache/xmlrpc/server/XmlRpcStreamServer.java webservices/xmlrpc/trunk/server/src/main/java/org/apache/xmlrpc/webserver/Connection.java webservices/xmlrpc/trunk/server/src/main/java/org/apache/xmlrpc/webserver/ConnectionServer.java webservices/xmlrpc/trunk/server/src/main/java/org/apache/xmlrpc/webserver/XmlRpcServletServer.java webservices/xmlrpc/trunk/src/changes/changes.xml webservices/xmlrpc/trunk/src/site/apt/advanced.apt webservices/xmlrpc/trunk/src/site/apt/client.apt webservices/xmlrpc/trunk/src/site/apt/extensions.apt webservices/xmlrpc/trunk/src/site/apt/server.apt webservices/xmlrpc/trunk/tests/src/test/java/org/apache/xmlrpc/test/BaseTest.java webservices/xmlrpc/trunk/tests/src/test/java/org/apache/xmlrpc/test/DynamicProxyTest.java webservices/xmlrpc/trunk/tests/src/test/java/org/apache/xmlrpc/test/ServletWebServerProvider.java webservices/xmlrpc/trunk/tests/src/test/java/org/apache/xmlrpc/test/WebServerProvider.java webservices/xmlrpc/trunk/tests/src/test/java/org/apache/xmlrpc/test/XmlRpcTestCase.java Modified: webservices/xmlrpc/trunk/client/src/main/java/org/apache/xmlrpc/client/XmlRpcLocalTransport.java URL: http://svn.apache.org/viewvc/webservices/xmlrpc/trunk/client/src/main/java/org/apache/xmlrpc/client/XmlRpcLocalTransport.java?view=diff&rev=442177&r1=442176&r2=442177 ============================================================================== --- webservices/xmlrpc/trunk/client/src/main/java/org/apache/xmlrpc/client/XmlRpcLocalTransport.java (original) +++ webservices/xmlrpc/trunk/client/src/main/java/org/apache/xmlrpc/client/XmlRpcLocalTransport.java Mon Sep 11 04:28:03 2006 @@ -87,13 +87,11 @@ Object result; try { result = server.execute(pRequest); + } catch (XmlRpcException t) { + throw t; } catch (Throwable t) { - if (t instanceof XmlRpcClientException) { - throw (XmlRpcClientException) t; - } else { - throw new XmlRpcClientException("Failed to invoke method " + pRequest.getMethodName() - + ": " + t.getMessage(), t); - } + throw new XmlRpcClientException("Failed to invoke method " + pRequest.getMethodName() + + ": " + t.getMessage(), t); } if (!config.isEnabledForExtensions()) { if (isExtensionType(result)) { Modified: webservices/xmlrpc/trunk/client/src/main/java/org/apache/xmlrpc/client/XmlRpcStreamTransport.java URL: http://svn.apache.org/viewvc/webservices/xmlrpc/trunk/client/src/main/java/org/apache/xmlrpc/client/XmlRpcStreamTransport.java?view=diff&rev=442177&r1=442176&r2=442177 ============================================================================== --- webservices/xmlrpc/trunk/client/src/main/java/org/apache/xmlrpc/client/XmlRpcStreamTransport.java (original) +++ webservices/xmlrpc/trunk/client/src/main/java/org/apache/xmlrpc/client/XmlRpcStreamTransport.java Mon Sep 11 04:28:03 2006 @@ -172,7 +172,7 @@ try { xp = new XmlRpcResponseParser(pConfig, getClient().getTypeFactory()); xr.setContentHandler(xp); - xr.parse(isource); + xr.parse(isource); } catch (SAXException e) { throw new XmlRpcClientException("Failed to parse servers response: " + e.getMessage(), e); } catch (IOException e) { @@ -180,8 +180,17 @@ } if (xp.isSuccess()) { return xp.getResult(); - } else { - throw new XmlRpcException(xp.getErrorCode(), xp.getErrorMessage()); } + Throwable t = xp.getErrorCause(); + if (t == null) { + throw new XmlRpcException(xp.getErrorCode(), xp.getErrorMessage()); + } + if (t instanceof XmlRpcException) { + throw (XmlRpcException) t; + } + if (t instanceof RuntimeException) { + throw (RuntimeException) t; + } + throw new XmlRpcException(xp.getErrorCode(), xp.getErrorMessage(), t); } } Modified: webservices/xmlrpc/trunk/client/src/main/java/org/apache/xmlrpc/client/util/ClientFactory.java URL: http://svn.apache.org/viewvc/webservices/xmlrpc/trunk/client/src/main/java/org/apache/xmlrpc/client/util/ClientFactory.java?view=diff&rev=442177&r1=442176&r2=442177 ============================================================================== --- webservices/xmlrpc/trunk/client/src/main/java/org/apache/xmlrpc/client/util/ClientFactory.java (original) +++ webservices/xmlrpc/trunk/client/src/main/java/org/apache/xmlrpc/client/util/ClientFactory.java Mon Sep 11 04:28:03 2006 @@ -18,11 +18,13 @@ import java.lang.reflect.InvocationHandler; import java.lang.reflect.Method; import java.lang.reflect.Proxy; +import java.lang.reflect.UndeclaredThrowableException; import org.apache.xmlrpc.client.XmlRpcClient; import org.apache.xmlrpc.common.TypeConverter; import org.apache.xmlrpc.common.TypeConverterFactory; import org.apache.xmlrpc.common.TypeConverterFactoryImpl; +import org.apache.xmlrpc.common.XmlRpcInvocationException; /** @@ -101,7 +103,23 @@ return pMethod.invoke(pProxy, pArgs); } String methodName = pClass.getName() + "." + pMethod.getName(); - Object result = client.execute(methodName, pArgs); + Object result; + try { + result = client.execute(methodName, pArgs); + } catch (XmlRpcInvocationException e) { + Throwable t = e.linkedException; + if (t instanceof RuntimeException) { + throw t; + } + Class[] exceptionTypes = pMethod.getExceptionTypes(); + for (int i = 0; i < exceptionTypes.length; i++) { + Class c = exceptionTypes[i]; + if (c.isAssignableFrom(t.getClass())) { + throw t; + } + } + throw new UndeclaredThrowableException(t); + } TypeConverter typeConverter = typeConverterFactory.getTypeConverter(pMethod.getReturnType()); return typeConverter.convert(result); } Modified: webservices/xmlrpc/trunk/common/src/main/java/org/apache/xmlrpc/XmlRpcException.java URL: http://svn.apache.org/viewvc/webservices/xmlrpc/trunk/common/src/main/java/org/apache/xmlrpc/XmlRpcException.java?view=diff&rev=442177&r1=442176&r2=442177 ============================================================================== --- webservices/xmlrpc/trunk/common/src/main/java/org/apache/xmlrpc/XmlRpcException.java (original) +++ webservices/xmlrpc/trunk/common/src/main/java/org/apache/xmlrpc/XmlRpcException.java Mon Sep 11 04:28:03 2006 @@ -93,4 +93,8 @@ linkedException.printStackTrace(pWriter); } } + + public Throwable getCause() { + return linkedException; + } } Modified: webservices/xmlrpc/trunk/common/src/main/java/org/apache/xmlrpc/common/XmlRpcHttpRequestConfigImpl.java URL: http://svn.apache.org/viewvc/webservices/xmlrpc/trunk/common/src/main/java/org/apache/xmlrpc/common/XmlRpcHttpRequestConfigImpl.java?view=diff&rev=442177&r1=442176&r2=442177 ============================================================================== --- webservices/xmlrpc/trunk/common/src/main/java/org/apache/xmlrpc/common/XmlRpcHttpRequestConfigImpl.java (original) +++ webservices/xmlrpc/trunk/common/src/main/java/org/apache/xmlrpc/common/XmlRpcHttpRequestConfigImpl.java Mon Sep 11 04:28:03 2006 @@ -28,6 +28,7 @@ private String basicPassword; private int connectionTimeout = 0; private int replyTimeout = 0; + private boolean enabledForExceptions; /** Sets, whether gzip compression is being used for * transmitting the request. @@ -97,4 +98,16 @@ return replyTimeout; } + /** Sets, whether the response should contain a "faultCause" element + * in case of errors. The "faultCause" is an exception, which the + * server has trapped and written into a byte stream as a serializable + * object. + */ + public void setEnabledForExceptions(boolean pEnabledForExceptions) { + enabledForExceptions = pEnabledForExceptions; + } + + public boolean isEnabledForExceptions() { + return enabledForExceptions; + } } Added: webservices/xmlrpc/trunk/common/src/main/java/org/apache/xmlrpc/common/XmlRpcInvocationException.java URL: http://svn.apache.org/viewvc/webservices/xmlrpc/trunk/common/src/main/java/org/apache/xmlrpc/common/XmlRpcInvocationException.java?view=auto&rev=442177 ============================================================================== --- webservices/xmlrpc/trunk/common/src/main/java/org/apache/xmlrpc/common/XmlRpcInvocationException.java (added) +++ webservices/xmlrpc/trunk/common/src/main/java/org/apache/xmlrpc/common/XmlRpcInvocationException.java Mon Sep 11 04:28:03 2006 @@ -0,0 +1,42 @@ +/* + * Copyright 1999,2005 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.xmlrpc.common; + +import org.apache.xmlrpc.XmlRpcException; + + +/** + * This exception is thrown, if the server catches an exception, which + * is thrown by the handler. + */ +public class XmlRpcInvocationException extends XmlRpcException { + private static final long serialVersionUID = 7439737967784966169L; + + /** + * Creates a new instance with the given error code, error message + * and cause. + */ + public XmlRpcInvocationException(int pCode, String pMessage, Throwable pLinkedException) { + super(pCode, pMessage, pLinkedException); + } + + /** + * Creates a new instance with the given error message and cause. + */ + public XmlRpcInvocationException(String pMessage, Throwable pLinkedException) { + super(pMessage, pLinkedException); + } +} Modified: webservices/xmlrpc/trunk/common/src/main/java/org/apache/xmlrpc/common/XmlRpcStreamRequestConfig.java URL: http://svn.apache.org/viewvc/webservices/xmlrpc/trunk/common/src/main/java/org/apache/xmlrpc/common/XmlRpcStreamRequestConfig.java?view=diff&rev=442177&r1=442176&r2=442177 ============================================================================== --- webservices/xmlrpc/trunk/common/src/main/java/org/apache/xmlrpc/common/XmlRpcStreamRequestConfig.java (original) +++ webservices/xmlrpc/trunk/common/src/main/java/org/apache/xmlrpc/common/XmlRpcStreamRequestConfig.java Mon Sep 11 04:28:03 2006 @@ -36,4 +36,10 @@ * @see #isGzipCompressing() */ boolean isGzipRequesting(); + /** Returns, whether the response should contain a "faultCause" element + * in case of errors. The "faultCause" is an exception, which the + * server has trapped and written into a byte stream as a serializable + * object. + */ + boolean isEnabledForExceptions(); } Modified: webservices/xmlrpc/trunk/common/src/main/java/org/apache/xmlrpc/parser/XmlRpcResponseParser.java URL: http://svn.apache.org/viewvc/webservices/xmlrpc/trunk/common/src/main/java/org/apache/xmlrpc/parser/XmlRpcResponseParser.java?view=diff&rev=442177&r1=442176&r2=442177 ============================================================================== --- webservices/xmlrpc/trunk/common/src/main/java/org/apache/xmlrpc/parser/XmlRpcResponseParser.java (original) +++ webservices/xmlrpc/trunk/common/src/main/java/org/apache/xmlrpc/parser/XmlRpcResponseParser.java Mon Sep 11 04:28:03 2006 @@ -15,6 +15,8 @@ */ package org.apache.xmlrpc.parser; +import java.io.ByteArrayInputStream; +import java.io.ObjectInputStream; import java.util.Map; import javax.xml.namespace.QName; @@ -36,6 +38,7 @@ private boolean isSuccess; private int errorCode; private String errorMessage; + private Throwable errorCause; /** Creates a new instance. * @param pConfig The response configuration. @@ -63,6 +66,19 @@ getDocumentLocator()); } errorMessage = (String) map.get("faultString"); + Object exception = map.get("faultCause"); + if (exception != null) { + try { + byte[] bytes = (byte[]) exception; + ByteArrayInputStream bais = new ByteArrayInputStream(bytes); + ObjectInputStream ois = new ObjectInputStream(bais); + errorCause = (Throwable) ois.readObject(); + ois.close(); + bais.close(); + } catch (Throwable t) { + // Ignore me + } + } } } @@ -206,4 +222,9 @@ * @return The error message. */ public String getErrorMessage() { return errorMessage; } + + /** If the response contained a fault, returns the (optional) + * exception. + */ + public Throwable getErrorCause() { return errorCause; } } Modified: webservices/xmlrpc/trunk/common/src/main/java/org/apache/xmlrpc/serializer/XmlRpcWriter.java URL: http://svn.apache.org/viewvc/webservices/xmlrpc/trunk/common/src/main/java/org/apache/xmlrpc/serializer/XmlRpcWriter.java?view=diff&rev=442177&r1=442176&r2=442177 ============================================================================== --- webservices/xmlrpc/trunk/common/src/main/java/org/apache/xmlrpc/serializer/XmlRpcWriter.java (original) +++ webservices/xmlrpc/trunk/common/src/main/java/org/apache/xmlrpc/serializer/XmlRpcWriter.java Mon Sep 11 04:28:03 2006 @@ -15,6 +15,8 @@ */ package org.apache.xmlrpc.serializer; +import java.io.ByteArrayOutputStream; +import java.io.ObjectOutputStream; import java.util.HashMap; import java.util.Map; @@ -22,6 +24,7 @@ import org.apache.xmlrpc.XmlRpcRequestConfig; import org.apache.xmlrpc.common.TypeFactory; import org.apache.xmlrpc.common.XmlRpcStreamConfig; +import org.apache.xmlrpc.common.XmlRpcStreamRequestConfig; import org.xml.sax.Attributes; import org.xml.sax.ContentHandler; import org.xml.sax.SAXException; @@ -106,13 +109,25 @@ handler.endDocument(); } - /** Writes a servers error message to the output stream. + /** Writes a servers error message to the output stream. + * @param pConfig The request configuration. + * @param pCode The error code + * @param pMessage The error message + * @throws SAXException Writing the error message failed. + */ + public void write(XmlRpcRequestConfig pConfig, int pCode, String pMessage) throws SAXException { + write(pConfig, pCode, pMessage, null); + } + + /** Writes a servers error message to the output stream. * @param pConfig The request configuration. * @param pCode The error code * @param pMessage The error message + * @param pThrowable An exception, which is being sent to the client * @throws SAXException Writing the error message failed. */ - public void write(XmlRpcRequestConfig pConfig, int pCode, String pMessage) throws SAXException { + public void write(XmlRpcRequestConfig pConfig, int pCode, String pMessage, + Throwable pThrowable) throws SAXException { handler.startDocument(); boolean extensions = pConfig.isEnabledForExtensions(); if (extensions) { @@ -123,7 +138,20 @@ Map map = new HashMap(); map.put("faultCode", new Integer(pCode)); map.put("faultString", pMessage == null ? "" : pMessage); - writeValue(map); + if (pThrowable != null && extensions && (pConfig instanceof XmlRpcStreamRequestConfig) && + ((XmlRpcStreamRequestConfig) pConfig).isEnabledForExceptions()) { + try { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + ObjectOutputStream oos = new ObjectOutputStream(baos); + oos.writeObject(pThrowable); + oos.close(); + baos.close(); + map.put("faultCause", baos.toByteArray()); + } catch (Throwable t) { + // Ignore me + } + } + writeValue(map); handler.endElement("", "fault", "fault"); handler.endElement("", "methodResponse", "methodResponse"); if (extensions) { Modified: webservices/xmlrpc/trunk/server/src/main/java/org/apache/xmlrpc/server/ReflectiveXmlRpcHandler.java URL: http://svn.apache.org/viewvc/webservices/xmlrpc/trunk/server/src/main/java/org/apache/xmlrpc/server/ReflectiveXmlRpcHandler.java?view=diff&rev=442177&r1=442176&r2=442177 ============================================================================== --- webservices/xmlrpc/trunk/server/src/main/java/org/apache/xmlrpc/server/ReflectiveXmlRpcHandler.java (original) +++ webservices/xmlrpc/trunk/server/src/main/java/org/apache/xmlrpc/server/ReflectiveXmlRpcHandler.java Mon Sep 11 04:28:03 2006 @@ -23,6 +23,7 @@ import org.apache.xmlrpc.XmlRpcRequest; import org.apache.xmlrpc.common.TypeConverter; import org.apache.xmlrpc.common.TypeConverterFactory; +import org.apache.xmlrpc.common.XmlRpcInvocationException; import org.apache.xmlrpc.common.XmlRpcNotAuthorizedException; import org.apache.xmlrpc.metadata.Util; import org.apache.xmlrpc.server.AbstractReflectiveHandlerMapping.AuthenticationHandler; @@ -119,7 +120,7 @@ + clazz.getName(), e); } catch (InvocationTargetException e) { Throwable t = e.getTargetException(); - throw new XmlRpcException("Failed to invoke method " + throw new XmlRpcInvocationException("Failed to invoke method " + pMethod.getName() + " in class " + clazz.getName() + ": " + t.getMessage(), t); Modified: webservices/xmlrpc/trunk/server/src/main/java/org/apache/xmlrpc/server/XmlRpcHttpServerConfig.java URL: http://svn.apache.org/viewvc/webservices/xmlrpc/trunk/server/src/main/java/org/apache/xmlrpc/server/XmlRpcHttpServerConfig.java?view=diff&rev=442177&r1=442176&r2=442177 ============================================================================== --- webservices/xmlrpc/trunk/server/src/main/java/org/apache/xmlrpc/server/XmlRpcHttpServerConfig.java (original) +++ webservices/xmlrpc/trunk/server/src/main/java/org/apache/xmlrpc/server/XmlRpcHttpServerConfig.java Mon Sep 11 04:28:03 2006 @@ -24,4 +24,9 @@ * @return True, if keepalive is enabled, false otherwise. */ boolean isKeepAliveEnabled(); + + /** Returns, whether the server may create a "faultCause" element in an error + * response. Note, that this may be a security issue! + */ + boolean isEnabledForExceptions(); } Modified: webservices/xmlrpc/trunk/server/src/main/java/org/apache/xmlrpc/server/XmlRpcServerConfigImpl.java URL: http://svn.apache.org/viewvc/webservices/xmlrpc/trunk/server/src/main/java/org/apache/xmlrpc/server/XmlRpcServerConfigImpl.java?view=diff&rev=442177&r1=442176&r2=442177 ============================================================================== --- webservices/xmlrpc/trunk/server/src/main/java/org/apache/xmlrpc/server/XmlRpcServerConfigImpl.java (original) +++ webservices/xmlrpc/trunk/server/src/main/java/org/apache/xmlrpc/server/XmlRpcServerConfigImpl.java Mon Sep 11 04:28:03 2006 @@ -23,6 +23,7 @@ public class XmlRpcServerConfigImpl extends XmlRpcConfigImpl implements XmlRpcServerConfig, XmlRpcHttpServerConfig { private boolean isKeepAliveEnabled; + private boolean isEnabledForExceptions; /** Sets, whether HTTP keepalive is enabled for this server. * @param pKeepAliveEnabled True, if keepalive is enabled. False otherwise. @@ -32,4 +33,13 @@ } public boolean isKeepAliveEnabled() { return isKeepAliveEnabled; } + + /** Sets, whether the server may create a "faultCause" element in an error + * response. Note, that this may be a security issue! + */ + public void setEnabledForExceptions(boolean pEnabledForExceptions) { + isEnabledForExceptions = pEnabledForExceptions; + } + + public boolean isEnabledForExceptions() { return isEnabledForExceptions; } } Modified: webservices/xmlrpc/trunk/server/src/main/java/org/apache/xmlrpc/server/XmlRpcStreamServer.java URL: http://svn.apache.org/viewvc/webservices/xmlrpc/trunk/server/src/main/java/org/apache/xmlrpc/server/XmlRpcStreamServer.java?view=diff&rev=442177&r1=442176&r2=442177 ============================================================================== --- webservices/xmlrpc/trunk/server/src/main/java/org/apache/xmlrpc/server/XmlRpcStreamServer.java (original) +++ webservices/xmlrpc/trunk/server/src/main/java/org/apache/xmlrpc/server/XmlRpcStreamServer.java Mon Sep 11 04:28:03 2006 @@ -92,20 +92,29 @@ } } - protected void writeError(XmlRpcStreamRequestConfig pConfig, OutputStream pStream, + /** + * This method allows to convert the error into another error. For example, this + * may be an error, which could be deserialized by the client. + */ + protected Throwable convertThrowable(Throwable pError) { + return pError; + } + + protected void writeError(XmlRpcStreamRequestConfig pConfig, OutputStream pStream, Throwable pError) throws XmlRpcException { - final int code; + final Throwable error = convertThrowable(pError); + final int code; final String message; - if (pError instanceof XmlRpcException) { - XmlRpcException ex = (XmlRpcException) pError; + if (error instanceof XmlRpcException) { + XmlRpcException ex = (XmlRpcException) error; code = ex.code; } else { code = 0; } - message = pError.getMessage(); + message = error.getMessage(); try { - getXmlRpcWriter(pConfig, pStream).write(pConfig, code, message); + getXmlRpcWriter(pConfig, pStream).write(pConfig, code, message, error); } catch (SAXException e) { throw new XmlRpcException("Failed to write XML-RPC response: " + e.getMessage(), e); } Modified: webservices/xmlrpc/trunk/server/src/main/java/org/apache/xmlrpc/webserver/Connection.java URL: http://svn.apache.org/viewvc/webservices/xmlrpc/trunk/server/src/main/java/org/apache/xmlrpc/webserver/Connection.java?view=diff&rev=442177&r1=442176&r2=442177 ============================================================================== --- webservices/xmlrpc/trunk/server/src/main/java/org/apache/xmlrpc/webserver/Connection.java (original) +++ webservices/xmlrpc/trunk/server/src/main/java/org/apache/xmlrpc/webserver/Connection.java Mon Sep 11 04:28:03 2006 @@ -121,6 +121,7 @@ requestData.setBasicEncoding(serverConfig.getBasicEncoding()); requestData.setContentLengthOptional(serverConfig.isContentLengthOptional()); requestData.setEnabledForExtensions(serverConfig.isEnabledForExtensions()); + requestData.setEnabledForExceptions(serverConfig.isEnabledForExceptions()); // reset user authentication String line = readLine(); @@ -293,11 +294,13 @@ output.write(serverName); output.write(conclose); output.write(ctype); - if (pContentLength != -1) { + if (pContentLength == -1) { + output.write(newline); + } else { output.write(clength); output.write(toHTTPBytes(Integer.toString(pContentLength))); + output.write(doubleNewline); } - output.write(doubleNewline); } } Modified: webservices/xmlrpc/trunk/server/src/main/java/org/apache/xmlrpc/webserver/ConnectionServer.java URL: http://svn.apache.org/viewvc/webservices/xmlrpc/trunk/server/src/main/java/org/apache/xmlrpc/webserver/ConnectionServer.java?view=diff&rev=442177&r1=442176&r2=442177 ============================================================================== --- webservices/xmlrpc/trunk/server/src/main/java/org/apache/xmlrpc/webserver/ConnectionServer.java (original) +++ webservices/xmlrpc/trunk/server/src/main/java/org/apache/xmlrpc/webserver/ConnectionServer.java Mon Sep 11 04:28:03 2006 @@ -16,7 +16,6 @@ package org.apache.xmlrpc.webserver; import java.io.IOException; -import java.io.InputStream; import java.io.OutputStream; import org.apache.xmlrpc.XmlRpcException; Modified: webservices/xmlrpc/trunk/server/src/main/java/org/apache/xmlrpc/webserver/XmlRpcServletServer.java URL: http://svn.apache.org/viewvc/webservices/xmlrpc/trunk/server/src/main/java/org/apache/xmlrpc/webserver/XmlRpcServletServer.java?view=diff&rev=442177&r1=442176&r2=442177 ============================================================================== --- webservices/xmlrpc/trunk/server/src/main/java/org/apache/xmlrpc/webserver/XmlRpcServletServer.java (original) +++ webservices/xmlrpc/trunk/server/src/main/java/org/apache/xmlrpc/webserver/XmlRpcServletServer.java Mon Sep 11 04:28:03 2006 @@ -80,6 +80,7 @@ result.setGzipCompressing(HttpUtil.isUsingGzipEncoding(pRequest.getHeader("Content-Encoding"))); result.setGzipRequesting(HttpUtil.isUsingGzipEncoding(pRequest.getHeaders("Accept-Encoding"))); result.setEncoding(pRequest.getCharacterEncoding()); + result.setEnabledForExceptions(serverConfig.isEnabledForExceptions()); HttpUtil.parseAuthorization(result, pRequest.getHeader("Authorization")); return result; } Modified: webservices/xmlrpc/trunk/src/changes/changes.xml URL: http://svn.apache.org/viewvc/webservices/xmlrpc/trunk/src/changes/changes.xml?view=diff&rev=442177&r1=442176&r2=442177 ============================================================================== --- webservices/xmlrpc/trunk/src/changes/changes.xml (original) +++ webservices/xmlrpc/trunk/src/changes/changes.xml Mon Sep 11 04:28:03 2006 @@ -3,6 +3,11 @@ <title>Changes in Apache XML-RPC</title> </properties> <body> + <release version="3.1-SNAPSHOT" date="Not yet released"> + <action dev="jochen" type="add"> + Introduced the "enabledForExceptions" property. + </action> + </release> <release version="3.0.1-SNAPSHOT" date="Not yet released"> <action dev="jochen" type="fix"> Make the HttpClient creation in XmlRpcCommonsTransport and the Modified: webservices/xmlrpc/trunk/src/site/apt/advanced.apt URL: http://svn.apache.org/viewvc/webservices/xmlrpc/trunk/src/site/apt/advanced.apt?view=diff&rev=442177&r1=442176&r2=442177 ============================================================================== --- webservices/xmlrpc/trunk/src/site/apt/advanced.apt (original) +++ webservices/xmlrpc/trunk/src/site/apt/advanced.apt Mon Sep 11 04:28:03 2006 @@ -82,6 +82,14 @@ XmlRpcException, then you'll need to catch the XmlRpcException. Otherwise, it's UndeclaredThrowableException. + It is recommended to use the property enabledForExceptions. If this property + is set, then the server will attempt to convert the exception into a byte + array, which is transmitted to the client. The client will be able to + convert the byte array back into an exception and throw that, as if it + came right out of the client. Note, that this approach may cause security + and privacy issues, because the serialized exception may, in theory, contain + arbitrary objects. + * Cookie handling Cookie has not yet been generalized. In other words, it depends on the Modified: webservices/xmlrpc/trunk/src/site/apt/client.apt URL: http://svn.apache.org/viewvc/webservices/xmlrpc/trunk/src/site/apt/client.apt?view=diff&rev=442177&r1=442176&r2=442177 ============================================================================== --- webservices/xmlrpc/trunk/src/site/apt/client.apt (original) +++ webservices/xmlrpc/trunk/src/site/apt/client.apt Mon Sep 11 04:28:03 2006 @@ -146,6 +146,12 @@ | | only available, if the property | | | enabledForExtensions is set was well. | *-----------------------+---------------------------------------------------+ +| enabledForExceptions | Whether the client should request, that the | +| | server returns exceptions as serializable objects.| +| | If the server does, then the client will | +| | deserialize such exceptions and throw them, as | +| | if they had been cause within the clients code. | +*-----------------------+---------------------------------------------------+ | enabledForExtensions | Whether the vendor extensions of Apache XML-RPC | | | should be enabled. By default, Apache XML-RPC is | | | strictly compliant to the XML-RPC specification. | Modified: webservices/xmlrpc/trunk/src/site/apt/extensions.apt URL: http://svn.apache.org/viewvc/webservices/xmlrpc/trunk/src/site/apt/extensions.apt?view=diff&rev=442177&r1=442176&r2=442177 ============================================================================== --- webservices/xmlrpc/trunk/src/site/apt/extensions.apt (original) +++ webservices/xmlrpc/trunk/src/site/apt/extensions.apt Mon Sep 11 04:28:03 2006 @@ -128,4 +128,9 @@ ---------------------------------------------------------------------------- <i8 xmlns="http://ws.apache.org/xmlrpc/namespaces/extensions">78934</i8> ---------------------------------------------------------------------------- - \ No newline at end of file + +Exception Handling + + If the server property "enabledForExceptions" is turned on, then the server + will convert exceptions into a byte array and send them to the client within + a "faultCause" message. Modified: webservices/xmlrpc/trunk/src/site/apt/server.apt URL: http://svn.apache.org/viewvc/webservices/xmlrpc/trunk/src/site/apt/server.apt?view=diff&rev=442177&r1=442176&r2=442177 ============================================================================== --- webservices/xmlrpc/trunk/src/site/apt/server.apt (original) +++ webservices/xmlrpc/trunk/src/site/apt/server.apt Mon Sep 11 04:28:03 2006 @@ -90,6 +90,15 @@ *-----------------------+---------------------------------------------------+ | Property Name | Description | *-----------------------+---------------------------------------------------+ +| enabledForExceptions | If the server catches an exception, and this | +| | property is set, then the server will convert | +| | the exception into a byte array (by using an | +| | ObjectOutputStream) and return the exception to | +| | the client. Note, that this may have privacy | +| | or even security implications, because Exceptions | +| | may contain arbitrary Java objects, which you | +| | possibly do not want to be sent to the client. | +*-----------------------+---------------------------------------------------+ | enabledForExtensions | Whether the vendor extensions of Apache XML-RPC | | | should be enabled. By default, Apache XML-RPC is | | | strictly compliant to the XML-RPC specification. | Modified: webservices/xmlrpc/trunk/tests/src/test/java/org/apache/xmlrpc/test/BaseTest.java URL: http://svn.apache.org/viewvc/webservices/xmlrpc/trunk/tests/src/test/java/org/apache/xmlrpc/test/BaseTest.java?view=diff&rev=442177&r1=442176&r2=442177 ============================================================================== --- webservices/xmlrpc/trunk/tests/src/test/java/org/apache/xmlrpc/test/BaseTest.java (original) +++ webservices/xmlrpc/trunk/tests/src/test/java/org/apache/xmlrpc/test/BaseTest.java Mon Sep 11 04:28:03 2006 @@ -32,6 +32,7 @@ import org.apache.xmlrpc.XmlRpcException; import org.apache.xmlrpc.client.XmlRpcClient; import org.apache.xmlrpc.common.XmlRpcExtensionException; +import org.apache.xmlrpc.common.XmlRpcInvocationException; import org.apache.xmlrpc.server.XmlRpcHandlerMapping; import org.w3c.dom.Document; import org.w3c.dom.Element; @@ -107,6 +108,12 @@ * @return The argument, concatenated with itself. */ public String stringParam(String pArg) { return pArg+pArg; } + /** + * Throws a NullPointerException. + */ + public Object throwNPE() { + throw new NullPointerException(); + } /** Returns the argument, concatenated with itself. * @param pArg The argument being concatenated. * @return The argument, concatenated with itself. @@ -884,5 +891,27 @@ assertEquals(cal2.getTime(), result); result = client.execute(getConfig(pProvider), methodName, params); assertEquals(cal2.getTime(), result); + } + + /** + * Tests, whether a NullPointerException, thrown by the server, can be + * trapped by the client. + */ + public void testCatchNPE() throws Exception { + for (int i = 0; i < providers.length; i++) { + testCatchNPE(providers[i]); + } + } + + private void testCatchNPE(ClientProvider pProvider) throws Exception { + final XmlRpcClient client = pProvider.getClient(); + final String methodName = "Remote.throwNPE"; + try { + client.execute(getExConfig(pProvider), methodName, (Object[]) null); + } catch (XmlRpcInvocationException e) { + if (!(e.getCause() instanceof NullPointerException)) { + throw e; + } + } } } Modified: webservices/xmlrpc/trunk/tests/src/test/java/org/apache/xmlrpc/test/DynamicProxyTest.java URL: http://svn.apache.org/viewvc/webservices/xmlrpc/trunk/tests/src/test/java/org/apache/xmlrpc/test/DynamicProxyTest.java?view=diff&rev=442177&r1=442176&r2=442177 ============================================================================== --- webservices/xmlrpc/trunk/tests/src/test/java/org/apache/xmlrpc/test/DynamicProxyTest.java (original) +++ webservices/xmlrpc/trunk/tests/src/test/java/org/apache/xmlrpc/test/DynamicProxyTest.java Mon Sep 11 04:28:03 2006 @@ -21,6 +21,7 @@ import org.apache.xmlrpc.client.XmlRpcClient; import org.apache.xmlrpc.client.util.ClientFactory; import org.apache.xmlrpc.server.XmlRpcHandlerMapping; +import org.xml.sax.SAXException; /** Test case for the {@link ClientFactory}. @@ -33,6 +34,11 @@ /** Returns the sum of the given integers. */ public int add(int pNum1, int pNum2); + + /** + * Throws a SAXException. + */ + public Object parse(String pMessage) throws SAXException; } /** Implementation of {@link DynamicProxyTest.Adder}, which is used by @@ -42,6 +48,9 @@ public int add(int pNum1, int pNum2) { return pNum1 + pNum2; } + public Object parse(String pMessage) throws SAXException { + throw new SAXException("Failed to parse message: " + pMessage); + } } protected XmlRpcHandlerMapping getHandlerMapping() throws IOException, XmlRpcException { @@ -54,6 +63,12 @@ return new ClientFactory(client); } + private ClientFactory getExClientFactory(ClientProvider pProvider) throws Exception { + XmlRpcClient client = pProvider.getClient(); + client.setConfig(getExConfig(pProvider)); + return new ClientFactory(client); + } + /** Tests calling the {@link Adder#add(int,int)} method * by using an object, which has been created by the * {@link ClientFactory}. @@ -68,5 +83,24 @@ ClientFactory factory = getClientFactory(pProvider); Adder adder = (Adder) factory.newInstance(Adder.class); assertEquals(6, adder.add(2, 4)); + } + + /** Tests trapping a SAXException. + */ + public void testParseCall() throws Exception { + for (int i = 0; i < providers.length; i++) { + testParseCall(providers[i]); + } + } + + private void testParseCall(ClientProvider pProvider) throws Exception { + ClientFactory factory = getExClientFactory(pProvider); + Adder adder = (Adder) factory.newInstance(Adder.class); + try { + adder.parse("foo"); + fail("Expected SAXException"); + } catch (SAXException e) { + // Ok + } } } Modified: webservices/xmlrpc/trunk/tests/src/test/java/org/apache/xmlrpc/test/ServletWebServerProvider.java URL: http://svn.apache.org/viewvc/webservices/xmlrpc/trunk/tests/src/test/java/org/apache/xmlrpc/test/ServletWebServerProvider.java?view=diff&rev=442177&r1=442176&r2=442177 ============================================================================== --- webservices/xmlrpc/trunk/tests/src/test/java/org/apache/xmlrpc/test/ServletWebServerProvider.java (original) +++ webservices/xmlrpc/trunk/tests/src/test/java/org/apache/xmlrpc/test/ServletWebServerProvider.java Mon Sep 11 04:28:03 2006 @@ -54,6 +54,7 @@ XmlRpcServerConfigImpl serverConfig = (XmlRpcServerConfigImpl) server.getConfig(); serverConfig.setEnabledForExtensions(true); serverConfig.setContentLengthOptional(!contentLength); + serverConfig.setEnabledForExceptions(true); webServer.start(); port = webServer.getPort(); } Modified: webservices/xmlrpc/trunk/tests/src/test/java/org/apache/xmlrpc/test/WebServerProvider.java URL: http://svn.apache.org/viewvc/webservices/xmlrpc/trunk/tests/src/test/java/org/apache/xmlrpc/test/WebServerProvider.java?view=diff&rev=442177&r1=442176&r2=442177 ============================================================================== --- webservices/xmlrpc/trunk/tests/src/test/java/org/apache/xmlrpc/test/WebServerProvider.java (original) +++ webservices/xmlrpc/trunk/tests/src/test/java/org/apache/xmlrpc/test/WebServerProvider.java Mon Sep 11 04:28:03 2006 @@ -58,6 +58,7 @@ XmlRpcServerConfigImpl serverConfig = (XmlRpcServerConfigImpl) server.getConfig(); serverConfig.setEnabledForExtensions(true); serverConfig.setContentLengthOptional(!contentLength); + serverConfig.setEnabledForExceptions(true); webServer.start(); isActive = true; } Modified: webservices/xmlrpc/trunk/tests/src/test/java/org/apache/xmlrpc/test/XmlRpcTestCase.java URL: http://svn.apache.org/viewvc/webservices/xmlrpc/trunk/tests/src/test/java/org/apache/xmlrpc/test/XmlRpcTestCase.java?view=diff&rev=442177&r1=442176&r2=442177 ============================================================================== --- webservices/xmlrpc/trunk/tests/src/test/java/org/apache/xmlrpc/test/XmlRpcTestCase.java (original) +++ webservices/xmlrpc/trunk/tests/src/test/java/org/apache/xmlrpc/test/XmlRpcTestCase.java Mon Sep 11 04:28:03 2006 @@ -52,6 +52,7 @@ protected XmlRpcClientConfig getExConfig(ClientProvider pProvider) throws Exception { XmlRpcClientConfigImpl config = getConfig(pProvider); config.setEnabledForExtensions(true); + config.setEnabledForExceptions(true); return config; } From xmlrpcadamswilliam@example.net Tue Sep 12 10:24:47 2006 Return-Path: <xmlrpcadamswilliam@example.net> Delivered-To: adamswilliam@example.net Received: (qmail 62743 invoked from network); 12 Sep 2006 10:24:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 12 Sep 2006 10:24:47 -0000 Received: (qmail 21624 invoked by uid 500); 12 Sep 2006 10:24:47 -0000 Delivered-To: adamswilliam@example.net Received: (qmail 21488 invoked by uid 500); 12 Sep 2006 10:24:47 -0000 Mailing-List: contact adamswilliam@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:adamswilliam@example.net> List-Unsubscribe: <mailto:adamswilliam@example.net> List-Post: <mailto:adamswilliam@example.net> List-Id: <xmlrpc-auto.ws.apache.org> Reply-To: adamswilliam@example.net Delivered-To: mailing list adamswilliam@example.net Received: (qmail 21479 invoked by uid 99); 12 Sep 2006 10:24:47 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Sep 2006 03:24:47 -0700 X-ASF-Spam-Status: No, hits=0.6 required=5.0 tests=HOT_NASTY Received: from ([83.161.120.155:39246] helo=brutus.apache.org) by idunn.apache.osuosl.org (ecelerity 2.1 r(10620)) with ESMTP id 66/70-01645-AFA86054 for <adamswilliam@example.net>; Tue, 12 Sep 2006 03:24:58 -0700 Received: from brutus (localhost [83.161.120.155]) by brutus.apache.org (Postfix) with ESMTP id 590AA41000E for <adamswilliam@example.net>; Tue, 12 Sep 2006 10:21:22 +0000 (GMT) Message-ID: <25815381.1158056482362.JavaMail.jira@brutus> Date: Tue, 12 Sep 2006 03:21:22 -0700 (PDT) From: "Alastair Tse (JIRA)" <adamswilliam@example.net> To: adamswilliam@example.net Subject: [jira] Created: (XMLRPC-112) XmlRpcClient executeAsync() causes failures for subsequent execute() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N XmlRpcClient executeAsync() causes failures for subsequent execute() -------------------------------------------------------------------- Key: XMLRPC-112 URL: http://issues.apache.org/jira/browse/XMLRPC-112 Project: XML-RPC Issue Type: Bug Components: Releases Affects Versions: 3.0 Environment: Mac OS X 10.4 on the Client Reporter: Alastair Tse I'm currently using Apache WS XML-RPC 3.0 and I think I might have stumbled across a bug regarding using executeAsync() and execute() in the same client. Basically, I have an XMLRPC client which I would like to use synchronous calls and some with asynchronous, however, as soon as I start using executeAsync(), all the subsequent execute() will start to fail. The XML-RPC server is a Python SimpleXMLRPCServer. I've also tested it with the twisted.web XMLRPC implementation as well. I did some further investigating and found that the executeAsync call was sending a "Content-Length: 0" with no corresponding XMLRPC request to the server, causing an HTTP 500 response from the server. >From ngrep, the HTTP headers look something like this: T 83.161.120.155:50335 -> XX.XXX.XXX.XX:8999 [AP] POST / HTTP/1.1..Content-Type: text/xml..User-Agent: Apache XML RPC 3.0 (Su n HTTP Transport)..Content-Length: 0..Cache-Control: no-cache..Pragma: no-c ache..Host: XX.XXX.XXX.XX:8999..Accept: text/html, image/gif, i mage/jpeg, *; q=.2, */*; q=.2..Connection: keep-alive.... ## T XX.XXX.XXX.XX:8999 -> 83.161.120.155:50335 [AP] HTTP/1.0 500 Internal error.. ## Attached is an example client that produces an error. Change the execute call to a function on an echo XMLRPC server. It would be great to know if it is my fault, or something funny going on with the threading inside XMLRPC. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira From xmlrpcadamswilliam@example.net Tue Sep 12 10:31:49 2006 Return-Path: <xmlrpcadamswilliam@example.net> Delivered-To: adamswilliam@example.net Received: (qmail 63408 invoked from network); 12 Sep 2006 10:31:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 12 Sep 2006 10:31:49 -0000 Received: (qmail 24514 invoked by uid 500); 12 Sep 2006 10:31:49 -0000 Delivered-To: adamswilliam@example.net Received: (qmail 24481 invoked by uid 500); 12 Sep 2006 10:31:48 -0000 Mailing-List: contact adamswilliam@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:adamswilliam@example.net> List-Unsubscribe: <mailto:adamswilliam@example.net> List-Post: <mailto:adamswilliam@example.net> List-Id: <xmlrpc-auto.ws.apache.org> Reply-To: adamswilliam@example.net Delivered-To: mailing list adamswilliam@example.net Received: (qmail 24469 invoked by uid 99); 12 Sep 2006 10:31:48 -0000 Received: from idunn.apache.osuosl.org (HELO idunn.apache.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Sep 2006 03:31:48 -0700 X-ASF-Spam-Status: No, hits=0.6 required=5.0 tests=HOT_NASTY Received: from ([83.161.120.155:55008] helo=brutus.apache.org) by idunn.apache.osuosl.org (ecelerity 2.1 r(10620)) with ESMTP id 90/A0-01645-F9C86054 for <adamswilliam@example.net>; Tue, 12 Sep 2006 03:32:00 -0700 Received: from brutus (localhost [83.161.120.155]) by brutus.apache.org (Postfix) with ESMTP id 51B18714327 for <adamswilliam@example.net>; Tue, 12 Sep 2006 10:28:23 +0000 (GMT) Message-ID: <5917819.1158056903332.JavaMail.jira@brutus> Date: Tue, 12 Sep 2006 03:28:23 -0700 (PDT) From: "Alastair Tse (JIRA)" <adamswilliam@example.net> To: adamswilliam@example.net Subject: [jira] Updated: (XMLRPC-112) XmlRpcClient executeAsync() causes failures for subsequent execute() In-Reply-To: <25815381.1158056482362.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/XMLRPC-112?page=all ] Alastair Tse updated XMLRPC-112: -------------------------------- Attachment: XmlRpcAsync.java Change the methodName and server uri to a test server. > XmlRpcClient executeAsync() causes failures for subsequent execute() > -------------------------------------------------------------------- > > Key: XMLRPC-112 > URL: http://issues.apache.org/jira/browse/XMLRPC-112 > Project: XML-RPC > Issue Type: Bug > Components: Releases > Affects Versions: 3.0 > Environment: Mac OS X 10.4 on the Client > Reporter: Alastair Tse > Attachments: XmlRpcAsync.java > > > I'm currently using Apache WS XML-RPC 3.0 and I think I might have stumbled across a bug regarding using executeAsync() and execute() in the same client. Basically, I have an XMLRPC client which I would like to use synchronous calls and some with asynchronous, however, as soon as I start using executeAsync(), all the subsequent execute() will start to fail. > The XML-RPC server is a Python SimpleXMLRPCServer. I've also tested it with the twisted.web XMLRPC implementation as well. I did some further investigating and found that the executeAsync call was sending a "Content-Length: 0" with no corresponding XMLRPC request to the server, causing an HTTP 500 response from the server. > From ngrep, the HTTP headers look something like this: > T 83.161.120.155:50335 -> XX.XXX.XXX.XX:8999 [AP] > POST / HTTP/1.1..Content-Type: text/xml..User-Agent: Apache XML RPC 3.0 (Su > n HTTP Transport)..Content-Length: 0..Cache-Control: no-cache..Pragma: no-c > ache..Host: XX.XXX.XXX.XX:8999..Accept: text/html, image/gif, i > mage/jpeg, *; q=.2, */*; q=.2..Connection: keep-alive.... > ## > T XX.XXX.XXX.XX:8999 -> 83.161.120.155:50335 [AP] > HTTP/1.0 500 Internal error.. > ## > Attached is an example client that produces an error. Change the execute call to a function on an echo XMLRPC server. > It would be great to know if it is my fault, or something funny going on with the threading inside XMLRPC. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira From xmlrpcadamswilliam@example.net Fri Sep 15 06:50:18 2006 Return-Path: <xmlrpcadamswilliam@example.net> Delivered-To: adamswilliam@example.net Received: (qmail 55185 invoked from network); 15 Sep 2006 06:50:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 15 Sep 2006 06:50:18 -0000 Received: (qmail 62670 invoked by uid 500); 15 Sep 2006 06:50:18 -0000 Delivered-To: adamswilliam@example.net Received: (qmail 62648 invoked by uid 500); 15 Sep 2006 06:50:17 -0000 Mailing-List: contact adamswilliam@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:adamswilliam@example.net> List-Unsubscribe: <mailto:adamswilliam@example.net> List-Post: <mailto:adamswilliam@example.net> List-Id: <xmlrpc-auto.ws.apache.org> Reply-To: adamswilliam@example.net Delivered-To: mailing list adamswilliam@example.net Received: (qmail 62639 invoked by uid 99); 15 Sep 2006 06:50:17 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Sep 2006 23:50:17 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO brutus.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Sep 2006 23:50:14 -0700 Received: from brutus (localhost [83.161.120.155]) by brutus.apache.org (Postfix) with ESMTP id A4524714349 for <adamswilliam@example.net>; Fri, 15 Sep 2006 06:46:22 +0000 (GMT) Message-ID: <19267288.1158302782670.JavaMail.jira@brutus> Date: Thu, 14 Sep 2006 23:46:22 -0700 (PDT) From: =?utf-8?Q?Juha_Syrj=C3=A4l=C3=A4_=28JIRA=29?= <adamswilliam@example.net> To: adamswilliam@example.net Subject: [jira] Created: (XMLRPC-113) faultCode and faultString not working when throwing XmlRpcException on server MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N faultCode and faultString not working when throwing XmlRpcException on serv= er ---------------------------------------------------------------------------= -- Key: XMLRPC-113 URL: http://issues.apache.org/jira/browse/XMLRPC-113 Project: XML-RPC Issue Type: Bug Components: Releases Affects Versions: 3.0 Environment: Tomcat Reporter: Juha Syrj=C3=A4l=C3=A4 I am trying to create fault message with specific faultCode and faultString= , but so far I have had little success. I am using XML-RPC libs from file xmlrpc-3.0-bin.tar.gz The method I am using on server is this: public Map method(Map request) throws XmlRpcException { throw new XmlRpcException(301, "My error message"); } This should generate fault message with faultCode=3D301 and faultString=3D"= My error message". However, this XML is what server sends over network. Notice that faultCode = is 0 and not 301, and faultString has additional text appended before "My e= rror message". <?xml version=3D"1.0" encoding=3D"UTF-8"?> <methodResponse xmlns:ex=3D"http://ws.apache.org/xmlrpc/namespaces/extensio= ns"> <fault> <value> <struct> <member> <name>faultString</name> <value>Failed to invoke method method in class MyXmlRpcClass: My error mess= age</value> </member> <member> <name>faultCode</name> <value><i4>0</i4></value> </member> </struct> </value> </fault> </methodResponse> --=20 This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: htt= p://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira From xmlrpcadamswilliam@example.net Fri Sep 15 08:17:19 2006 Return-Path: <xmlrpcadamswilliam@example.net> Delivered-To: adamswilliam@example.net Received: (qmail 90715 invoked from network); 15 Sep 2006 08:17:19 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 15 Sep 2006 08:17:19 -0000 Received: (qmail 83967 invoked by uid 500); 15 Sep 2006 08:17:19 -0000 Delivered-To: adamswilliam@example.net Received: (qmail 83827 invoked by uid 500); 15 Sep 2006 08:17:18 -0000 Mailing-List: contact adamswilliam@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:adamswilliam@example.net> List-Unsubscribe: <mailto:adamswilliam@example.net> List-Post: <mailto:adamswilliam@example.net> List-Id: <xmlrpc-auto.ws.apache.org> Reply-To: adamswilliam@example.net Delivered-To: mailing list adamswilliam@example.net Received: (qmail 83818 invoked by uid 99); 15 Sep 2006 08:17:18 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Sep 2006 01:17:18 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0
{'source': 'Apache Software Foundation Public Mail Archives'}