Return-Path: Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: (qmail 83435 invoked from network); 2 Oct 2009 21:20:42 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 2 Oct 2009 21:20:42 -0000 Received: (qmail 69099 invoked by uid 500); 2 Oct 2009 21:20:42 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 69007 invoked by uid 500); 2 Oct 2009 21:20:42 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 68998 invoked by uid 99); 2 Oct 2009 21:20:42 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Oct 2009 21:20:42 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Oct 2009 21:20:29 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 5256923888D4; Fri, 2 Oct 2009 21:20:07 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r821172 - in /cxf/branches/2.2.x-fixes: ./ distribution/ distribution/manifest/ distribution/src/main/assembly/ distribution/src/main/release/lib-samples/ distribution/src/main/release/samples/ distribution/src/main/release/samples/wsdl_fir... Date: Fri, 02 Oct 2009 21:20:06 -0000 To: commits@cxf.apache.org From: dkulp@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20091002212007.5256923888D4@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: dkulp Date: Fri Oct 2 21:20:05 2009 New Revision: 821172 URL: http://svn.apache.org/viewvc?rev=821172&view=rev Log: Merged revisions 816407,817470,817676,817993 via svnmerge from https://svn.apache.org/repos/asf/cxf/trunk ........ r816407 | cschneider | 2009-09-17 19:09:43 -0400 (Thu, 17 Sep 2009) | 1 line ........ r817470 | dkulp | 2009-09-21 21:35:39 -0400 (Mon, 21 Sep 2009) | 2 lines Move jars that are only there for samples into separate lib dir to distinguish them from "runtime" things. ........ r817676 | dkulp | 2009-09-22 10:37:31 -0400 (Tue, 22 Sep 2009) | 1 line Add readme to explain the new dir. ........ r817993 | cschneider | 2009-09-23 03:34:41 -0400 (Wed, 23 Sep 2009) | 1 line CXF-52 added documentation and test for one way call ........ Added: cxf/branches/2.2.x-fixes/distribution/src/main/release/lib-samples/ - copied from r817676, cxf/trunk/distribution/src/main/release/lib-samples/ cxf/branches/2.2.x-fixes/distribution/src/main/release/lib-samples/README - copied unchanged from r817676, cxf/trunk/distribution/src/main/release/lib-samples/README cxf/branches/2.2.x-fixes/distribution/src/main/release/samples/wsdl_first/src/main/ - copied from r816407, cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/ cxf/branches/2.2.x-fixes/distribution/src/main/release/samples/wsdl_first/src/main/java/ - copied from r816407, cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/java/ cxf/branches/2.2.x-fixes/distribution/src/main/release/samples/wsdl_first/src/main/java/com/ - copied from r816407, cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/java/com/ cxf/branches/2.2.x-fixes/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/ - copied from r816407, cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/ cxf/branches/2.2.x-fixes/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/ - copied from r816407, cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/ cxf/branches/2.2.x-fixes/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/client/ - copied from r816407, cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/client/ cxf/branches/2.2.x-fixes/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/client/CustomerServiceClient.java - copied unchanged from r816407, cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/client/CustomerServiceClient.java cxf/branches/2.2.x-fixes/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/client/CustomerServiceSpringClient.java - copied unchanged from r816407, cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/client/CustomerServiceSpringClient.java cxf/branches/2.2.x-fixes/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/client/CustomerServiceTester.java - copied, changed from r816407, cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/client/CustomerServiceTester.java cxf/branches/2.2.x-fixes/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/client/client-beans.xml - copied unchanged from r816407, cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/client/client-beans.xml cxf/branches/2.2.x-fixes/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/server/ - copied from r816407, cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/server/ cxf/branches/2.2.x-fixes/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/server/CustomerServiceImpl.java - copied, changed from r816407, cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/server/CustomerServiceImpl.java cxf/branches/2.2.x-fixes/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/server/CustomerServiceServer.java - copied unchanged from r816407, cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/server/CustomerServiceServer.java cxf/branches/2.2.x-fixes/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/server/CustomerServiceSpringServer.java - copied unchanged from r816407, cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/server/CustomerServiceSpringServer.java cxf/branches/2.2.x-fixes/distribution/src/main/release/samples/wsdl_first/src/main/resources/ - copied from r816407, cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/resources/ cxf/branches/2.2.x-fixes/distribution/src/main/release/samples/wsdl_first/src/main/resources/client-applicationContext.xml - copied unchanged from r816407, cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/resources/client-applicationContext.xml cxf/branches/2.2.x-fixes/distribution/src/main/release/samples/wsdl_first/src/main/resources/cxf-servlet.xml - copied unchanged from r816407, cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/resources/cxf-servlet.xml cxf/branches/2.2.x-fixes/distribution/src/main/release/samples/wsdl_first/src/main/resources/log4j.conf - copied unchanged from r816407, cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/resources/log4j.conf cxf/branches/2.2.x-fixes/distribution/src/main/release/samples/wsdl_first/src/main/resources/server-applicationContext.xml - copied unchanged from r816407, cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/resources/server-applicationContext.xml cxf/branches/2.2.x-fixes/distribution/src/main/release/samples/wsdl_first/wsdl/CustomerService.wsdl - copied unchanged from r816407, cxf/trunk/distribution/src/main/release/samples/wsdl_first/wsdl/CustomerService.wsdl cxf/branches/2.2.x-fixes/distribution/src/main/release/samples/wsdl_first/wsdl/binding.xml - copied unchanged from r816407, cxf/trunk/distribution/src/main/release/samples/wsdl_first/wsdl/binding.xml Removed: cxf/branches/2.2.x-fixes/distribution/src/main/release/samples/wsdl_first/src/demo/ cxf/branches/2.2.x-fixes/distribution/src/main/release/samples/wsdl_first/wsdl/cxf-servlet.xml cxf/branches/2.2.x-fixes/distribution/src/main/release/samples/wsdl_first/wsdl/hello_world.wsdl Modified: cxf/branches/2.2.x-fixes/ (props changed) cxf/branches/2.2.x-fixes/distribution/manifest/pom.xml cxf/branches/2.2.x-fixes/distribution/pom.xml cxf/branches/2.2.x-fixes/distribution/src/main/assembly/bin.xml cxf/branches/2.2.x-fixes/distribution/src/main/release/samples/common_build.xml cxf/branches/2.2.x-fixes/distribution/src/main/release/samples/wsdl_first/README.txt cxf/branches/2.2.x-fixes/distribution/src/main/release/samples/wsdl_first/build.xml cxf/branches/2.2.x-fixes/distribution/src/main/release/samples/wsdl_first/pom.xml Propchange: cxf/branches/2.2.x-fixes/ ------------------------------------------------------------------------------ svn:mergeinfo = /cxf/trunk:816407,817470-817676,817993 Propchange: cxf/branches/2.2.x-fixes/ ------------------------------------------------------------------------------ Binary property 'svnmerge-integrated' - no diff available. Modified: cxf/branches/2.2.x-fixes/distribution/manifest/pom.xml URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/distribution/manifest/pom.xml?rev=821172&r1=821171&r2=821172&view=diff ============================================================================== --- cxf/branches/2.2.x-fixes/distribution/manifest/pom.xml (original) +++ cxf/branches/2.2.x-fixes/distribution/manifest/pom.xml Fri Oct 2 21:20:05 2009 @@ -261,10 +261,6 @@ commons-logging commons-logging - - commons-httpclient - commons-httpclient - ant Modified: cxf/branches/2.2.x-fixes/distribution/pom.xml URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/distribution/pom.xml?rev=821172&r1=821171&r2=821172&view=diff ============================================================================== --- cxf/branches/2.2.x-fixes/distribution/pom.xml (original) +++ cxf/branches/2.2.x-fixes/distribution/pom.xml Fri Oct 2 21:20:05 2009 @@ -270,10 +270,6 @@ ${pom.version} - commons-httpclient - commons-httpclient - - commons-logging commons-logging @@ -329,27 +325,42 @@ copy - ${project.build.directory}/additional-libs ${pom.groupId} cxf-integration-jbi ${pom.version} + ${project.build.directory}/additional-libs ${pom.groupId} cxf-integration-jca ${pom.version} + ${project.build.directory}/additional-libs ${pom.groupId} cxf-rt-bindings-jbi ${pom.version} + ${project.build.directory}/additional-libs ${pom.groupId} cxf-rt-transports-jbi ${pom.version} + ${project.build.directory}/additional-libs + + + junit + junit + 4.4 + ${project.build.directory}/sample-libs + + + commons-httpclient + commons-httpclient + 3.1 + ${project.build.directory}/sample-libs Modified: cxf/branches/2.2.x-fixes/distribution/src/main/assembly/bin.xml URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/distribution/src/main/assembly/bin.xml?rev=821172&r1=821171&r2=821172&view=diff ============================================================================== --- cxf/branches/2.2.x-fixes/distribution/src/main/assembly/bin.xml (original) +++ cxf/branches/2.2.x-fixes/distribution/src/main/assembly/bin.xml Fri Oct 2 21:20:05 2009 @@ -97,6 +97,13 @@ + target/sample-libs + apache-cxf-${cxf.version}/lib-samples + + **/* + + + manifest/target apache-cxf-${cxf.version}/lib Modified: cxf/branches/2.2.x-fixes/distribution/src/main/release/samples/common_build.xml URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/distribution/src/main/release/samples/common_build.xml?rev=821172&r1=821171&r2=821172&view=diff ============================================================================== --- cxf/branches/2.2.x-fixes/distribution/src/main/release/samples/common_build.xml (original) +++ cxf/branches/2.2.x-fixes/distribution/src/main/release/samples/common_build.xml Fri Oct 2 21:20:05 2009 @@ -96,6 +96,9 @@ + + + Modified: cxf/branches/2.2.x-fixes/distribution/src/main/release/samples/wsdl_first/README.txt URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/distribution/src/main/release/samples/wsdl_first/README.txt?rev=821172&r1=821171&r2=821172&view=diff ============================================================================== --- cxf/branches/2.2.x-fixes/distribution/src/main/release/samples/wsdl_first/README.txt (original) +++ cxf/branches/2.2.x-fixes/distribution/src/main/release/samples/wsdl_first/README.txt Fri Oct 2 21:20:05 2009 @@ -1,46 +1,70 @@ -Hello World Demo using Document/Literal Style -============================================= +WSDL First Demo +=============== -This demo illustrates the use of the JAX-WS APIs to run a simple -client against a standalone server using SOAP 1.1 over HTTP. +This demo shows how to build and call a webservice using a given WSDL (also called Contract First). +As writing a WSDL by hand is not so easy the following Howto may also be an interesting read: +http://cxf.apache.org/docs/defining-contract-first-webservices-with-wsdl-generation-from-java.html -It also shows how CXF configuration can be used to enable schema validation -on the client and/or server side: By default the message parameters would not -be validated, but the presence of the cxf.xml configuration file on -the classpath, and its content change this default behavior: -The configuration file specifies that - -a) if a JAX-WS client proxy is created for port {http://apache.org/hello_world_soap_http}SoapPort -it should have schema validation enabled. - -b) if a JAX-WS server endpoint is created for port {http://apache.org/hello_world_soap_http}SoapPort -it should have schema validation enabled. - -The client's second greetMe invocation causes an exception (a marshalling -error) on the client side, i.e. before the request with the invalid parameter -goes on the wire. -After commenting the definition of the element in cxf.xml you -will notice that the client's second greetMe invocation still throws an exception, -but that this time the exception is caused by an unmarshalling error on the -server side. -Commenting both elements, or renaming/removing the cfg.xml file, and thus -restoring the default behavior, results in the second greetMe invocation -not causing an exception. +This demo mainly addresses SOAP over HTTP in Document / Literal or Document / Literal wrapped style. +For other transports or styles the configuration may look different. -Please review the README in the samples directory before continuing. +The Demo consist of three parts: +- Creating the server and client code stubs from the WSDL +- Service implementation (using JAX-WS or using Spring) +- Client implementation (using JAX-WS or using Spring) + +Code generation +--------------- + +When using maven the code generation is done using the maven cxf-codegen-plugin +(see http://cxf.apache.org/docs/maven-cxf-codegen-plugin-wsdl-to-java.html). +In case ant is used the macro wsdl2java in the common_build.xml builds the code +(see http://cxf.apache.org/docs/wsdl-to-java.html). + +The code generation is tuned using a binding.xml file. In this case the file configures that +normal java Date is used for xsd:date and xsd:DateTime. If this is not present then XMLGregorianCalendar +will be used. + +One other common use of the binding file is to also generate asynchronous stubs. The line +jaxws:enableAsyncMapping has to be uncommented to use this. + +More info about the binding file can be found here: +https://jax-ws.dev.java.net/jax-ws-20-fcs/docs/customizations.html + +Server implementation +--------------------- + +The service is implemented in the class CustomerServiceImpl. The class simply implements the previously +generated service interface. The method getCustomersByName demonstrates how a query function could look like. +The idea is to search and return all customers with the given name. If the searched name is none then the method +returns an exception to indicate that no matching customer was found. (In a real implementation probably a list with +zero objects would be used. This is mainly to show how custom exceptions can be used). +For any other name the method will return a list of two Customer objects. The number of objects can be increased to +test how fast CXF works for larger data. + +Now that the service is implemented it needs to be made available. In this example a standalone server is used. +This can be done either with the JAX-WS API demonstrated in the class CustomerService or using a spring config as +demonstrated in the class CustomerServiceSpringServer. + +Client implementation +--------------------- + +The main client code lives in the class CustomerServiceTester. This class needs a proxy to the service and then +demonstrates some calls and their expected outcome using junit assertions. + +The first call is a request getCustomersByName for all customers with name "Smith". The result is then checked. +Then the same method is called with the invalid name "None". In this case a NoSuchCustomerException is expected. +The third call shows that the one way method updateCustomer will return instantly even if the service needs some +time to process the request. + +The classes CustomerServiceClient and CustomerServiceSpringClient show how to get a service proxy using JAX-WS +or Spring and how to wire it to your business class (in this case CustomerServiceTester). Prerequisite ------------ -If your environment already includes cxf-manifest.jar on the -CLASSPATH, and the JDK and ant bin directories on the PATH -it is not necessary to set the environment as described in -the samples directory README. If your environment is not -properly configured, or if you are planning on using wsdl2java, -javac, and java to build and run the demos, you must set the -environment. - +Please review the README in the samples main directory before continuing. Building and running the demo using Ant --------------------------------------- @@ -77,116 +101,17 @@ To remove the code generated from the WSDL file and the .class files, run "mvn clean". +There is no special maven profile for the spring client and server but you can easily set it up yourself. +Using eclipse to run and test the demo +-------------------------------------- -Building the demo using wsdl2java and javac -------------------------------------------- - -From the base directory of this sample (i.e., where this README file is -located) first create the target directory build/classes and then -generate code from the WSDL file. - -For UNIX: - mkdir -p build/classes - - wsdl2java -d build/classes -compile ./wsdl/hello_world.wsdl - -For Windows: - mkdir build\classes - Must use back slashes. - - wsdl2java -d build\classes -compile .\wsdl\hello_world.wsdl - May use either forward or back slashes. - -Now compile the provided client and server applications with the commands: - -For UNIX: - - export CLASSPATH=$CLASSPATH:$CXF_HOME/lib/cxf-manifest.jar:./build/classes - javac -d build/classes src/demo/hw/client/*.java - javac -d build/classes src/demo/hw/server/*.java - -For Windows: - set classpath=%classpath%;%CXF_HOME%\lib\cxf-manifest.jar;.\build\classes - javac -d build\classes src\demo\hw\client\*.java - javac -d build\classes src\demo\hw\server\*.java - - -Running the demo using java ---------------------------- - -From the base directory of this sample (i.e., where this README file is -located) run the commands, entered on a single command line: - -For UNIX (must use forward slashes): - java -Djava.util.logging.config.file=$CXF_HOME/etc/logging.properties - demo.hw.server.Server & - - java -Djava.util.logging.config.file=$CXF_HOME/etc/logging.properties - demo.hw.client.Client ./wsdl/hello_world.wsdl - -The server process starts in the background. After running the client, -use the kill command to terminate the server process. - -For Windows (may use either forward or back slashes): - start - java -Djava.util.logging.config.file=%CXF_HOME%\etc\logging.properties - demo.hw.server.Server - - java -Djava.util.logging.config.file=%CXF_HOME%\etc\logging.properties - demo.hw.client.Client .\wsdl\hello_world.wsdl - -A new command windows opens for the server process. After running the -client, terminate the server process by issuing Ctrl-C in its command window. - -To remove the code generated from the WSDL file and the .class -files, either delete the build directory and its contents or run: - - ant clean - - -Building and running the demo in a servlet container ----------------------------------------------------- - -Please refer to samples directory README for building demo in a servlet container. - -Using ant, run the client application with the command: - - ant client-servlet -Dbase.url=http://localhost:# - -Where # is the TCP/IP port used by the servlet container, -e.g., 8080. - -Or - ant client-servlet -Dhost=localhost -Dport=8080 - -You can ignore the -Dhost and -Dport if your tomcat setup is same, i.e ant client-servlet - -Using java, run the client application with the command: - - For UNIX: - - java -Djava.util.logging.config.file=$CXF_HOME/etc/logging.properties - demo.hw.client.Client http://localhost:#/helloworld/services/hello_world?wsdl - - For Windows: - - java -Djava.util.logging.config.file=%CXF_HOME%\etc\logging.properties - demo.hw.client.Client http://localhost:#/helloworld/services/hello_world?wsdl - -Where # is the TCP/IP port used by the servlet container, -e.g., 8080. - - -Running demo with HTTP GET --------------------------- -APACHE CXF support HTTP GET to invoke the service, instead of running - - ant client +run the following in the demo base directory -you can use +mvn eclipse:eclipse - ant client.get +Then use Import / Existing projects into workspace and browse to the wsdl_first directory. Import the wsdl_first project. -to invoke the service with simple HttpURLConnection, or you can even -use your favorite browser to get the results back. +The demo can now be started using "Run as Java Application" on the CustomerServiceServer.java +and the CustomerServiceClient. For the spring demo run the classes CustomerServiceSpringClient.java +or CustomerServiceSpringServer.java Modified: cxf/branches/2.2.x-fixes/distribution/src/main/release/samples/wsdl_first/build.xml URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/distribution/src/main/release/samples/wsdl_first/build.xml?rev=821172&r1=821171&r2=821172&view=diff ============================================================================== --- cxf/branches/2.2.x-fixes/distribution/src/main/release/samples/wsdl_first/build.xml (original) +++ cxf/branches/2.2.x-fixes/distribution/src/main/release/samples/wsdl_first/build.xml Fri Oct 2 21:20:05 2009 @@ -23,38 +23,25 @@ - + - + - + - + - - - - - - - + @@ -64,6 +51,6 @@ - + Modified: cxf/branches/2.2.x-fixes/distribution/src/main/release/samples/wsdl_first/pom.xml URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/distribution/src/main/release/samples/wsdl_first/pom.xml?rev=821172&r1=821171&r2=821172&view=diff ============================================================================== --- cxf/branches/2.2.x-fixes/distribution/src/main/release/samples/wsdl_first/pom.xml (original) +++ cxf/branches/2.2.x-fixes/distribution/src/main/release/samples/wsdl_first/pom.xml Fri Oct 2 21:20:05 2009 @@ -26,7 +26,14 @@ [2,) - src + + + wsdl + + + src/main/resources + + maven-compiler-plugin @@ -46,7 +53,10 @@ - ${basedir}/wsdl/hello_world.wsdl + ${basedir}/wsdl/CustomerService.wsdl + + ${basedir}/wsdl/binding.xml + @@ -57,7 +67,7 @@ - + server @@ -74,7 +84,7 @@ java - demo.hw.server.Server + com.example.customerservice.server.CustomerServiceServer @@ -97,7 +107,7 @@ java - demo.hw.client.Client + com.example.customerservice.client.CustomerServiceClient ${basedir}/wsdl/hello_world.wsdl @@ -119,7 +129,7 @@ true - + java.net http://download.java.net/maven/1/ @@ -167,5 +177,10 @@ cxf-rt-transports-http-jetty ${cxf.version} + + junit + junit + 4.7 + Copied: cxf/branches/2.2.x-fixes/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/client/CustomerServiceTester.java (from r816407, cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/client/CustomerServiceTester.java) URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/client/CustomerServiceTester.java?p2=cxf/branches/2.2.x-fixes/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/client/CustomerServiceTester.java&p1=cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/client/CustomerServiceTester.java&r1=816407&r2=821172&rev=821172&view=diff ============================================================================== --- cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/client/CustomerServiceTester.java (original) +++ cxf/branches/2.2.x-fixes/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/client/CustomerServiceTester.java Fri Oct 2 21:20:05 2009 @@ -61,6 +61,14 @@ Assert.assertEquals("None", e.getFaultInfo().getCustomerName()); System.out.println("NoSuchCustomer exception was received as expected"); } + + // The implementation of updateCustomer is set to sleep for some seconds. + // Still this method should return instantly as the method is declared + // as a one way method in the WSDL + Customer customer = new Customer(); + customer.setName("Smith"); + customerService.updateCustomer(customer); + System.out.println("All calls were succesful"); } Copied: cxf/branches/2.2.x-fixes/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/server/CustomerServiceImpl.java (from r816407, cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/server/CustomerServiceImpl.java) URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/server/CustomerServiceImpl.java?p2=cxf/branches/2.2.x-fixes/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/server/CustomerServiceImpl.java&p1=cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/server/CustomerServiceImpl.java&r1=816407&r2=821172&rev=821172&view=diff ============================================================================== --- cxf/trunk/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/server/CustomerServiceImpl.java (original) +++ cxf/branches/2.2.x-fixes/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/server/CustomerServiceImpl.java Fri Oct 2 21:20:05 2009 @@ -34,6 +34,11 @@ import com.example.customerservice.NoSuchCustomerException; public class CustomerServiceImpl implements CustomerService { + + /** + * The WebServiceContext can be used to retrieve special attributes like the + * user principal. Normally it is not needed + */ @Resource WebServiceContext wsContext; @@ -63,8 +68,13 @@ } public void updateCustomer(Customer customer) { - // TODO Auto-generated method stub - + System.out.println("update request was received"); + try { + Thread.sleep(10000); + } catch (InterruptedException e) { + // Nothing to do here + } + System.out.println("Customer was updated"); } }