You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by gm...@apache.org on 2012/08/10 19:30:49 UTC
svn commit: r1371779 - in
/cxf/branches/2.6.x-fixes/distribution/src/main/release/samples/wsdl_first_https/src/main:
./ config/ java/ java/demo/ java/demo/hw_https/ java/demo/hw_https/client/
java/demo/hw_https/server/ resources/
Author: gmazza
Date: Fri Aug 10 17:30:49 2012
New Revision: 1371779
URL: http://svn.apache.org/viewvc?rev=1371779&view=rev
Log:
Restored main folder containing wsdl_first_https sample
Added:
cxf/branches/2.6.x-fixes/distribution/src/main/release/samples/wsdl_first_https/src/main/
cxf/branches/2.6.x-fixes/distribution/src/main/release/samples/wsdl_first_https/src/main/config/
cxf/branches/2.6.x-fixes/distribution/src/main/release/samples/wsdl_first_https/src/main/config/KeyREADME.txt
cxf/branches/2.6.x-fixes/distribution/src/main/release/samples/wsdl_first_https/src/main/config/clientKeystore.jks (with props)
cxf/branches/2.6.x-fixes/distribution/src/main/release/samples/wsdl_first_https/src/main/config/hello_world.wsdl
cxf/branches/2.6.x-fixes/distribution/src/main/release/samples/wsdl_first_https/src/main/config/serviceKeystore.jks (with props)
cxf/branches/2.6.x-fixes/distribution/src/main/release/samples/wsdl_first_https/src/main/java/
cxf/branches/2.6.x-fixes/distribution/src/main/release/samples/wsdl_first_https/src/main/java/demo/
cxf/branches/2.6.x-fixes/distribution/src/main/release/samples/wsdl_first_https/src/main/java/demo/hw_https/
cxf/branches/2.6.x-fixes/distribution/src/main/release/samples/wsdl_first_https/src/main/java/demo/hw_https/client/
cxf/branches/2.6.x-fixes/distribution/src/main/release/samples/wsdl_first_https/src/main/java/demo/hw_https/client/Client.java
cxf/branches/2.6.x-fixes/distribution/src/main/release/samples/wsdl_first_https/src/main/java/demo/hw_https/client/ClientNonSpring.java
cxf/branches/2.6.x-fixes/distribution/src/main/release/samples/wsdl_first_https/src/main/java/demo/hw_https/server/
cxf/branches/2.6.x-fixes/distribution/src/main/release/samples/wsdl_first_https/src/main/java/demo/hw_https/server/GreeterImpl.java
cxf/branches/2.6.x-fixes/distribution/src/main/release/samples/wsdl_first_https/src/main/java/demo/hw_https/server/Server.java
cxf/branches/2.6.x-fixes/distribution/src/main/release/samples/wsdl_first_https/src/main/resources/
cxf/branches/2.6.x-fixes/distribution/src/main/release/samples/wsdl_first_https/src/main/resources/InsecureClient.xml
cxf/branches/2.6.x-fixes/distribution/src/main/release/samples/wsdl_first_https/src/main/resources/SecureClient.xml
cxf/branches/2.6.x-fixes/distribution/src/main/release/samples/wsdl_first_https/src/main/resources/ServerConfig.xml
Added: cxf/branches/2.6.x-fixes/distribution/src/main/release/samples/wsdl_first_https/src/main/config/KeyREADME.txt
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/distribution/src/main/release/samples/wsdl_first_https/src/main/config/KeyREADME.txt?rev=1371779&view=auto
==============================================================================
--- cxf/branches/2.6.x-fixes/distribution/src/main/release/samples/wsdl_first_https/src/main/config/KeyREADME.txt (added)
+++ cxf/branches/2.6.x-fixes/distribution/src/main/release/samples/wsdl_first_https/src/main/config/KeyREADME.txt Fri Aug 10 17:30:49 2012
@@ -0,0 +1,20 @@
+# The below scripts show the commands used to generate the self-signed keys for this sample.
+# If you use the below script to create your own keys be sure to change the passwords used here
+# DO NOT USE THE SUPPLIED KEYS IN PRODUCTION--everyone has them!!
+# For production recommended to use keys signed by a third-party certificate authority (CA)
+
+# Create the combination keystore/truststore for the client and service.
+# Note you can create separate keystores/truststores for both if desired
+keytool -genkeypair -validity 730 -alias myservicekey -keystore serviceKeystore.jks -dname "cn=localhost" -keypass skpass -storepass sspass
+keytool -genkeypair -validity 730 -alias myclientkey -keystore clientKeystore.jks -keypass ckpass -storepass cspass
+
+# Place server public cert in client key/truststore
+keytool -export -rfc -keystore serviceKeystore.jks -alias myservicekey -file MyService.cer -storepass sspass
+keytool -import -noprompt -trustcacerts -file MyService.cer -alias myservicekey -keystore clientKeystore.jks -storepass cspass
+
+# Place client public cert in service key/truststore
+# Note this needs to be done only if you're requiring client authentication
+# as configured in resources/ServerConfig.xml
+keytool -export -rfc -keystore clientKeystore.jks -alias myclientkey -file MyClient.cer -storepass cspass
+keytool -import -noprompt -trustcacerts -file MyClient.cer -alias myclientkey -keystore serviceKeystore.jks -storepass sspass
+
Added: cxf/branches/2.6.x-fixes/distribution/src/main/release/samples/wsdl_first_https/src/main/config/clientKeystore.jks
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/distribution/src/main/release/samples/wsdl_first_https/src/main/config/clientKeystore.jks?rev=1371779&view=auto
==============================================================================
Binary file - no diff available.
Propchange: cxf/branches/2.6.x-fixes/distribution/src/main/release/samples/wsdl_first_https/src/main/config/clientKeystore.jks
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: cxf/branches/2.6.x-fixes/distribution/src/main/release/samples/wsdl_first_https/src/main/config/hello_world.wsdl
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/distribution/src/main/release/samples/wsdl_first_https/src/main/config/hello_world.wsdl?rev=1371779&view=auto
==============================================================================
--- cxf/branches/2.6.x-fixes/distribution/src/main/release/samples/wsdl_first_https/src/main/config/hello_world.wsdl (added)
+++ cxf/branches/2.6.x-fixes/distribution/src/main/release/samples/wsdl_first_https/src/main/config/hello_world.wsdl Fri Aug 10 17:30:49 2012
@@ -0,0 +1,91 @@
+<?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
+
+ 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.
+-->
+<wsdl:definitions name="HelloWorld" targetNamespace="http://apache.org/hello_world_soap_http"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:tns="http://apache.org/hello_world_soap_http"
+ xmlns:x1="http://apache.org/hello_world_soap_http/types"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+ <wsdl:types>
+ <schema targetNamespace="http://apache.org/hello_world_soap_http/types"
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:tns="http://apache.org/hello_world_soap_http/types"
+ elementFormDefault="qualified">
+
+ <simpleType name="MyStringType">
+ <restriction base="string">
+ <maxLength value="30" />
+ </restriction>
+ </simpleType>
+
+ <element name="greetMe">
+ <complexType>
+ <sequence>
+ <element name="requestType" type="tns:MyStringType"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="greetMeResponse">
+ <complexType>
+ <sequence>
+ <element name="responseType" type="string"/>
+ </sequence>
+ </complexType>
+ </element>
+ </schema>
+ </wsdl:types>
+ <wsdl:message name="greetMeRequest">
+ <wsdl:part element="x1:greetMe" name="in"/>
+ </wsdl:message>
+ <wsdl:message name="greetMeResponse">
+ <wsdl:part element="x1:greetMeResponse" name="out"/>
+ </wsdl:message>
+
+ <wsdl:portType name="Greeter">
+
+ <wsdl:operation name="greetMe">
+ <wsdl:input message="tns:greetMeRequest" name="greetMeRequest"/>
+ <wsdl:output message="tns:greetMeResponse" name="greetMeResponse"/>
+ </wsdl:operation>
+
+ </wsdl:portType>
+ <wsdl:binding name="Greeter_SOAPBinding" type="tns:Greeter">
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+
+ <wsdl:operation name="greetMe">
+ <soap:operation soapAction="" style="document"/>
+ <wsdl:input name="greetMeRequest">
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output name="greetMeResponse">
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+
+
+ </wsdl:binding>
+ <wsdl:service name="SOAPService">
+ <wsdl:port binding="tns:Greeter_SOAPBinding" name="SoapPort">
+ <soap:address location="https://localhost:9001/SoapContext/SoapPort"/>
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
+
Added: cxf/branches/2.6.x-fixes/distribution/src/main/release/samples/wsdl_first_https/src/main/config/serviceKeystore.jks
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/distribution/src/main/release/samples/wsdl_first_https/src/main/config/serviceKeystore.jks?rev=1371779&view=auto
==============================================================================
Binary file - no diff available.
Propchange: cxf/branches/2.6.x-fixes/distribution/src/main/release/samples/wsdl_first_https/src/main/config/serviceKeystore.jks
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: cxf/branches/2.6.x-fixes/distribution/src/main/release/samples/wsdl_first_https/src/main/java/demo/hw_https/client/Client.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/distribution/src/main/release/samples/wsdl_first_https/src/main/java/demo/hw_https/client/Client.java?rev=1371779&view=auto
==============================================================================
--- cxf/branches/2.6.x-fixes/distribution/src/main/release/samples/wsdl_first_https/src/main/java/demo/hw_https/client/Client.java (added)
+++ cxf/branches/2.6.x-fixes/distribution/src/main/release/samples/wsdl_first_https/src/main/java/demo/hw_https/client/Client.java Fri Aug 10 17:30:49 2012
@@ -0,0 +1,89 @@
+/**
+ * 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.
+ */
+
+package demo.hw_https.client;
+
+import java.io.File;
+import java.net.URL;
+import javax.xml.namespace.QName;
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
+import org.apache.cxf.bus.spring.SpringBusFactory;
+import org.apache.hello_world_soap_http.Greeter;
+import org.apache.hello_world_soap_http.SOAPService;
+
+public final class Client {
+
+ private static final QName SERVICE_NAME
+ = new QName("http://apache.org/hello_world_soap_http", "SOAPService");
+
+ private static final QName PORT_NAME =
+ new QName("http://apache.org/hello_world_soap_http", "SoapPort");
+
+
+ private Client() {
+ }
+
+ public static void main(String args[]) throws Exception {
+
+ if (args.length == 0) {
+ System.out.println("please specify wsdl");
+ System.exit(1);
+ }
+
+ URL wsdlURL;
+ File wsdlFile = new File(args[0]);
+ if (wsdlFile.exists()) {
+ wsdlURL = wsdlFile.toURL();
+ } else {
+ wsdlURL = new URL(args[0]);
+ }
+
+ SpringBusFactory bf = new SpringBusFactory();
+ URL busFile = null;
+ if ("secure".equals(args[1])) {
+ busFile = Client.class.getResource("/SecureClient.xml");
+ } else if ("insecure".equals(args[1])) {
+ busFile = Client.class.getResource("/InsecureClient.xml");
+ } else {
+ System.out.println("arg1 needs to be either secure or insecure");
+ System.exit(1);
+ }
+ Bus bus = bf.createBus(busFile.toString());
+ BusFactory.setDefaultBus(bus);
+
+ System.out.println(wsdlURL);
+ SOAPService ss = new SOAPService(wsdlURL, SERVICE_NAME);
+ Greeter port = ss.getPort(PORT_NAME, Greeter.class);
+
+ System.out.println("Invoking greetMe...");
+ try {
+ String resp = port.greetMe(System.getProperty("user.name"));
+ System.out.println("Server responded with: " + resp);
+ System.out.println();
+
+ } catch (Exception e) {
+ System.out.println("Invocation failed with the following: " + e.getCause());
+ System.out.println();
+ }
+
+ System.exit(0);
+ }
+
+}
Added: cxf/branches/2.6.x-fixes/distribution/src/main/release/samples/wsdl_first_https/src/main/java/demo/hw_https/client/ClientNonSpring.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/distribution/src/main/release/samples/wsdl_first_https/src/main/java/demo/hw_https/client/ClientNonSpring.java?rev=1371779&view=auto
==============================================================================
--- cxf/branches/2.6.x-fixes/distribution/src/main/release/samples/wsdl_first_https/src/main/java/demo/hw_https/client/ClientNonSpring.java (added)
+++ cxf/branches/2.6.x-fixes/distribution/src/main/release/samples/wsdl_first_https/src/main/java/demo/hw_https/client/ClientNonSpring.java Fri Aug 10 17:30:49 2012
@@ -0,0 +1,137 @@
+/**
+ * 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.
+ */
+
+package demo.hw_https.client;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.net.URL;
+import java.security.GeneralSecurityException;
+import java.security.KeyStore;
+import java.security.KeyStoreException;
+import java.security.NoSuchAlgorithmException;
+
+import javax.net.ssl.KeyManager;
+import javax.net.ssl.KeyManagerFactory;
+import javax.net.ssl.TrustManager;
+import javax.net.ssl.TrustManagerFactory;
+import javax.xml.namespace.QName;
+
+import org.apache.cxf.configuration.jsse.TLSClientParameters;
+import org.apache.cxf.frontend.ClientProxy;
+import org.apache.cxf.transport.http.HTTPConduit;
+import org.apache.hello_world_soap_http.Greeter;
+import org.apache.hello_world_soap_http.SOAPService;
+
+public final class ClientNonSpring {
+
+ private static final QName SERVICE_NAME
+ = new QName("http://apache.org/hello_world_soap_http", "SOAPService");
+
+ private static final QName PORT_NAME =
+ new QName("http://apache.org/hello_world_soap_http", "SoapPort");
+
+
+ private ClientNonSpring() {
+ }
+
+ public static void main(String args[]) throws Exception {
+
+ if (args.length == 0) {
+ System.out.println("please specify wsdl");
+ System.exit(1);
+ }
+
+ URL wsdlURL;
+ File wsdlFile = new File(args[0]);
+ if (wsdlFile.exists()) {
+ wsdlURL = wsdlFile.toURL();
+ } else {
+ wsdlURL = new URL(args[0]);
+ }
+
+ System.out.println(wsdlURL);
+ SOAPService ss = new SOAPService(wsdlURL, SERVICE_NAME);
+ Greeter port = ss.getPort(PORT_NAME, Greeter.class);
+ if ("secure".equals(args[1])) {
+ setupTLS(port);
+ } else if ("insecure".equals(args[1])) {
+ //do nothing
+ } else {
+ System.out.println("arg1 needs to be either secure or insecure");
+ System.exit(1);
+ }
+
+ System.out.println("Invoking greetMe...");
+ try {
+ String resp = port.greetMe(System.getProperty("user.name"));
+ System.out.println("Server responded with: " + resp);
+ System.out.println();
+
+ } catch (Exception e) {
+ System.out.println("Invocation failed with the following: " + e.getCause());
+ System.out.println();
+ }
+
+ System.exit(0);
+ }
+
+ private static void setupTLS(Greeter port)
+ throws FileNotFoundException, IOException, GeneralSecurityException {
+ String keyStoreLoc = "src/main/config/clientKeystore.jks";
+ HTTPConduit httpConduit = (HTTPConduit) ClientProxy.getClient(port).getConduit();
+
+ TLSClientParameters tlsCP = new TLSClientParameters();
+ String keyPassword = "ckpass";
+ KeyStore keyStore = KeyStore.getInstance("JKS");
+ keyStore.load(new FileInputStream(keyStoreLoc), "cspass".toCharArray());
+ KeyManager[] myKeyManagers = getKeyManagers(keyStore, keyPassword);
+ tlsCP.setKeyManagers(myKeyManagers);
+
+
+ KeyStore trustStore = KeyStore.getInstance("JKS");
+ trustStore.load(new FileInputStream(keyStoreLoc), "cspass".toCharArray());
+ TrustManager[] myTrustStoreKeyManagers = getTrustManagers(trustStore);
+ tlsCP.setTrustManagers(myTrustStoreKeyManagers);
+
+ httpConduit.setTlsClientParameters(tlsCP);
+ }
+
+ private static TrustManager[] getTrustManagers(KeyStore trustStore)
+ throws NoSuchAlgorithmException, KeyStoreException {
+ String alg = KeyManagerFactory.getDefaultAlgorithm();
+ TrustManagerFactory fac = TrustManagerFactory.getInstance(alg);
+ fac.init(trustStore);
+ return fac.getTrustManagers();
+ }
+
+ private static KeyManager[] getKeyManagers(KeyStore keyStore, String keyPassword)
+ throws GeneralSecurityException, IOException {
+ String alg = KeyManagerFactory.getDefaultAlgorithm();
+ char[] keyPass = keyPassword != null
+ ? keyPassword.toCharArray()
+ : null;
+ KeyManagerFactory fac = KeyManagerFactory.getInstance(alg);
+ fac.init(keyStore, keyPass);
+ return fac.getKeyManagers();
+ }
+
+}
Added: cxf/branches/2.6.x-fixes/distribution/src/main/release/samples/wsdl_first_https/src/main/java/demo/hw_https/server/GreeterImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/distribution/src/main/release/samples/wsdl_first_https/src/main/java/demo/hw_https/server/GreeterImpl.java?rev=1371779&view=auto
==============================================================================
--- cxf/branches/2.6.x-fixes/distribution/src/main/release/samples/wsdl_first_https/src/main/java/demo/hw_https/server/GreeterImpl.java (added)
+++ cxf/branches/2.6.x-fixes/distribution/src/main/release/samples/wsdl_first_https/src/main/java/demo/hw_https/server/GreeterImpl.java Fri Aug 10 17:30:49 2012
@@ -0,0 +1,43 @@
+/**
+ * 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.
+ */
+
+package demo.hw_https.server;
+
+import java.util.logging.Logger;
+import org.apache.hello_world_soap_http.Greeter;
+
+@javax.jws.WebService(name = "Greeter", serviceName = "SOAPService",
+ targetNamespace = "http://apache.org/hello_world_soap_http",
+ wsdlLocation = "file:./src/main/config/hello_world.wsdl")
+
+public class GreeterImpl implements Greeter {
+
+ private static final Logger LOG =
+ Logger.getLogger(GreeterImpl.class.getPackage().getName());
+
+ /* (non-Javadoc)
+ * @see org.objectweb.hello_world_soap_http.Greeter#greetMe(java.lang.String)
+ */
+ public String greetMe(String me) {
+ LOG.info("Executing operation greetMe");
+ System.out.println("Executing operation greetMe");
+ System.out.println("Message received: " + me + "\n");
+ return "Hello " + me;
+ }
+}
Added: cxf/branches/2.6.x-fixes/distribution/src/main/release/samples/wsdl_first_https/src/main/java/demo/hw_https/server/Server.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/distribution/src/main/release/samples/wsdl_first_https/src/main/java/demo/hw_https/server/Server.java?rev=1371779&view=auto
==============================================================================
--- cxf/branches/2.6.x-fixes/distribution/src/main/release/samples/wsdl_first_https/src/main/java/demo/hw_https/server/Server.java (added)
+++ cxf/branches/2.6.x-fixes/distribution/src/main/release/samples/wsdl_first_https/src/main/java/demo/hw_https/server/Server.java Fri Aug 10 17:30:49 2012
@@ -0,0 +1,58 @@
+/**
+ * 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.
+ */
+
+package demo.hw_https.server;
+
+import java.net.URL;
+import javax.xml.ws.Endpoint;
+
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
+import org.apache.cxf.bus.spring.SpringBusFactory;
+
+public class Server {
+
+ protected Server() throws Exception {
+ System.out.println("Starting Server");
+
+ SpringBusFactory bf = new SpringBusFactory();
+ URL busFile = Server.class.getResource("/ServerConfig.xml");
+ Bus bus = bf.createBus(busFile.toString());
+ BusFactory.setDefaultBus(bus);
+
+ Object implementor = new GreeterImpl();
+ String address = "https://localhost:9001/SoapContext/SoapPort";
+ Endpoint.publish(address, implementor);
+ }
+
+ public static void main(String args[]) throws Exception {
+ System.out.println("The server's security configuration will be taken "
+ + "from server.xml using the bean name : "
+ + "\"{http://apache.org/hello_world_soap_http}"
+ + "GreeterImplPort.http-destination\".");
+ System.out.println();
+ new Server();
+ System.out.println("Server ready...");
+
+ Thread.sleep(5 * 60 * 1000);
+ System.out.println("Server exiting");
+ System.exit(0);
+ }
+}
Added: cxf/branches/2.6.x-fixes/distribution/src/main/release/samples/wsdl_first_https/src/main/resources/InsecureClient.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/distribution/src/main/release/samples/wsdl_first_https/src/main/resources/InsecureClient.xml?rev=1371779&view=auto
==============================================================================
--- cxf/branches/2.6.x-fixes/distribution/src/main/release/samples/wsdl_first_https/src/main/resources/InsecureClient.xml (added)
+++ cxf/branches/2.6.x-fixes/distribution/src/main/release/samples/wsdl_first_https/src/main/resources/InsecureClient.xml Fri Aug 10 17:30:49 2012
@@ -0,0 +1,30 @@
+<?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
+
+ 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: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.xsd">
+
+ <http:conduit name="{http://apache.org/hello_world_soap_http}SoapPort.http-conduit">
+ </http:conduit>
+
+</beans>
Added: cxf/branches/2.6.x-fixes/distribution/src/main/release/samples/wsdl_first_https/src/main/resources/SecureClient.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/distribution/src/main/release/samples/wsdl_first_https/src/main/resources/SecureClient.xml?rev=1371779&view=auto
==============================================================================
--- cxf/branches/2.6.x-fixes/distribution/src/main/release/samples/wsdl_first_https/src/main/resources/SecureClient.xml (added)
+++ cxf/branches/2.6.x-fixes/distribution/src/main/release/samples/wsdl_first_https/src/main/resources/SecureClient.xml Fri Aug 10 17:30:49 2012
@@ -0,0 +1,60 @@
+<?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
+
+ 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.
+-->
+
+<!--
+ ** This file configures the Wibble Client
+ -->
+
+<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"
+ xsi:schemaLocation="
+ http://cxf.apache.org/configuration/security
+ http://cxf.apache.org/schemas/configuration/security.xsd
+ 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.xsd">
+
+ <http:conduit name="{http://apache.org/hello_world_soap_http}SoapPort.http-conduit">
+ <http:tlsClientParameters>
+ <sec:keyManagers keyPassword="ckpass">
+ <sec:keyStore file="src/main/config/clientKeystore.jks" password="cspass" type="JKS"/>
+ </sec:keyManagers>
+ <sec:trustManagers>
+ <sec:keyStore file="src/main/config/clientKeystore.jks" password="cspass" type="JKS"/>
+ </sec:trustManagers>
+ <sec:cipherSuitesFilter>
+ <!-- these filters ensure that a ciphersuite with
+ export-suitable or null encryption is used,
+ but exclude anonymous Diffie-Hellman key change as
+ this is vulnerable to man-in-the-middle attacks -->
+ <sec:include>.*_EXPORT_.*</sec:include>
+ <sec:include>.*_EXPORT1024_.*</sec:include>
+ <sec:include>.*_WITH_DES_.*</sec:include>
+ <sec:include>.*_WITH_AES_.*</sec:include>
+ <sec:include>.*_WITH_NULL_.*</sec:include>
+ <sec:exclude>.*_DH_anon_.*</sec:exclude>
+ </sec:cipherSuitesFilter>
+ </http:tlsClientParameters>
+ </http:conduit>
+</beans>
+
Added: cxf/branches/2.6.x-fixes/distribution/src/main/release/samples/wsdl_first_https/src/main/resources/ServerConfig.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/distribution/src/main/release/samples/wsdl_first_https/src/main/resources/ServerConfig.xml?rev=1371779&view=auto
==============================================================================
--- cxf/branches/2.6.x-fixes/distribution/src/main/release/samples/wsdl_first_https/src/main/resources/ServerConfig.xml (added)
+++ cxf/branches/2.6.x-fixes/distribution/src/main/release/samples/wsdl_first_https/src/main/resources/ServerConfig.xml Fri Aug 10 17:30:49 2012
@@ -0,0 +1,68 @@
+<?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
+
+ 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.
+-->
+
+<!--
+ ** This file configures the Server which runs the web service.
+-->
+
+<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.apache.org/transports/http/configuration
+ http://cxf.apache.org/schemas/configuration/http-conf.xsd
+ http://cxf.apache.org/transports/http-jetty/configuration
+ http://cxf.apache.org/schemas/configuration/http-jetty.xsd
+ http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans.xsd">
+
+ <http:destination name="{http://apache.org/hello_world_soap_http}GreeterPort.http-destination">
+ </http:destination>
+
+ <httpj:engine-factory>
+ <httpj:engine port="9001">
+ <httpj:tlsServerParameters>
+ <sec:keyManagers keyPassword="skpass">
+ <sec:keyStore file="src/main/config/serviceKeystore.jks" password="sspass" type="JKS"/>
+ </sec:keyManagers>
+ <sec:trustManagers>
+ <sec:keyStore file="src/main/config/serviceKeystore.jks" password="sspass" type="JKS"/>
+ </sec:trustManagers>
+ <sec:cipherSuitesFilter>
+ <!-- these filters ensure that a ciphersuite with
+ export-suitable or null encryption is used,
+ but exclude anonymous Diffie-Hellman key change as
+ this is vulnerable to man-in-the-middle attacks -->
+ <sec:include>.*_EXPORT_.*</sec:include>
+ <sec:include>.*_EXPORT1024_.*</sec:include>
+ <sec:include>.*_WITH_DES_.*</sec:include>
+ <sec:include>.*_WITH_AES_.*</sec:include>
+ <sec:include>.*_WITH_NULL_.*</sec:include>
+ <sec:exclude>.*_DH_anon_.*</sec:exclude>
+ </sec:cipherSuitesFilter>
+ <sec:clientAuthentication want="true" required="true"/>
+ </httpj:tlsServerParameters>
+ </httpj:engine>
+ </httpj:engine-factory>
+</beans>