cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r745989 - in /cxf/sandbox/interopfest/wssc/src: main/java/interop/client/Client.java main/java/interop/server/ main/java/interop/server/PingServiceImpl.java main/java/interop/server/Server.java main/resources/etc/server.xml style/makelocal.xsl
Date Thu, 19 Feb 2009 20:41:34 GMT
Author: dkulp
Date: Thu Feb 19 20:41:34 2009
New Revision: 745989

URL: http://svn.apache.org/viewvc?rev=745989&view=rev
Log:
Add a server to start working on the server side portion

Added:
    cxf/sandbox/interopfest/wssc/src/main/java/interop/server/
    cxf/sandbox/interopfest/wssc/src/main/java/interop/server/PingServiceImpl.java   (with
props)
    cxf/sandbox/interopfest/wssc/src/main/java/interop/server/Server.java   (with props)
Modified:
    cxf/sandbox/interopfest/wssc/src/main/java/interop/client/Client.java
    cxf/sandbox/interopfest/wssc/src/main/resources/etc/server.xml
    cxf/sandbox/interopfest/wssc/src/style/makelocal.xsl

Modified: cxf/sandbox/interopfest/wssc/src/main/java/interop/client/Client.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/interopfest/wssc/src/main/java/interop/client/Client.java?rev=745989&r1=745988&r2=745989&view=diff
==============================================================================
--- cxf/sandbox/interopfest/wssc/src/main/java/interop/client/Client.java (original)
+++ cxf/sandbox/interopfest/wssc/src/main/java/interop/client/Client.java Thu Feb 19 20:41:34
2009
@@ -23,6 +23,7 @@
 
 package interop.client;
 
+import java.net.URL;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -91,15 +92,22 @@
                 //"_KD-SEES_IPingService",     //Kerberos token - not sure where the token
comes from or how this works
             };
         }
-        //argv = new String[] {argv[5]};
+        argv = new String[] {argv[1]};
         //argv = new String[] {"UXC_IPingService"};
         
         new SpringBusFactory().createBus("etc/client.xml");
         List<String> results = new ArrayList<String>(argv.length);
+        URL wsdlLocation = null;
         
         for (String portPrefix : argv) {
             try {
-                final PingService svc = new PingService();
+                PingService svc;
+                wsdlLocation = new URL("http://localhost:9001/" + portPrefix + "?wsdl");
+                if (wsdlLocation == null) {
+                    svc = new PingService();
+                } else {
+                    svc = new PingService(wsdlLocation);
+                }
                 final IPingService port = 
                     svc.getPort(
                         new QName(
@@ -109,11 +117,6 @@
                         IPingService.class
                     );
                
-                /*
-                ((BindingProvider)port).getRequestContext()
-                    .put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
-                         "http://131.107.153.205/Security_WsSecurity_Service_Indigo/WSSecureConversationSign.svc/SecureConversation_MutualCertificate10Sign");
-                         */
                 PingRequest params = new PingRequest();
                 Ping ping = new Ping();
                 ping.setOrigin("CXF");

Added: cxf/sandbox/interopfest/wssc/src/main/java/interop/server/PingServiceImpl.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/interopfest/wssc/src/main/java/interop/server/PingServiceImpl.java?rev=745989&view=auto
==============================================================================
--- cxf/sandbox/interopfest/wssc/src/main/java/interop/server/PingServiceImpl.java (added)
+++ cxf/sandbox/interopfest/wssc/src/main/java/interop/server/PingServiceImpl.java Thu Feb
19 20:41:34 2009
@@ -0,0 +1,75 @@
+/**
+ * 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 interop.server;
+
+
+import org.xmlsoap.ping.PingResponseBody;
+
+import interopbaseaddress.interop.IPingService;
+import interopbaseaddress.interop.PingRequest;
+import interopbaseaddress.interop.PingResponse;
+import interopbaseaddress.interop.EchoDataSet.Request;
+import interopbaseaddress.interop.EchoDataSetResponse.EchoDataSetResult;
+import interopbaseaddress.interop.EchoXmlResponse.EchoXmlResult;
+
+
+/**
+ * 
+ */
+public class PingServiceImpl implements IPingService {
+
+    public String echo(String request) {
+        return request;
+    }
+
+    public EchoDataSetResult echoDataSet(Request request) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public EchoXmlResult echoXml(interopbaseaddress.interop.EchoXml.Request request) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public String fault(String request) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public String header(String request) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public PingResponse ping(PingRequest parameters) {
+        PingResponse resp = new PingResponse();
+        PingResponseBody body = new PingResponseBody();
+        body.setOrigin("CXF");
+        body.setScenario(parameters.getPing().getScenario());
+        body.setText(parameters.getPing().getOrigin() + ": "
+                     + parameters.getPing().getText());
+        resp.setPingResponse(body);
+        return resp;
+    }
+
+
+
+}

Propchange: cxf/sandbox/interopfest/wssc/src/main/java/interop/server/PingServiceImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/sandbox/interopfest/wssc/src/main/java/interop/server/PingServiceImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: cxf/sandbox/interopfest/wssc/src/main/java/interop/server/Server.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/interopfest/wssc/src/main/java/interop/server/Server.java?rev=745989&view=auto
==============================================================================
--- cxf/sandbox/interopfest/wssc/src/main/java/interop/server/Server.java (added)
+++ cxf/sandbox/interopfest/wssc/src/main/java/interop/server/Server.java Thu Feb 19 20:41:34
2009
@@ -0,0 +1,102 @@
+/**
+ * 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 interop.server;
+
+import interop.client.KeystorePasswordCallback;
+
+import javax.xml.ws.Endpoint;
+
+import org.apache.cxf.bus.spring.SpringBusFactory;
+import org.apache.cxf.ws.security.SecurityConstants;
+
+public class Server {
+protected Server(String baseUrl) throws Exception {
+        
+        new SpringBusFactory().createBus("etc/server.xml");
+        doPublish(baseUrl + "/AC_IPingService", new AC_IPingService());
+        
+        
+        /*
+        "SecureConversation_UserNameOverTransport_IPingService",
+        "SecureConversation_MutualCertificate10SignEncrypt_IPingService",
+        "AC_IPingService",
+        "ADC_IPingService",
+        "ADC-ES_IPingService",  
+        "_A_IPingService",
+        "_AD_IPingService",
+        "_AD-ES_IPingService",
+        
+        //"XC_IPingService",
+        //"XDC_IPingService",
+        //"XDC_IPingService1",
+        //"XDC-ES_IPingService",
+        //"XDC-SEES_IPingService",
+        //"_X_IPingService",
+        //"_X10_IPingService",
+        //"_XD_IPingService",
+        //"_XD-SEES_IPingService",
+        //"_XD-ES_IPingService",
+        "UXC_IPingService",
+        "UXDC_IPingService",
+        "UXDC-SEES_IPingService",
+        "_UX_IPingService",
+        "_UXD_IPingService",
+        "_UXD-SEES_IPingService",
+        //"KC_IPingService",     //Kerberos token - not sure where the token comes from or
how this works
+        //"KDC_IPingService",     //Kerberos token - not sure where the token comes from
or how this works
+        //"KC10_IPingService",     //Kerberos token - not sure where the token comes from
or how this works
+        //"KDC10_IPingService",     //Kerberos token - not sure where the token comes from
or how this works
+        //"_K10_IPingService",     //Kerberos token - not sure where the token comes from
or how this works
+        //"_KD10_IPingService",     //Kerberos token - not sure where the token comes from
or how this works
+        //"_K_IPingService",     //Kerberos token - not sure where the token comes from or
how this works
+        //"_KD_IPingService",     //Kerberos token - not sure where the token comes from
or how this works
+        //"_KD-SEES_IPingService",     //Kerberos token - not sure where the token comes
from or how this works
+        */
+        
+        
+        
+    }
+
+    private final void doPublish(String url, Object obj) {
+        Endpoint ep = Endpoint.create(obj);
+        ep.getProperties().put(SecurityConstants.CALLBACK_HANDLER, new KeystorePasswordCallback());
+        ep.getProperties().put(SecurityConstants.ENCRYPT_PROPERTIES, "etc/bob.properties");
+        ep.publish(url);
+    }
+    
+    public static void main(String args[]) throws Exception {
+        new Server("http://localhost:9001");
+        System.out.println("Server ready...");
+
+        Thread.sleep(60 * 60 * 10000);
+        System.out.println("Server exiting");
+        System.exit(0);
+    }
+    
+    @javax.jws.WebService(targetNamespace = "http://InteropBaseAddress/interop", 
+                          serviceName = "PingService", 
+                          portName = "AC_IPingService", 
+                          endpointInterface = "interopbaseaddress.interop.IPingService",
+                          wsdlLocation = "target/wsdl2/WSSecureConversation.wsdl")      
 
+    public static class AC_IPingService extends PingServiceImpl {
+    }
+    
+
+}

Propchange: cxf/sandbox/interopfest/wssc/src/main/java/interop/server/Server.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/sandbox/interopfest/wssc/src/main/java/interop/server/Server.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: cxf/sandbox/interopfest/wssc/src/main/java/interop/server/Server.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: cxf/sandbox/interopfest/wssc/src/main/resources/etc/server.xml
URL: http://svn.apache.org/viewvc/cxf/sandbox/interopfest/wssc/src/main/resources/etc/server.xml?rev=745989&r1=745988&r2=745989&view=diff
==============================================================================
--- cxf/sandbox/interopfest/wssc/src/main/resources/etc/server.xml (original)
+++ cxf/sandbox/interopfest/wssc/src/main/resources/etc/server.xml Thu Feb 19 20:41:34 2009
@@ -4,101 +4,47 @@
 <!--            All Rights Reserved. -->
 <!-- -->
 <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:http="http://cxf.apache.org/transports/http/configuration"
-    xmlns:httpj="http://cxf.apache.org/transports/http-jetty/configuration"
-    xmlns:sec="http://cxf.apache.org/configuration/security"
-    xmlns:security="http://schemas.iona.com/soa/security-config"
-    xsi:schemaLocation="
-        http://www.springframework.org/schema/beans                     http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
-        http://cxf.apache.org/jaxws                                     http://cxf.apache.org/schemas/jaxws.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://cxf.apache.org/configuration/security                    http://cxf.apache.org/schemas/configuration/security.xsd
-        http://schemas.iona.com/soa/security-config                     http://schemas.iona.com/soa/security-config.xsd
-    ">
-
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:http="http://cxf.apache.org/transports/http/configuration"
+       xmlns:jaxws="http://cxf.apache.org/jaxws"
+       xmlns:cxf="http://cxf.apache.org/core"
+       xmlns:p="http://cxf.apache.org/policy"
+       xmlns:sec="http://cxf.apache.org/configuration/security"
+       xmlns:httpj="http://cxf.apache.org/transports/http-jetty/configuration"
+       
+       xsi:schemaLocation="
+          http://www.springframework.org/schema/beans           http://www.springframework.org/schema/beans/spring-beans.xsd
+          http://cxf.apache.org/jaxws                           http://cxf.apache.org/schemas/jaxws.xsd
+          http://cxf.apache.org/transports/http/configuration   http://cxf.apache.org/schemas/configuration/http-conf.xsd
+          http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd
+          http://cxf.apache.org/policy http://cxf.apache.org/schemas/policy.xsd
+          http://cxf.apache.org/transports/http-jetty/configuration       http://cxf.apache.org/schemas/configuration/http-jetty.xsd
+          http://cxf.apache.org/configuration/security                    http://cxf.apache.org/schemas/configuration/security.xsd"
+>
+    <cxf:bus>
+        <cxf:features>
+            <p:policies/>
+            <cxf:logging/>
+        </cxf:features>
+    </cxf:bus>
+    
     <!-- -->
-    <!-- Any services listening on port 9001 must use the following -->
+    <!-- Any services listening on port 9002 must use the following -->
     <!-- Transport Layer Security (TLS) settings -->
     <!-- -->
     <httpj:engine-factory bus="cxf">
-        <httpj:engine port="9001">
+        <httpj:engine port="9002">
             <httpj:tlsServerParameters>
                 <sec:keyManagers keyPassword="password">
-                    <sec:keyStore type="pkcs12" password="password" file="keys/alice.pfx"/>
+                    <sec:keyStore type="pkcs12" password="password" resource="certs/alice.pfx"/>
                 </sec:keyManagers>
-                <sec:trustManagers>
+                <!--sec:trustManagers>
                     <sec:keyStore type="jks" password="password" file="keys/certs.jks"/>
-                </sec:trustManagers>
-                <!--
-                <sec:cipherSuitesFilter>
-                    <sec:include>.*_EXPORT_.*</sec:include>
-                    <sec:include>.*_EXPORT1024_.*</sec:include>
-                    <sec:include>.*_WITH_DES_.*</sec:include>
-                    <sec:include>.*_WITH_NULL_.*</sec:include>
-                    <sec:exclude>.*_DH_anon_.*</sec:exclude>
-                </sec:cipherSuitesFilter>
-                <sec:clientAuthentication want="true" required="true"/>
-                -->
+                </sec:trustManagers-->
             </httpj:tlsServerParameters>
         </httpj:engine>
     </httpj:engine-factory>
 
-    <!-- -->
-    <!-- Scenario 3.4 -->
-    <!-- -->
-    <jaxws:endpoint name="{http://InteropBaseAddress/interop}MutualCertificate10SignEncryptRsa15TripleDes_IPingService"
createdFromAPI="true">
-        <jaxws:features>
-            <bean class="org.apache.cxf.feature.LoggingFeature"/>
-        </jaxws:features>
-        <jaxws:outInterceptors>
-            <bean class="org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor"/>
-            <ref bean="MutualCertificate10SignEncryptRsa153Des_Response"/>
-        </jaxws:outInterceptors>
-        <jaxws:inInterceptors>
-            <ref bean="MutualCertificate10SignEncryptRsa153Des_Request"/>
-            <bean class="org.apache.cxf.binding.soap.saaj.SAAJInInterceptor"/>
-        </jaxws:inInterceptors>
-    </jaxws:endpoint>
-    <bean 
-        class="org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor"
-        id="MutualCertificate10SignEncryptRsa153Des_Response">
-        <constructor-arg>
-            <map>
-                <entry key="action" value="Timestamp Signature Encrypt"/>
-                <entry key="user" value="Bob"/>
-                <entry key="signaturePropFile" value="bob.properties"/>
-                <entry key="encryptionPropFile" value="alice.properties"/>
-                <entry key="encryptionUser" value="Alice"/>
-                <entry key="signatureKeyIdentifier" value="DirectReference"/>
-                <entry key="passwordCallbackClass" value="demo.hw.client.KeystorePasswordCallback"/>
-                <entry key="signatureParts" value="{Element}{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd}Timestamp;{Element}{http://schemas.xmlsoap.org/soap/envelope/}Body"/>
-                <!-- -->
-                <!-- Recommendation: signatures should be encrypted -->
-                <!-- -->
-                <entry key="encryptionParts" value="{Element}{http://www.w3.org/2000/09/xmldsig#}Signature;{Content}{http://schemas.xmlsoap.org/soap/envelope/}Body"/>
-                <!-- <entry key="encryptionKeyTransportAlgorithm" value="RSA15"/>
-->
-                <entry key="encryptionSymAlgorithm" value="http://www.w3.org/2001/04/xmlenc#tripledes-cbc"/>
-            </map>
-        </constructor-arg>
-    </bean>
-    <bean 
-        class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor"
-        id="MutualCertificate10SignEncryptRsa153Des_Request">
-        <constructor-arg>
-            <map>
-                <!-- Use this action order for local clients -->
-                <entry key="action" value="Timestamp Signature Encrypt"/>
-                <!-- Use this action spec for WCF clients 
-                <entry key="action" value="Signature Encrypt Timestamp"/>
-                -->
-                <entry key="signaturePropFile" value="alice.properties"/>
-                <entry key="decryptionPropFile" value="bob.properties"/>
-                <entry key="passwordCallbackClass" value="demo.hw.client.KeystorePasswordCallback"/>
-            </map>
-        </constructor-arg>
-    </bean>
+
     
 </beans>

Modified: cxf/sandbox/interopfest/wssc/src/style/makelocal.xsl
URL: http://svn.apache.org/viewvc/cxf/sandbox/interopfest/wssc/src/style/makelocal.xsl?rev=745989&r1=745988&r2=745989&view=diff
==============================================================================
--- cxf/sandbox/interopfest/wssc/src/style/makelocal.xsl (original)
+++ cxf/sandbox/interopfest/wssc/src/style/makelocal.xsl Thu Feb 19 20:41:34 2009
@@ -3,7 +3,8 @@
     xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
     xmlns:xs="http://www.w3.org/2001/XMLSchema"
     xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
-    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
+    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+    xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" >
     <xsl:output method="xml"/>
 
     <xsl:template match="xs:import">
@@ -152,6 +153,8 @@
 
     <xsl:template match="xs:element[@ref='xs:schema']">
     </xsl:template>
+    <xsl:template match="wsdl:port/wsa:EndpointReference">
+    </xsl:template>
     <xsl:template match="@*">
         <xsl:copy/>
     </xsl:template>



Mime
View raw message