Return-Path: Delivered-To: apmail-incubator-cxf-commits-archive@locus.apache.org Received: (qmail 53878 invoked from network); 23 Apr 2007 07:00:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 23 Apr 2007 07:00:45 -0000 Received: (qmail 20015 invoked by uid 500); 23 Apr 2007 07:00:51 -0000 Delivered-To: apmail-incubator-cxf-commits-archive@incubator.apache.org Received: (qmail 19978 invoked by uid 500); 23 Apr 2007 07:00:51 -0000 Mailing-List: contact cxf-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cxf-dev@incubator.apache.org Delivered-To: mailing list cxf-commits@incubator.apache.org Received: (qmail 19969 invoked by uid 99); 23 Apr 2007 07:00:51 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Apr 2007 00:00:51 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Apr 2007 00:00:44 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id BD8381A9838; Mon, 23 Apr 2007 00:00:23 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r531355 - in /incubator/cxf/trunk: distribution/src/main/release/samples/restful_dispatch/src/demo/restful/client/Client.java systests/src/test/java/org/apache/cxf/systest/rest/RestClientServerTest.java Date: Mon, 23 Apr 2007 07:00:23 -0000 To: cxf-commits@incubator.apache.org From: jliu@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070423070023.BD8381A9838@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: jliu Date: Mon Apr 23 00:00:22 2007 New Revision: 531355 URL: http://svn.apache.org/viewvc?view=rev&rev=531355 Log: CXF-578 (Exception occured when run the sample restful_dispatch client). It appears to me that JAX-WS Dispatch is not appropriate for HTTP GET, the demo is fixed by not calling Dispatch for HTTP GET. Modified: incubator/cxf/trunk/distribution/src/main/release/samples/restful_dispatch/src/demo/restful/client/Client.java incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/rest/RestClientServerTest.java Modified: incubator/cxf/trunk/distribution/src/main/release/samples/restful_dispatch/src/demo/restful/client/Client.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/restful_dispatch/src/demo/restful/client/Client.java?view=diff&rev=531355&r1=531354&r2=531355 ============================================================================== --- incubator/cxf/trunk/distribution/src/main/release/samples/restful_dispatch/src/demo/restful/client/Client.java (original) +++ incubator/cxf/trunk/distribution/src/main/release/samples/restful_dispatch/src/demo/restful/client/Client.java Mon Apr 23 00:00:22 2007 @@ -69,7 +69,7 @@ source = new StreamSource(in); printSource(source); - // Sent HTTP GET request to query customer info using JAX-WS Dispatch + // Sent HTTP POST request to update customer info using JAX-WS Dispatch URI endpointURI = new URI(endpointAddress.toString()); String path = null; if (endpointURI != null) { @@ -78,18 +78,10 @@ Service service = Service.create(serviceName); service.addPort(portName, HTTPBinding.HTTP_BINDING, endpointAddress); - Dispatch dispatcher = service.createDispatch(portName, + Dispatch dispatcher = service.createDispatch(portName, DOMSource.class, Service.Mode.PAYLOAD); Map requestContext = dispatcher.getRequestContext(); - requestContext.put(MessageContext.HTTP_REQUEST_METHOD, new String("GET")); - requestContext.put(MessageContext.QUERY_STRING, "id=1234"); - requestContext.put(MessageContext.PATH_INFO, path); - System.out.println("Invoking through HTTP GET to query customer using JAX-WS Dispatch"); - DOMSource returnSource = dispatcher.invoke(null); - printSource(returnSource); - - // Sent HTTP POST request to update customer info using JAX-WS Dispatch Client client = new Client(); InputStream is = client.getClass().getResourceAsStream("CustomerJohnReq.xml"); Document doc = XMLUtils.parse(is); Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/rest/RestClientServerTest.java URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/rest/RestClientServerTest.java?view=diff&rev=531355&r1=531354&r2=531355 ============================================================================== --- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/rest/RestClientServerTest.java (original) +++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/rest/RestClientServerTest.java Mon Apr 23 00:00:22 2007 @@ -112,6 +112,7 @@ @Test @Ignore + //This test should be removed, as JAX-WS Dispatch is not appropriate for being used by HTTP GET. public void testHttpGETDispatchHTTPBinding() throws Exception { Service service = Service.create(serviceName); URI endpointURI = new URI(endpointAddress);