cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject [cxf] 01/02: Updating some of the wsdl_first demos
Date Fri, 13 Apr 2018 10:18:08 GMT
This is an automated email from the ASF dual-hosted git repository.

coheigea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit 29fcf793aa6f0182d66930aaf9f5d1ebdccd3241
Author: Colm O hEigeartaigh <coheigea@apache.org>
AuthorDate: Fri Apr 13 10:04:51 2018 +0100

    Updating some of the wsdl_first demos
---
 .../src/main/release/samples/wsdl_first/README.txt |  8 +++---
 .../src/main/release/samples/wsdl_first/pom.xml    |  2 +-
 .../client/CustomerServiceSpringClient.java        |  1 +
 .../client/CustomerServiceTester.java              |  2 +-
 .../server/CustomerServiceServer.java              | 13 +++------
 .../main/resources/client-applicationContext.xml   | 31 ++++++++++++----------
 .../main/resources/server-applicationContext.xml   | 29 +++++++++++---------
 .../src/main/resources/InsecureClient.xml          |  2 +-
 .../src/main/resources/ServerConfig.xml            |  2 +-
 9 files changed, 47 insertions(+), 43 deletions(-)

diff --git a/distribution/src/main/release/samples/wsdl_first/README.txt b/distribution/src/main/release/samples/wsdl_first/README.txt
index 4f2ff95..d3fdb92 100644
--- a/distribution/src/main/release/samples/wsdl_first/README.txt
+++ b/distribution/src/main/release/samples/wsdl_first/README.txt
@@ -29,7 +29,8 @@ 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:
-http://jax-ws.java.net/jax-ws-20-fcs/docs/customizations.html
+
+https://docs.oracle.com/cd/E17802_01/webservices/webservices/docs/2.0/jaxws/customizations.html
 
 Server implementation
 ---------------------
@@ -82,8 +83,9 @@ Using either UNIX or Windows:
   mvn -Pserver  (from one command line window -- only if using embedded Jetty)
   mvn -Pclient  (from a second command line window)
 
-There is no special Maven profile for the Spring client and server but you can
-easily set it up yourself.
+Alteratively there is a profile available for the server when configured via spring:
+
+  mvn -server-spring
 
 If you want to run the client and server with netty transport, you can use below command
to  
 start up the server and client:
diff --git a/distribution/src/main/release/samples/wsdl_first/pom.xml b/distribution/src/main/release/samples/wsdl_first/pom.xml
index b507041..de092e1 100644
--- a/distribution/src/main/release/samples/wsdl_first/pom.xml
+++ b/distribution/src/main/release/samples/wsdl_first/pom.xml
@@ -30,7 +30,7 @@
     </parent>
     <properties>
         <cxf.version>${project.version}</cxf.version>
-        <cxf.xjc-utils.version>2.6.0</cxf.xjc-utils.version>
+        <cxf.xjc-utils.version>3.2.1</cxf.xjc-utils.version>
         <cxf.release.base>${basedir}/../..</cxf.release.base>
     </properties>
     <build>
diff --git a/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/client/CustomerServiceSpringClient.java
b/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/client/CustomerServiceSpringClient.java
index 8ce3bf6..8b13599 100644
--- a/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/client/CustomerServiceSpringClient.java
+++ b/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/client/CustomerServiceSpringClient.java
@@ -34,6 +34,7 @@ public final class CustomerServiceSpringClient {
         CustomerServiceTester client = (CustomerServiceTester)context.getBean("tester");
 
         client.testCustomerService();
+        context.close();
         System.exit(0);
     }
 }
diff --git a/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/client/CustomerServiceTester.java
b/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/client/CustomerServiceTester.java
index a0c6d30..0271e9e 100644
--- a/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/client/CustomerServiceTester.java
+++ b/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/client/CustomerServiceTester.java
@@ -21,7 +21,7 @@ package com.example.customerservice.client;
 
 import java.util.List;
 
-import junit.framework.Assert;
+import org.junit.Assert;
 
 import com.example.customerservice.Customer;
 import com.example.customerservice.CustomerService;
diff --git a/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/server/CustomerServiceServer.java
b/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/server/CustomerServiceServer.java
index 9ee1444..e0ded7f 100644
--- a/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/server/CustomerServiceServer.java
+++ b/distribution/src/main/release/samples/wsdl_first/src/main/java/com/example/customerservice/server/CustomerServiceServer.java
@@ -23,21 +23,16 @@ import javax.xml.ws.Endpoint;
 
 import com.example.customerservice.CustomerService;
 
-import org.apache.cxf.interceptor.LoggingInInterceptor;
-import org.apache.cxf.interceptor.LoggingOutInterceptor;
-import org.apache.cxf.jaxws.EndpointImpl;
+import org.apache.cxf.ext.logging.LoggingFeature;
 
 public class CustomerServiceServer {
 
     protected CustomerServiceServer() throws Exception {
         System.out.println("Starting Server");
         CustomerService implementor = new CustomerServiceImpl();
-        EndpointImpl ep = (EndpointImpl)Endpoint.publish("http://localhost:9090/CustomerServicePort",
-                                                         implementor);
-
-        // Adding logging for incoming and outgoing messages
-        ep.getServer().getEndpoint().getInInterceptors().add(new LoggingInInterceptor());
-        ep.getServer().getEndpoint().getOutInterceptors().add(new LoggingOutInterceptor());
+        Endpoint.publish("http://localhost:9090/CustomerServicePort",
+                                                         implementor,
+                                                         new LoggingFeature());
     }
 
     public static void main(String args[]) throws Exception {
diff --git a/distribution/src/main/release/samples/wsdl_first/src/main/resources/client-applicationContext.xml
b/distribution/src/main/release/samples/wsdl_first/src/main/resources/client-applicationContext.xml
index dcaf400..b078d1c 100644
--- a/distribution/src/main/release/samples/wsdl_first/src/main/resources/client-applicationContext.xml
+++ b/distribution/src/main/release/samples/wsdl_first/src/main/resources/client-applicationContext.xml
@@ -1,19 +1,22 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
-                Licensed to the Apache Software Foundation (ASF) under one or more
-                contributor license agreements. See the NOTICE file distributed with
-                this work for additional information regarding copyright ownership.
-                The ASF licenses this file to You 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
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you 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.
-        -->
+  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.
+-->
 <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context" xmlns:jaxws="http://cxf.apache.org/jaxws"
xmlns:customer="http://customerservice.example.com/" xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.2.xsd                 http://www.springframework.org/schema/context
http://www.springframework.org/ [...]
     <!--
                 Define a cxf endpoint based on client stub generated from a wsdl. It
@@ -24,7 +27,7 @@
                 the names
         -->
     <jaxws:client id="customerService" serviceName="customer:CustomerServiceService" endpointName="customer:CustomerServiceEndpoint"
address="http://localhost:9090/CustomerServicePort" serviceClass="com.example.customerservice.CustomerService">
-        </jaxws:client>
+    </jaxws:client>
     <bean id="tester" class="com.example.customerservice.client.CustomerServiceTester">
         <property name="customerService" ref="customerService"/>
     </bean>
diff --git a/distribution/src/main/release/samples/wsdl_first/src/main/resources/server-applicationContext.xml
b/distribution/src/main/release/samples/wsdl_first/src/main/resources/server-applicationContext.xml
index 71e2296..8ae842f 100644
--- a/distribution/src/main/release/samples/wsdl_first/src/main/resources/server-applicationContext.xml
+++ b/distribution/src/main/release/samples/wsdl_first/src/main/resources/server-applicationContext.xml
@@ -1,19 +1,22 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
-                Licensed to the Apache Software Foundation (ASF) under one or more
-                contributor license agreements. See the NOTICE file distributed with
-                this work for additional information regarding copyright ownership.
-                The ASF licenses this file to You 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
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you 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.
-        -->
+  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.
+-->
 <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jaxws="http://cxf.apache.org/jaxws"
     xmlns:cxf="http://cxf.apache.org/core"
     xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.2.xsd
                http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.2.xsd
                http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd        
        http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd ">
diff --git a/distribution/src/main/release/samples/wsdl_first_https/src/main/resources/InsecureClient.xml
b/distribution/src/main/release/samples/wsdl_first_https/src/main/resources/InsecureClient.xml
index f2bd2df..f1957a3 100644
--- a/distribution/src/main/release/samples/wsdl_first_https/src/main/resources/InsecureClient.xml
+++ b/distribution/src/main/release/samples/wsdl_first_https/src/main/resources/InsecureClient.xml
@@ -19,5 +19,5 @@
 -->
 <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:http="http://cxf.apache.org/transports/http/configuration" xsi:schemaLocation=" http://cxf.apache.org/transports/http/configuration
http://cxf.apache.org/schemas/configuration/http-conf.xsd http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.2.xsd">
     <http:conduit name="{http://apache.org/hello_world_soap_http}SoapPort.http-conduit">
-  </http:conduit>
+    </http:conduit>
 </beans>
diff --git a/distribution/src/main/release/samples/wsdl_first_https/src/main/resources/ServerConfig.xml
b/distribution/src/main/release/samples/wsdl_first_https/src/main/resources/ServerConfig.xml
index 5ad8144..bbc7df8 100644
--- a/distribution/src/main/release/samples/wsdl_first_https/src/main/resources/ServerConfig.xml
+++ b/distribution/src/main/release/samples/wsdl_first_https/src/main/resources/ServerConfig.xml
@@ -22,7 +22,7 @@
 -->
 <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:sec="http://cxf.apache.org/configuration/security" xmlns:http="http://cxf.apache.org/transports/http/configuration"
xmlns:httpj="http://cxf.apache.org/transports/http-jetty/configuration" xsi:schemaLocation="
            http://cxf.apache.org/configuration/security                       http://cxf.apache.org/schemas/configuration/security.xsd
            http://cxf.apach [...]
     <http:destination name="{http://apache.org/hello_world_soap_http}GreeterPort.http-destination">

-  </http:destination>
+    </http:destination>
     <httpj:engine-factory>
         <httpj:engine port="9001">
             <httpj:tlsServerParameters>

-- 
To stop receiving notification emails like this one, please contact
coheigea@apache.org.

Mime
View raw message