JBossWS SVN: r16722 - common-tools/trunk.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2012-09-14 12:06:46 -0400 (Fri, 14 Sep 2012)
New Revision: 16722
Modified:
common-tools/trunk/pom.xml
Log:
Moving to latest snapshots
Modified: common-tools/trunk/pom.xml
===================================================================
--- common-tools/trunk/pom.xml 2012-09-14 16:05:12 UTC (rev 16721)
+++ common-tools/trunk/pom.xml 2012-09-14 16:06:46 UTC (rev 16722)
@@ -24,7 +24,8 @@
</scm>
<properties>
- <jbossws.spi.version>2.0.0.GA</jbossws.spi.version>
+ <jbossws.api.version>1.0.1-SNAPSHOT</jbossws.api.version>
+ <jbossws.spi.version>2.1.0-SNAPSHOT</jbossws.spi.version>
<ant.version>1.7.1</ant.version>
<getopt.version>1.0.13</getopt.version>
<junit.version>3.8.2</junit.version>
@@ -40,6 +41,11 @@
</dependency>
<dependency>
<groupId>org.jboss.ws</groupId>
+ <artifactId>jbossws-api</artifactId>
+ <version>${jbossws.api.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.ws</groupId>
<artifactId>jbossws-spi</artifactId>
<version>${jbossws.spi.version}</version>
</dependency>
12 years, 3 months
JBossWS SVN: r16721 - spi/trunk.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2012-09-14 12:05:12 -0400 (Fri, 14 Sep 2012)
New Revision: 16721
Modified:
spi/trunk/pom.xml
Log:
Moving to jbossws-api 1.0.1-SNAPSHOT
Modified: spi/trunk/pom.xml
===================================================================
--- spi/trunk/pom.xml 2012-09-14 16:04:07 UTC (rev 16720)
+++ spi/trunk/pom.xml 2012-09-14 16:05:12 UTC (rev 16721)
@@ -25,7 +25,7 @@
<!-- Properties -->
<properties>
- <jbossws.api.version>1.0.1.Beta3</jbossws.api.version>
+ <jbossws.api.version>1.0.1-SNAPSHOT</jbossws.api.version>
<jms.api.version>1.0.0.Final</jms.api.version>
<jboss-logging-spi.version>2.0.5.GA</jboss-logging-spi.version>
<servlet.api.version>1.0.0.Final</servlet.api.version>
12 years, 3 months
JBossWS SVN: r16720 - api/trunk/src/main/java/org/jboss/ws/api/tools.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2012-09-14 12:04:07 -0400 (Fri, 14 Sep 2012)
New Revision: 16720
Modified:
api/trunk/src/main/java/org/jboss/ws/api/tools/WSContractProvider.java
Log:
[JBWS-3510] Add WSProvide option for specifying soap:address location to use in generated wsdl
Modified: api/trunk/src/main/java/org/jboss/ws/api/tools/WSContractProvider.java
===================================================================
--- api/trunk/src/main/java/org/jboss/ws/api/tools/WSContractProvider.java 2012-09-13 08:50:26 UTC (rev 16719)
+++ api/trunk/src/main/java/org/jboss/ws/api/tools/WSContractProvider.java 2012-09-14 16:04:07 UTC (rev 16720)
@@ -137,6 +137,14 @@
* @param directory the root directory for generated source code
*/
public abstract void setSourceDirectory(File directory);
+
+ /**
+ * Sets the soap:address to be used for the generated port in the wsdl.
+ * This is ignored if WSDL generation is disabled.
+ *
+ * @param address
+ */
+ public abstract void setPortSoapAddress(String address);
/**
* Sets the ClassLoader used to discover types. This defaults to the one used
12 years, 3 months
JBossWS SVN: r16719 - stack/native/branches/jbossws-native-3.1.2.
by jbossws-commits@lists.jboss.org
Author: rsvoboda(a)redhat.com
Date: 2012-09-13 04:50:26 -0400 (Thu, 13 Sep 2012)
New Revision: 16719
Modified:
stack/native/branches/jbossws-native-3.1.2/pom.xml
Log:
JBPAPP-7461 Synch remoting version with EAP to 2.5.4.SP4
Modified: stack/native/branches/jbossws-native-3.1.2/pom.xml
===================================================================
--- stack/native/branches/jbossws-native-3.1.2/pom.xml 2012-09-13 08:43:39 UTC (rev 16718)
+++ stack/native/branches/jbossws-native-3.1.2/pom.xml 2012-09-13 08:50:26 UTC (rev 16719)
@@ -64,7 +64,7 @@
<jaxb.impl.version>2.1.12.patch01</jaxb.impl.version>
<jboss.common.version>1.2.1.GA</jboss.common.version>
<jboss.jaxbintros.version>1.0.0.GA</jboss.jaxbintros.version>
- <jboss.remoting.version>2.5.4.SP3</jboss.remoting.version>
+ <jboss.remoting.version>2.5.4.SP4</jboss.remoting.version>
<jboss.logging.version>2.1.0.GA</jboss.logging.version>
<jboss.jaxr.version>2.0.1</jboss.jaxr.version>
<apache.scout.version>1.1.1</apache.scout.version>
12 years, 3 months
JBossWS SVN: r16718 - stack/cxf/trunk.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2012-09-13 04:43:39 -0400 (Thu, 13 Sep 2012)
New Revision: 16718
Modified:
stack/cxf/trunk/pom.xml
Log:
Move to common snapshots
Modified: stack/cxf/trunk/pom.xml
===================================================================
--- stack/cxf/trunk/pom.xml 2012-09-13 08:43:08 UTC (rev 16717)
+++ stack/cxf/trunk/pom.xml 2012-09-13 08:43:39 UTC (rev 16718)
@@ -61,7 +61,7 @@
<properties>
<jbossws.api.version>1.0.1.Beta3</jbossws.api.version>
<jbossws.spi.version>2.1.0.Beta3</jbossws.spi.version>
- <jbossws.common.version>2.1.0.Beta3</jbossws.common.version>
+ <jbossws.common.version>2.1.0-SNAPSHOT</jbossws.common.version>
<jbossws.common.tools.version>1.0.1.GA</jbossws.common.tools.version>
<jbossws.shared.testsuite.version>4.1.0-SNAPSHOT</jbossws.shared.testsuite.version>
<jbossws.jboss710.version>4.1.0-SNAPSHOT</jbossws.jboss710.version>
12 years, 3 months
JBossWS SVN: r16717 - common/trunk/src/main/java/org/jboss/ws/common/management.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2012-09-13 04:43:08 -0400 (Thu, 13 Sep 2012)
New Revision: 16717
Modified:
common/trunk/src/main/java/org/jboss/ws/common/management/AbstractServerConfig.java
Log:
- [JBWS-3545] Wrap ClientConfig and EndpointConfig lists into synchronized ones
- set initial size for arraylists above to reduce memory footprint (default is 10 and it's really too much here)
Modified: common/trunk/src/main/java/org/jboss/ws/common/management/AbstractServerConfig.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/management/AbstractServerConfig.java 2012-09-12 16:06:05 UTC (rev 16716)
+++ common/trunk/src/main/java/org/jboss/ws/common/management/AbstractServerConfig.java 2012-09-13 08:43:08 UTC (rev 16717)
@@ -25,6 +25,7 @@
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
import java.util.ResourceBundle;
@@ -78,9 +79,9 @@
//The stack config
protected StackConfig stackConfig;
// The default endpoint configs, if any
- private final List<ClientConfig> clientConfigs = new ArrayList<ClientConfig>();
+ private final List<ClientConfig> clientConfigs = Collections.synchronizedList(new ArrayList<ClientConfig>(2));
// The default endpoint configs, if any
- private final List<EndpointConfig> endpointConfigs = new ArrayList<EndpointConfig>();
+ private final List<EndpointConfig> endpointConfigs = Collections.synchronizedList(new ArrayList<EndpointConfig>(3));
public MBeanServer getMbeanServer()
{
12 years, 3 months
JBossWS SVN: r16716 - in stack/cxf/trunk/modules/testsuite: cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/httpproxy and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2012-09-12 12:06:05 -0400 (Wed, 12 Sep 2012)
New Revision: 16716
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/httpproxy/HTTPProxyTestCaseForked.java
Removed:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/httpproxy/HTTPProxyTestCase.java
Modified:
stack/cxf/trunk/modules/testsuite/pom.xml
Log:
Moving http proxy testcase to forked VM execution as playing with client system properties does not fit multithread execution...
Deleted: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/httpproxy/HTTPProxyTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/httpproxy/HTTPProxyTestCase.java 2012-09-12 16:03:29 UTC (rev 16715)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/httpproxy/HTTPProxyTestCase.java 2012-09-12 16:06:05 UTC (rev 16716)
@@ -1,283 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2012, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.ws.jaxws.cxf.httpproxy;
-
-import java.io.BufferedReader;
-import java.io.ByteArrayOutputStream;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.PrintStream;
-import java.net.Authenticator;
-import java.net.MalformedURLException;
-import java.net.PasswordAuthentication;
-import java.net.URL;
-import java.util.HashMap;
-
-import javax.xml.namespace.QName;
-import javax.xml.ws.BindingProvider;
-import javax.xml.ws.Service;
-
-import junit.framework.Test;
-
-import org.apache.cxf.configuration.security.ProxyAuthorizationPolicy;
-import org.apache.cxf.endpoint.Client;
-import org.apache.cxf.frontend.ClientProxy;
-import org.apache.cxf.transport.http.HTTPConduit;
-import org.apache.cxf.transports.http.configuration.HTTPClientPolicy;
-import org.apache.cxf.transports.http.configuration.ProxyServerType;
-import org.jboss.wsf.test.JBossWSCXFTestSetup;
-import org.jboss.wsf.test.JBossWSTest;
-import org.littleshoot.proxy.DefaultHttpProxyServer;
-import org.littleshoot.proxy.HttpFilter;
-import org.littleshoot.proxy.HttpProxyServer;
-import org.littleshoot.proxy.ProxyAuthorizationHandler;
-
-/**
- * Tests / samples for WS client using HTTP Proxy
- *
- * @author alessio.soldano(a)jboss.com
- * @since 24-May-2011
- */
-public class HTTPProxyTestCase extends JBossWSTest
-{
- private static int proxyPort = 19387;
- private static final String PROXY_USER = "foo";
- private static final String PROXY_PWD = "bar";
- private static final String ENDPOINT_PATH = "/jaxws-cxf-httpproxy/HelloWorldService/HelloWorldImpl";
- private HttpProxyServer proxyServer;
-
- public static Test suite()
- {
- return new JBossWSCXFTestSetup(HTTPProxyTestCase.class, "jaxws-cxf-httpproxy.war");
- }
-
- public void testHttpProxy() throws Exception
- {
- final String testHost = "unreachable-testHttpProxy";
- HelloWorld port = getPort(getResourceURL("jaxws/cxf/httpproxy/HelloWorldService.wsdl"), testHost);
- final String hi = "Hi!";
- //first try without setting up the proxy -> request fails because the host is not known/reachable
- try
- {
- port.echo(hi);
- fail("Exception expected");
- }
- catch (Exception e)
- {
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- e.printStackTrace(new PrintStream(baos));
- assertTrue(baos.toString().contains(testHost));
- }
-
- //then setup the proxy, but provide no authentication/authorization info -> request fails because of HTTP 407
- setProxySystemProperties();
- try
- {
- port.echo(hi);
- fail("Exception expected");
- }
- catch (Exception e)
- {
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- e.printStackTrace(new PrintStream(baos));
- assertTrue(baos.toString().contains("407: Proxy Authentication Required"));
- }
-
- //finally setup everything
- Client client = ClientProxy.getClient(port);
- HTTPConduit conduit = (HTTPConduit)client.getConduit();
- ProxyAuthorizationPolicy policy = new ProxyAuthorizationPolicy();
- policy.setAuthorizationType("Basic");
- policy.setUserName(PROXY_USER);
- policy.setPassword(PROXY_PWD);
- conduit.setProxyAuthorization(policy);
-
- assertEquals(hi, port.echo(hi));
- }
-
- public void testHttpProxyUsingHTTPClientPolicy() throws Exception
- {
- final String testHost = "unreachable-testHttpProxyUsingHTTPClientPolicy";
- HelloWorld port = getPort(getResourceURL("jaxws/cxf/httpproxy/HelloWorldService.wsdl"), testHost);
- final String hi = "Hi!";
- //first try without setting up the proxy -> request fails because the host is not known/reachable
- try
- {
- port.echo(hi);
- fail("Exception expected");
- }
- catch (Exception e)
- {
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- e.printStackTrace(new PrintStream(baos));
- assertTrue(baos.toString().contains(testHost));
- }
-
- //then setup the proxy, but provide no authentication/authorization info -> request fails because of HTTP 407
- Client client = ClientProxy.getClient(port);
- HTTPConduit conduit = (HTTPConduit)client.getConduit();
- HTTPClientPolicy clientPolicy = conduit.getClient();
- clientPolicy.setProxyServerType(ProxyServerType.HTTP);
- clientPolicy.setProxyServer(getServerHost());
- clientPolicy.setProxyServerPort(proxyPort);
- try
- {
- port.echo(hi);
- fail("Exception expected");
- }
- catch (Exception e)
- {
- ByteArrayOutputStream baos = new ByteArrayOutputStream();
- e.printStackTrace(new PrintStream(baos));
- assertTrue(baos.toString().contains("407: Proxy Authentication Required"));
- }
-
- //finally setup authorization info too
- ProxyAuthorizationPolicy authPolicy = new ProxyAuthorizationPolicy();
- authPolicy.setAuthorizationType("Basic");
- authPolicy.setUserName(PROXY_USER);
- authPolicy.setPassword(PROXY_PWD);
- conduit.setProxyAuthorization(authPolicy);
-
- assertEquals(hi, port.echo(hi));
- }
-
- @Override
- protected void setUp() throws Exception
- {
- proxyServer = new DefaultHttpProxyServer(++proxyPort, new HashMap<String, HttpFilter>(),
- getServerHost() + ":8080", null, null);
- ProxyAuthorizationHandler authorizationHandler = new ProxyAuthorizationHandler()
- {
-
- @Override
- public boolean authenticate(String user, String pwd)
- {
- return (PROXY_USER.equals(user) && PROXY_PWD.equals(pwd));
- }
- };
- proxyServer.addProxyAuthenticationHandler(authorizationHandler);
- proxyServer.start();
- }
-
- @Override
- protected void tearDown() throws Exception
- {
- if (proxyServer != null)
- {
- proxyServer.stop();
- }
- clearProxySystemProperties();
- }
-
- private HelloWorld getPort(URL wsdlURL, String endpointAddressHost) throws MalformedURLException
- {
- QName serviceName = new QName("http://org.jboss.ws/jaxws/cxf/httpproxy", "HelloWorldService");
- Service service = Service.create(wsdlURL, serviceName);
- QName portQName = new QName("http://org.jboss.ws/jaxws/cxf/httpproxy", "HelloWorldImplPort");
- HelloWorld port = (HelloWorld) service.getPort(portQName, HelloWorld.class);
- BindingProvider provider = (BindingProvider)port;
- provider.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "http://" + endpointAddressHost + "/jaxws-cxf-httpproxy/HelloWorldService/HelloWorldImpl");
- return port;
- }
-
- private static void setProxySystemProperties()
- {
- System.getProperties().setProperty("http.proxyHost", getServerHost());
- System.getProperties().setProperty("http.proxyPort", String.valueOf(proxyPort));
- }
-
- private static void clearProxySystemProperties()
- {
- System.clearProperty("http.proxyHost");
- System.clearProperty("http.proxyPort");
- }
-
- public void testWSDLHttpProxy() throws Exception
- {
- setProxySystemProperties();
- try
- {
- Authenticator.setDefault(new ProxyAuthenticator(PROXY_USER, PROXY_PWD));
- String endpointAddress = "http://unreachable-testWSDLHttpProxy" + ENDPOINT_PATH;
- StringBuffer sb = readContent(new URL(endpointAddress + "?wsdl"));
- assertTrue(sb.toString().contains("wsdl:definitions name=\"HelloWorldService\""));
- }
- finally
- {
- Authenticator.setDefault(null);
- }
- }
-
- public void testWSDLNoHttpProxy() throws Exception
- {
- clearProxySystemProperties();
- String endpointAddress = "http://unreachable-testWSDLNoHttpProxy" + ENDPOINT_PATH;
- try
- {
- readContent(new URL(endpointAddress + "?wsdl"));
- fail("Request expected to fail without http proxy");
- }
- catch (Exception e)
- {
- assertTrue(e.getMessage().contains("unreachable-testWSDLNoHttpProxy"));
- }
- }
-
- private static StringBuffer readContent(URL url) throws Exception
- {
- StringBuffer sb = new StringBuffer();
- InputStream is = null;
- try
- {
- is = url.openConnection().getInputStream();
- BufferedReader in = new BufferedReader(new InputStreamReader(is));
- String line;
- while ((line = in.readLine()) != null)
- {
- sb.append(line);
- sb.append("\n");
- }
- }
- finally
- {
- if (is != null) is.close();
- }
- return sb;
- }
-
- private static class ProxyAuthenticator extends Authenticator
- {
- private String user, password;
-
- public ProxyAuthenticator(String user, String password)
- {
- this.user = user;
- this.password = password;
- }
-
- protected PasswordAuthentication getPasswordAuthentication()
- {
- return new PasswordAuthentication(user, password.toCharArray());
- }
- }
-}
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/httpproxy/HTTPProxyTestCaseForked.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/httpproxy/HTTPProxyTestCaseForked.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/httpproxy/HTTPProxyTestCaseForked.java 2012-09-12 16:06:05 UTC (rev 16716)
@@ -0,0 +1,283 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.cxf.httpproxy;
+
+import java.io.BufferedReader;
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.PrintStream;
+import java.net.Authenticator;
+import java.net.MalformedURLException;
+import java.net.PasswordAuthentication;
+import java.net.URL;
+import java.util.HashMap;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Service;
+
+import junit.framework.Test;
+
+import org.apache.cxf.configuration.security.ProxyAuthorizationPolicy;
+import org.apache.cxf.endpoint.Client;
+import org.apache.cxf.frontend.ClientProxy;
+import org.apache.cxf.transport.http.HTTPConduit;
+import org.apache.cxf.transports.http.configuration.HTTPClientPolicy;
+import org.apache.cxf.transports.http.configuration.ProxyServerType;
+import org.jboss.wsf.test.JBossWSCXFTestSetup;
+import org.jboss.wsf.test.JBossWSTest;
+import org.littleshoot.proxy.DefaultHttpProxyServer;
+import org.littleshoot.proxy.HttpFilter;
+import org.littleshoot.proxy.HttpProxyServer;
+import org.littleshoot.proxy.ProxyAuthorizationHandler;
+
+/**
+ * Tests / samples for WS client using HTTP Proxy
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 24-May-2011
+ */
+public class HTTPProxyTestCaseForked extends JBossWSTest
+{
+ private static int proxyPort = 19387;
+ private static final String PROXY_USER = "foo";
+ private static final String PROXY_PWD = "bar";
+ private static final String ENDPOINT_PATH = "/jaxws-cxf-httpproxy/HelloWorldService/HelloWorldImpl";
+ private HttpProxyServer proxyServer;
+
+ public static Test suite()
+ {
+ return new JBossWSCXFTestSetup(HTTPProxyTestCaseForked.class, "jaxws-cxf-httpproxy.war");
+ }
+
+ public void testHttpProxy() throws Exception
+ {
+ final String testHost = "unreachable-testHttpProxy";
+ HelloWorld port = getPort(getResourceURL("jaxws/cxf/httpproxy/HelloWorldService.wsdl"), testHost);
+ final String hi = "Hi!";
+ //first try without setting up the proxy -> request fails because the host is not known/reachable
+ try
+ {
+ port.echo(hi);
+ fail("Exception expected");
+ }
+ catch (Exception e)
+ {
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ e.printStackTrace(new PrintStream(baos));
+ assertTrue(baos.toString().contains(testHost));
+ }
+
+ //then setup the proxy, but provide no authentication/authorization info -> request fails because of HTTP 407
+ setProxySystemProperties();
+ try
+ {
+ port.echo(hi);
+ fail("Exception expected");
+ }
+ catch (Exception e)
+ {
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ e.printStackTrace(new PrintStream(baos));
+ assertTrue(baos.toString().contains("407: Proxy Authentication Required"));
+ }
+
+ //finally setup everything
+ Client client = ClientProxy.getClient(port);
+ HTTPConduit conduit = (HTTPConduit)client.getConduit();
+ ProxyAuthorizationPolicy policy = new ProxyAuthorizationPolicy();
+ policy.setAuthorizationType("Basic");
+ policy.setUserName(PROXY_USER);
+ policy.setPassword(PROXY_PWD);
+ conduit.setProxyAuthorization(policy);
+
+ assertEquals(hi, port.echo(hi));
+ }
+
+ public void testHttpProxyUsingHTTPClientPolicy() throws Exception
+ {
+ final String testHost = "unreachable-testHttpProxyUsingHTTPClientPolicy";
+ HelloWorld port = getPort(getResourceURL("jaxws/cxf/httpproxy/HelloWorldService.wsdl"), testHost);
+ final String hi = "Hi!";
+ //first try without setting up the proxy -> request fails because the host is not known/reachable
+ try
+ {
+ port.echo(hi);
+ fail("Exception expected");
+ }
+ catch (Exception e)
+ {
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ e.printStackTrace(new PrintStream(baos));
+ assertTrue(baos.toString().contains(testHost));
+ }
+
+ //then setup the proxy, but provide no authentication/authorization info -> request fails because of HTTP 407
+ Client client = ClientProxy.getClient(port);
+ HTTPConduit conduit = (HTTPConduit)client.getConduit();
+ HTTPClientPolicy clientPolicy = conduit.getClient();
+ clientPolicy.setProxyServerType(ProxyServerType.HTTP);
+ clientPolicy.setProxyServer(getServerHost());
+ clientPolicy.setProxyServerPort(proxyPort);
+ try
+ {
+ port.echo(hi);
+ fail("Exception expected");
+ }
+ catch (Exception e)
+ {
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ e.printStackTrace(new PrintStream(baos));
+ assertTrue(baos.toString().contains("407: Proxy Authentication Required"));
+ }
+
+ //finally setup authorization info too
+ ProxyAuthorizationPolicy authPolicy = new ProxyAuthorizationPolicy();
+ authPolicy.setAuthorizationType("Basic");
+ authPolicy.setUserName(PROXY_USER);
+ authPolicy.setPassword(PROXY_PWD);
+ conduit.setProxyAuthorization(authPolicy);
+
+ assertEquals(hi, port.echo(hi));
+ }
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ proxyServer = new DefaultHttpProxyServer(++proxyPort, new HashMap<String, HttpFilter>(),
+ getServerHost() + ":8080", null, null);
+ ProxyAuthorizationHandler authorizationHandler = new ProxyAuthorizationHandler()
+ {
+
+ @Override
+ public boolean authenticate(String user, String pwd)
+ {
+ return (PROXY_USER.equals(user) && PROXY_PWD.equals(pwd));
+ }
+ };
+ proxyServer.addProxyAuthenticationHandler(authorizationHandler);
+ proxyServer.start();
+ }
+
+ @Override
+ protected void tearDown() throws Exception
+ {
+ clearProxySystemProperties();
+ if (proxyServer != null)
+ {
+ proxyServer.stop();
+ }
+ }
+
+ private HelloWorld getPort(URL wsdlURL, String endpointAddressHost) throws MalformedURLException
+ {
+ QName serviceName = new QName("http://org.jboss.ws/jaxws/cxf/httpproxy", "HelloWorldService");
+ Service service = Service.create(wsdlURL, serviceName);
+ QName portQName = new QName("http://org.jboss.ws/jaxws/cxf/httpproxy", "HelloWorldImplPort");
+ HelloWorld port = (HelloWorld) service.getPort(portQName, HelloWorld.class);
+ BindingProvider provider = (BindingProvider)port;
+ provider.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "http://" + endpointAddressHost + "/jaxws-cxf-httpproxy/HelloWorldService/HelloWorldImpl");
+ return port;
+ }
+
+ private static void setProxySystemProperties()
+ {
+ System.getProperties().setProperty("http.proxyHost", getServerHost());
+ System.getProperties().setProperty("http.proxyPort", String.valueOf(proxyPort));
+ }
+
+ private static void clearProxySystemProperties()
+ {
+ System.clearProperty("http.proxyHost");
+ System.clearProperty("http.proxyPort");
+ }
+
+ public void testWSDLHttpProxy() throws Exception
+ {
+ setProxySystemProperties();
+ try
+ {
+ Authenticator.setDefault(new ProxyAuthenticator(PROXY_USER, PROXY_PWD));
+ String endpointAddress = "http://unreachable-testWSDLHttpProxy" + ENDPOINT_PATH;
+ StringBuffer sb = readContent(new URL(endpointAddress + "?wsdl"));
+ assertTrue(sb.toString().contains("wsdl:definitions name=\"HelloWorldService\""));
+ }
+ finally
+ {
+ Authenticator.setDefault(null);
+ }
+ }
+
+ public void testWSDLNoHttpProxy() throws Exception
+ {
+ clearProxySystemProperties();
+ String endpointAddress = "http://unreachable-testWSDLNoHttpProxy" + ENDPOINT_PATH;
+ try
+ {
+ readContent(new URL(endpointAddress + "?wsdl"));
+ fail("Request expected to fail without http proxy");
+ }
+ catch (Exception e)
+ {
+ assertTrue(e.getMessage().contains("unreachable-testWSDLNoHttpProxy"));
+ }
+ }
+
+ private static StringBuffer readContent(URL url) throws Exception
+ {
+ StringBuffer sb = new StringBuffer();
+ InputStream is = null;
+ try
+ {
+ is = url.openConnection().getInputStream();
+ BufferedReader in = new BufferedReader(new InputStreamReader(is));
+ String line;
+ while ((line = in.readLine()) != null)
+ {
+ sb.append(line);
+ sb.append("\n");
+ }
+ }
+ finally
+ {
+ if (is != null) is.close();
+ }
+ return sb;
+ }
+
+ private static class ProxyAuthenticator extends Authenticator
+ {
+ private String user, password;
+
+ public ProxyAuthenticator(String user, String password)
+ {
+ this.user = user;
+ this.password = password;
+ }
+
+ protected PasswordAuthentication getPasswordAuthentication()
+ {
+ return new PasswordAuthentication(user, password.toCharArray());
+ }
+ }
+}
Modified: stack/cxf/trunk/modules/testsuite/pom.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/pom.xml 2012-09-12 16:03:29 UTC (rev 16715)
+++ stack/cxf/trunk/modules/testsuite/pom.xml 2012-09-12 16:06:05 UTC (rev 16716)
@@ -379,11 +379,12 @@
<forkMode>pertest</forkMode>
<skip>false</skip>
<includes>
+ <include>**/jaxws/cxf/httpproxy/*TestCaseForked.java</include>
+ <include>**/jaxws/samples/schemavalidation/*TestCaseForked.java</include>
+ <include>**/jbws2150/**/*TestCaseForked.java</include>
+ <include>**/jms*/**/*TestCaseForked.java</include>
<include>**/smoke/tools/**/*TestForked.java</include>
<include>**/smoke/tools/**/*TestCaseForked.java</include>
- <include>**/jbws2150/**/*TestCaseForked.java</include>
- <include>**/jms*/**/*TestCaseForked.java</include>
- <include>**/jaxws/samples/schemavalidation/*TestCaseForked.java</include>
</includes>
<systemProperties>
<property>
12 years, 3 months
JBossWS SVN: r16715 - stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2012-09-12 12:03:29 -0400 (Wed, 12 Sep 2012)
New Revision: 16715
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/WSSecurityPolicyExamples22xTestCase.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/WSSecurityPolicyExamples23xTestCase.java
Log:
Minor update to comments
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/WSSecurityPolicyExamples22xTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/WSSecurityPolicyExamples22xTestCase.java 2012-09-12 14:55:23 UTC (rev 16714)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/WSSecurityPolicyExamples22xTestCase.java 2012-09-12 16:03:29 UTC (rev 16715)
@@ -38,6 +38,7 @@
* WS-Security Policy examples
*
* From OASIS WS-SecurityPolicy Examples Version 1.0
+ * http://docs.oasis-open.org/ws-sx/security-policy/examples/ws-sp-usecases-...
*
* @author alessio.soldano(a)jboss.com
* @since 07-Sep-2012
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/WSSecurityPolicyExamples23xTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/WSSecurityPolicyExamples23xTestCase.java 2012-09-12 14:55:23 UTC (rev 16714)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/WSSecurityPolicyExamples23xTestCase.java 2012-09-12 16:03:29 UTC (rev 16715)
@@ -39,6 +39,7 @@
* WS-Security Policy examples
*
* From OASIS WS-SecurityPolicy Examples Version 1.0
+ * http://docs.oasis-open.org/ws-sx/security-policy/examples/ws-sp-usecases-...
*
* @author alessio.soldano(a)jboss.com
* @since 10-Sep-2012
12 years, 3 months
JBossWS SVN: r16714 - in stack/cxf/trunk/modules/testsuite/cxf-tests/src/test: resources/jaxws/samples/wsse/policy/oasis/WEB-INF/wsdl and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2012-09-12 10:55:23 -0400 (Wed, 12 Sep 2012)
New Revision: 16714
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2321Impl.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2322Impl.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2323Impl.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2324Impl.java
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2111Impl.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2112Impl.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2113Impl.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2121Impl.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service213Impl.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service214Impl.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service221Impl.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service222Impl.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service223Impl.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service224Impl.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2311Impl.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2312Impl.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2313Impl.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2314Impl.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2315Impl.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/WSSecurityPolicyExamples23xTestCase.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/oasis/WEB-INF/wsdl/SecurityService23x.wsdl
Log:
[JBWS-3405] Adding testcases for 2.3.2.1, 2.3.2.2, 2.3.2.3 and 2.3.2.4 scenarios of WS-SecurityPolicy Examples 1.0
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2111Impl.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2111Impl.java 2012-09-12 14:04:33 UTC (rev 16713)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2111Impl.java 2012-09-12 14:55:23 UTC (rev 16714)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2112Impl.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2112Impl.java 2012-09-12 14:04:33 UTC (rev 16713)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2112Impl.java 2012-09-12 14:55:23 UTC (rev 16714)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2113Impl.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2113Impl.java 2012-09-12 14:04:33 UTC (rev 16713)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2113Impl.java 2012-09-12 14:55:23 UTC (rev 16714)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2121Impl.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2121Impl.java 2012-09-12 14:04:33 UTC (rev 16713)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2121Impl.java 2012-09-12 14:55:23 UTC (rev 16714)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service213Impl.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service213Impl.java 2012-09-12 14:04:33 UTC (rev 16713)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service213Impl.java 2012-09-12 14:55:23 UTC (rev 16714)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service214Impl.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service214Impl.java 2012-09-12 14:04:33 UTC (rev 16713)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service214Impl.java 2012-09-12 14:55:23 UTC (rev 16714)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service221Impl.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service221Impl.java 2012-09-12 14:04:33 UTC (rev 16713)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service221Impl.java 2012-09-12 14:55:23 UTC (rev 16714)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service222Impl.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service222Impl.java 2012-09-12 14:04:33 UTC (rev 16713)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service222Impl.java 2012-09-12 14:55:23 UTC (rev 16714)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service223Impl.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service223Impl.java 2012-09-12 14:04:33 UTC (rev 16713)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service223Impl.java 2012-09-12 14:55:23 UTC (rev 16714)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service224Impl.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service224Impl.java 2012-09-12 14:04:33 UTC (rev 16713)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service224Impl.java 2012-09-12 14:55:23 UTC (rev 16714)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2311Impl.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2311Impl.java 2012-09-12 14:04:33 UTC (rev 16713)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2311Impl.java 2012-09-12 14:55:23 UTC (rev 16714)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2312Impl.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2312Impl.java 2012-09-12 14:04:33 UTC (rev 16713)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2312Impl.java 2012-09-12 14:55:23 UTC (rev 16714)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2313Impl.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2313Impl.java 2012-09-12 14:04:33 UTC (rev 16713)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2313Impl.java 2012-09-12 14:55:23 UTC (rev 16714)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2314Impl.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2314Impl.java 2012-09-12 14:04:33 UTC (rev 16713)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2314Impl.java 2012-09-12 14:55:23 UTC (rev 16714)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2315Impl.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2315Impl.java 2012-09-12 14:04:33 UTC (rev 16713)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2315Impl.java 2012-09-12 14:55:23 UTC (rev 16714)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2321Impl.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2321Impl.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2321Impl.java 2012-09-12 14:55:23 UTC (rev 16714)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.samples.wsse.policy.oasis;
+
+import javax.ejb.Stateless;
+import javax.jws.WebService;
+
+import org.apache.cxf.annotations.EndpointProperties;
+import org.apache.cxf.annotations.EndpointProperty;
+import org.jboss.ws.api.annotation.WebContext;
+
+@WebService
+(
+ portName = "SecurityService2321Port",
+ serviceName = "SecurityService",
+ wsdlLocation = "WEB-INF/wsdl/SecurityService23x.wsdl",
+ targetNamespace = "http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy/oasis-samples",
+ endpointInterface = "org.jboss.test.ws.jaxws.samples.wsse.policy.oasis.ServiceIface"
+)
+@EndpointProperties(value = {
+ @EndpointProperty(key = "ws-security.signature.properties", value = "bob.properties"),
+ @EndpointProperty(key = "ws-security.signature.username", value = "bob"),
+ @EndpointProperty(key = "ws-security.encryption.properties", value = "bob.properties"),
+ @EndpointProperty(key = "ws-security.encryption.username", value = "useReqSigCert"),
+ @EndpointProperty(key = "ws-security.callback-handler", value = "org.jboss.test.ws.jaxws.samples.wsse.policy.oasis.KeystorePasswordCallback")
+ }
+)
+@Stateless
+@WebContext(urlPattern = "SecurityService2321")
+public class Service2321Impl implements ServiceIface
+{
+ public String sayHello()
+ {
+ return "Hello - (WSS1.1) SAML 2.0 Bearer";
+ }
+}
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2322Impl.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2322Impl.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2322Impl.java 2012-09-12 14:55:23 UTC (rev 16714)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.samples.wsse.policy.oasis;
+
+import javax.ejb.Stateless;
+import javax.jws.WebService;
+
+import org.jboss.ws.api.annotation.WebContext;
+
+@WebService
+(
+ portName = "SecurityService2322Port",
+ serviceName = "SecurityService",
+ wsdlLocation = "WEB-INF/wsdl/SecurityService23x.wsdl",
+ targetNamespace = "http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy/oasis-samples",
+ endpointInterface = "org.jboss.test.ws.jaxws.samples.wsse.policy.oasis.ServiceIface"
+)
+@Stateless
+@WebContext(urlPattern = "SecurityService2322", transportGuarantee="CONFIDENTIAL")
+public class Service2322Impl implements ServiceIface
+{
+ public String sayHello()
+ {
+ return "Hello - (WSS1.1) SAML2.0 Sender Vouches over SSL";
+ }
+}
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2323Impl.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2323Impl.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2323Impl.java 2012-09-12 14:55:23 UTC (rev 16714)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.samples.wsse.policy.oasis;
+
+import javax.ejb.Stateless;
+import javax.jws.WebService;
+
+import org.apache.cxf.annotations.EndpointProperties;
+import org.apache.cxf.annotations.EndpointProperty;
+import org.jboss.ws.api.annotation.WebContext;
+
+@WebService
+(
+ portName = "SecurityService2323Port",
+ serviceName = "SecurityService",
+ wsdlLocation = "WEB-INF/wsdl/SecurityService23x.wsdl",
+ targetNamespace = "http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy/oasis-samples",
+ endpointInterface = "org.jboss.test.ws.jaxws.samples.wsse.policy.oasis.ServiceIface"
+)
+@EndpointProperties(value = {
+ @EndpointProperty(key = "ws-security.signature.properties", value = "bob.properties"),
+ @EndpointProperty(key = "ws-security.signature.username", value = "bob"),
+ @EndpointProperty(key = "ws-security.callback-handler", value = "org.jboss.test.ws.jaxws.samples.wsse.policy.oasis.KeystorePasswordCallback")
+ }
+)
+@Stateless
+@WebContext(urlPattern = "SecurityService2323", transportGuarantee="CONFIDENTIAL")
+public class Service2323Impl implements ServiceIface
+{
+ public String sayHello()
+ {
+ return "Hello - (WSS1.1) SAML2.0 HoK over SSL";
+ }
+}
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2324Impl.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2324Impl.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2324Impl.java 2012-09-12 14:55:23 UTC (rev 16714)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.samples.wsse.policy.oasis;
+
+import javax.ejb.Stateless;
+import javax.jws.WebService;
+
+import org.apache.cxf.annotations.EndpointProperties;
+import org.apache.cxf.annotations.EndpointProperty;
+import org.jboss.ws.api.annotation.WebContext;
+
+@WebService
+(
+ portName = "SecurityService2324Port",
+ serviceName = "SecurityService",
+ wsdlLocation = "WEB-INF/wsdl/SecurityService23x.wsdl",
+ targetNamespace = "http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy/oasis-samples",
+ endpointInterface = "org.jboss.test.ws.jaxws.samples.wsse.policy.oasis.ServiceIface"
+)
+@EndpointProperties(value = {
+ @EndpointProperty(key = "ws-security.signature.properties", value = "bob.properties"),
+ @EndpointProperty(key = "ws-security.signature.username", value = "bob"),
+ @EndpointProperty(key = "ws-security.encryption.properties", value = "bob.properties"),
+ @EndpointProperty(key = "ws-security.encryption.username", value = "useReqSigCert"),
+ @EndpointProperty(key = "ws-security.callback-handler", value = "org.jboss.test.ws.jaxws.samples.wsse.policy.oasis.KeystorePasswordCallback")
+ }
+)
+@Stateless
+@WebContext(urlPattern = "SecurityService2324")
+public class Service2324Impl implements ServiceIface
+{
+ public String sayHello()
+ {
+ return "Hello - (WSS1.1) SAML1.1/2.0 Sender Vouches with X.509 Certificate, Sign, Encrypt";
+ }
+}
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/WSSecurityPolicyExamples23xTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/WSSecurityPolicyExamples23xTestCase.java 2012-09-12 14:04:33 UTC (rev 16713)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/WSSecurityPolicyExamples23xTestCase.java 2012-09-12 14:55:23 UTC (rev 16714)
@@ -165,4 +165,83 @@
assertTrue(proxy.sayHello().equals("Hello - (WSS1.0) SAML1.1 Holder of Key, Sign, Optional Encrypt"));
}
+ /**
+ * 2.3.2.1 (WSS1.1) SAML 2.0 Bearer
+ *
+ * @throws Exception
+ */
+ public void test2321() throws Exception
+ {
+ Service service = Service.create(new URL(serviceURL + "SecurityService2321?wsdl"), serviceName);
+ ServiceIface proxy = (ServiceIface)service.getPort(new QName(NS, "SecurityService2321Port"), ServiceIface.class);
+ SamlCallbackHandler cbh = new SamlCallbackHandler();
+ cbh.setConfirmationMethod("urn:oasis:names:tc:SAML:2.0:cm:bearer");
+ cbh.setSaml2(true);
+ Map<String, Object> reqCtx = ((BindingProvider)proxy).getRequestContext();
+ reqCtx.put(SecurityConstants.SAML_CALLBACK_HANDLER, cbh);
+ reqCtx.put(SecurityConstants.CALLBACK_HANDLER, new KeystorePasswordCallback());
+ reqCtx.put(SecurityConstants.SIGNATURE_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/alice.properties"));
+ reqCtx.put(SecurityConstants.ENCRYPT_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/alice.properties"));
+ reqCtx.put(SecurityConstants.SIGNATURE_USERNAME, "alice");
+ reqCtx.put(SecurityConstants.ENCRYPT_USERNAME, "bob");
+ assertTrue(proxy.sayHello().equals("Hello - (WSS1.1) SAML 2.0 Bearer"));
+ }
+
+ /**
+ * 2.3.2.2 (WSS1.1) SAML2.0 Sender Vouches over SSL
+ *
+ * @throws Exception
+ */
+ public void test2322() throws Exception
+ {
+ Service service = Service.create(new URL(serviceURLHttps + "SecurityService2322?wsdl"), serviceName);
+ ServiceIface proxy = (ServiceIface)service.getPort(new QName(NS, "SecurityService2322Port"), ServiceIface.class);
+ SamlCallbackHandler cbh = new SamlCallbackHandler();
+ cbh.setConfirmationMethod("urn:oasis:names:tc:SAML:2.0:cm:sender-vouches");
+ cbh.setSaml2(true);
+ ((BindingProvider)proxy).getRequestContext().put(SecurityConstants.SAML_CALLBACK_HANDLER, cbh);
+ assertTrue(proxy.sayHello().equals("Hello - (WSS1.1) SAML2.0 Sender Vouches over SSL"));
+ }
+
+ /**
+ * 2.3.2.3 (WSS1.1) SAML2.0 HoK over SSL
+ *
+ * @throws Exception
+ */
+ public void test2323() throws Exception
+ {
+ Service service = Service.create(new URL(serviceURLHttps + "SecurityService2323?wsdl"), serviceName);
+ ServiceIface proxy = (ServiceIface)service.getPort(new QName(NS, "SecurityService2323Port"), ServiceIface.class);
+ Map<String, Object> reqCtx = ((BindingProvider) proxy).getRequestContext();
+ SamlCallbackHandler cbh = new SamlCallbackHandler();
+ cbh.setConfirmationMethod("urn:oasis:names:tc:SAML:2.0:cm:holder-of-key");
+ cbh.setSaml2(true);
+ reqCtx.put(SecurityConstants.SAML_CALLBACK_HANDLER, cbh);
+ reqCtx.put(SecurityConstants.SIGNATURE_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/alice.properties"));
+ reqCtx.put(SecurityConstants.SIGNATURE_USERNAME, "alice");
+ reqCtx.put(SecurityConstants.CALLBACK_HANDLER, new KeystorePasswordCallback());
+ reqCtx.put(SecurityConstants.SELF_SIGN_SAML_ASSERTION, "true");
+ assertTrue(proxy.sayHello().equals("Hello - (WSS1.1) SAML2.0 HoK over SSL"));
+ }
+
+ /**
+ * 2.3.2.4 (WSS1.1) SAML1.1/2.0 Sender Vouches with X.509 Certificate, Sign, Encrypt
+ *
+ * @throws Exception
+ */
+ public void test2324() throws Exception
+ {
+ Service service = Service.create(new URL(serviceURL + "SecurityService2324?wsdl"), serviceName);
+ ServiceIface proxy = (ServiceIface)service.getPort(new QName(NS, "SecurityService2324Port"), ServiceIface.class);
+ Map<String, Object> reqCtx = ((BindingProvider) proxy).getRequestContext();
+ SamlCallbackHandler cbh = new SamlCallbackHandler();
+ cbh.setConfirmationMethod("urn:oasis:names:tc:SAML:1.0:cm:sender-vouches");
+ reqCtx.put(SecurityConstants.SAML_CALLBACK_HANDLER, cbh);
+ reqCtx.put(SecurityConstants.CALLBACK_HANDLER, new KeystorePasswordCallback());
+ reqCtx.put(SecurityConstants.SIGNATURE_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/alice.properties"));
+ reqCtx.put(SecurityConstants.ENCRYPT_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/alice.properties"));
+ reqCtx.put(SecurityConstants.SIGNATURE_USERNAME, "alice");
+ reqCtx.put(SecurityConstants.ENCRYPT_USERNAME, "bob");
+ assertTrue(proxy.sayHello().equals("Hello - (WSS1.1) SAML1.1/2.0 Sender Vouches with X.509 Certificate, Sign, Encrypt"));
+ }
}
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/oasis/WEB-INF/wsdl/SecurityService23x.wsdl
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/oasis/WEB-INF/wsdl/SecurityService23x.wsdl 2012-09-12 14:04:33 UTC (rev 16713)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/oasis/WEB-INF/wsdl/SecurityService23x.wsdl 2012-09-12 14:55:23 UTC (rev 16714)
@@ -96,6 +96,60 @@
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
+ <wsdl:binding name="SecurityService2321PortBinding" type="tns:ServiceIface">
+ <wsp:PolicyReference URI="#SecurityService2321_policy"/>
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
+ <wsdl:operation name="sayHello">
+ <soap:operation soapAction=""/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:binding name="SecurityService2322PortBinding" type="tns:ServiceIface">
+ <wsp:PolicyReference URI="#SecurityService2322_policy"/>
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
+ <wsdl:operation name="sayHello">
+ <soap:operation soapAction=""/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:binding name="SecurityService2323PortBinding" type="tns:ServiceIface">
+ <wsp:PolicyReference URI="#SecurityService2323_policy"/>
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
+ <wsdl:operation name="sayHello">
+ <soap:operation soapAction=""/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:binding name="SecurityService2324PortBinding" type="tns:ServiceIface">
+ <wsp:PolicyReference URI="#SecurityService2324_policy"/>
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
+ <wsdl:operation name="sayHello">
+ <soap:operation soapAction=""/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ <wsp:PolicyReference URI="#Input_Policy"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ <wsp:PolicyReference URI="#Output_Policy"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
<wsdl:service name="SecurityService">
<wsdl:port name="SecurityService2311Port" binding="tns:SecurityService2311PortBinding">
<soap:address location="http://@jboss.bind.address@:8080/jaxws-samples-wsse-policy-oasis/SecurityService2311"/>
@@ -112,6 +166,18 @@
<wsdl:port name="SecurityService2315Port" binding="tns:SecurityService2315PortBinding">
<soap:address location="http://@jboss.bind.address@:8080/jaxws-samples-wsse-policy-oasis/SecurityService2315"/>
</wsdl:port>
+ <wsdl:port name="SecurityService2321Port" binding="tns:SecurityService2321PortBinding">
+ <soap:address location="http://@jboss.bind.address@:8080/jaxws-samples-wsse-policy-oasis/SecurityService2321"/>
+ </wsdl:port>
+ <wsdl:port name="SecurityService2322Port" binding="tns:SecurityService2322PortBinding">
+ <soap:address location="https://@jboss.bind.address@:8443/jaxws-samples-wsse-policy-oasis/SecurityService2322"/>
+ </wsdl:port>
+ <wsdl:port name="SecurityService2323Port" binding="tns:SecurityService2323PortBinding">
+ <soap:address location="https://@jboss.bind.address@:8443/jaxws-samples-wsse-policy-oasis/SecurityService2323"/>
+ </wsdl:port>
+ <wsdl:port name="SecurityService2324Port" binding="tns:SecurityService2324PortBinding">
+ <soap:address location="http://@jboss.bind.address@:8080/jaxws-samples-wsse-policy-oasis/SecurityService2324"/>
+ </wsdl:port>
</wsdl:service>
<!-- 2.3.1.1 (WSS1.0) SAML1.1 Assertion (Bearer) -->
<wsp:Policy wsu:Id="SecurityService2311_policy">
@@ -306,7 +372,205 @@
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
-
+ <!-- 2.3.2.1 (WSS1.1) SAML 2.0 Bearer -->
+ <wsp:Policy wsu:Id="SecurityService2321_policy">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <sp:AsymmetricBinding>
+ <wsp:Policy>
+ <sp:InitiatorToken>
+ <wsp:Policy>
+ <sp:X509Token
+ sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/Al...">
+ <wsp:Policy>
+ <sp:WssX509V3Token10/>
+ </wsp:Policy>
+ </sp:X509Token>
+ </wsp:Policy>
+ </sp:InitiatorToken>
+ <sp:RecipientToken>
+ <wsp:Policy>
+ <sp:X509Token
+ sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/Never">
+ <wsp:Policy>
+ <sp:WssX509V3Token10 />
+ </wsp:Policy>
+ </sp:X509Token>
+ </wsp:Policy>
+ </sp:RecipientToken>
+ <sp:AlgorithmSuite>
+ <wsp:Policy>
+ <sp:Basic256/>
+ </wsp:Policy>
+ </sp:AlgorithmSuite>
+ <sp:Layout>
+ <wsp:Policy>
+ <sp:Strict/>
+ </wsp:Policy>
+ </sp:Layout>
+ <sp:IncludeTimestamp/>
+ <sp:OnlySignEntireHeadersAndBody/>
+ </wsp:Policy>
+ </sp:AsymmetricBinding>
+ <sp:Wss11>
+ <wsp:Policy>
+ <sp:MustSupportRefKeyIdentifier/>
+ <sp:MustSupportRefIssuerSerial/>
+ <sp:MustSupportRefThumbprint/>
+ <sp:MustSupportRefEncryptedKey/>
+ </wsp:Policy>
+ </sp:Wss11>
+ <sp:SupportingTokens>
+ <wsp:Policy>
+ <sp:SamlToken
+ sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/Al...">
+ <wsp:Policy>
+ <sp:WssSamlV20Token11/>
+ </wsp:Policy>
+ </sp:SamlToken>
+ </wsp:Policy>
+ </sp:SupportingTokens>
+ </wsp:All>
+ </wsp:ExactlyOne>
+ </wsp:Policy>
+ <!-- 2.3.2.2 (WSS1.1) SAML2.0 Sender Vouches over SSL -->
+ <wsp:Policy wsu:Id="SecurityService2322_policy">
+ <sp:TransportBinding>
+ <wsp:Policy>
+ <sp:TransportToken>
+ <wsp:Policy>
+ <sp:HttpsToken>
+ <wsp:Policy>
+ <sp:RequireClientCertificate/>
+ </wsp:Policy>
+ </sp:HttpsToken>
+ </wsp:Policy>
+ </sp:TransportToken>
+ <sp:AlgorithmSuite>
+ <wsp:Policy>
+ <sp:Basic256/>
+ </wsp:Policy>
+ </sp:AlgorithmSuite>
+ <sp:Layout>
+ <wsp:Policy>
+ <sp:Strict />
+ </wsp:Policy>
+ </sp:Layout>
+ <sp:IncludeTimestamp/>
+ </wsp:Policy>
+ </sp:TransportBinding>
+ <sp:SignedSupportingTokens>
+ <wsp:Policy>
+ <sp:SamlToken
+ sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/Al...">
+ <wsp:Policy>
+ <sp:WssSamlV20Token11/>
+ </wsp:Policy>
+ </sp:SamlToken>
+ </wsp:Policy>
+ </sp:SignedSupportingTokens>
+ </wsp:Policy>
+ <!-- 2.3.2.3 (WSS1.1) SAML2.0 HoK over SSL -->
+ <wsp:Policy wsu:Id="SecurityService2323_policy">
+ <sp:TransportBinding>
+ <wsp:Policy>
+ <sp:TransportToken>
+ <wsp:Policy>
+ <sp:HttpsToken>
+ <wsp:Policy>
+ <sp:RequireClientCertificate/>
+ </wsp:Policy>
+ </sp:HttpsToken>
+ </wsp:Policy>
+ </sp:TransportToken>
+ <sp:AlgorithmSuite>
+ <wsp:Policy>
+ <sp:Basic256/>
+ </wsp:Policy>
+ </sp:AlgorithmSuite>
+ <sp:Layout>
+ <wsp:Policy>
+ <sp:Strict/>
+ </wsp:Policy>
+ </sp:Layout>
+ <sp:IncludeTimestamp/>
+ </wsp:Policy>
+ </sp:TransportBinding>
+ <sp:SignedEndorsingSupportingTokens>
+ <wsp:Policy>
+ <sp:SamlToken
+ sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/Al...">
+ <wsp:Policy>
+ <sp:WssSamlV20Token11/>
+ </wsp:Policy>
+ </sp:SamlToken>
+ </wsp:Policy>
+ </sp:SignedEndorsingSupportingTokens>
+ </wsp:Policy>
+ <!-- 2.3.2.4 (WSS1.1) SAML1.1/2.0 Sender Vouches with X.509 Certificate, Sign, Encrypt -->
+ <wsp:Policy wsu:Id="SecurityService2324_policy">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <sp:SymmetricBinding>
+ <wsp:Policy>
+ <sp:ProtectionToken>
+ <wsp:Policy>
+ <sp:X509Token
+ sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/Never">
+ <wsp:Policy>
+ <sp:RequireThumbprintReference />
+ <sp:RequireDerivedKeys wsp:Optional="true"/>
+ <sp:WssX509V3Token10/>
+ </wsp:Policy>
+ </sp:X509Token>
+ </wsp:Policy>
+ </sp:ProtectionToken>
+ <sp:AlgorithmSuite>
+ <wsp:Policy>
+ <sp:Basic256/>
+ </wsp:Policy>
+ </sp:AlgorithmSuite>
+ <sp:Layout>
+ <wsp:Policy>
+ <sp:Strict/>
+ </wsp:Policy>
+ </sp:Layout>
+ <sp:IncludeTimestamp/>
+ <sp:OnlySignEntireHeadersAndBody/>
+ </wsp:Policy>
+ </sp:SymmetricBinding>
+ <sp:SignedSupportingTokens>
+ <wsp:Policy>
+ <sp:SamlToken
+ sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/Al...">
+ <wsp:Policy>
+ <sp:WssSamlV11Token11/>
+ </wsp:Policy>
+ </sp:SamlToken>
+ </wsp:Policy>
+ </sp:SignedSupportingTokens>
+ <sp:EndorsingSupportingTokens>
+ <wsp:Policy>
+ <sp:X509Token
+ sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/Al...">
+ <wsp:Policy>
+ <sp:WssX509V3Token11/>
+ </wsp:Policy>
+ </sp:X509Token>
+ </wsp:Policy>
+ </sp:EndorsingSupportingTokens>
+ <sp:Wss11>
+ <wsp:Policy>
+ <sp:MustSupportRefKeyIdentifier/>
+ <sp:MustSupportRefIssuerSerial/>
+ <sp:MustSupportRefThumbprint/>
+ <sp:MustSupportRefEncryptedKey/>
+ </wsp:Policy>
+ </sp:Wss11>
+ </wsp:All>
+ </wsp:ExactlyOne>
+ </wsp:Policy>
+
<wsp:Policy wsu:Id="Input_Policy">
<wsp:ExactlyOne>
<wsp:All>
12 years, 3 months
JBossWS SVN: r16713 - in stack/cxf/trunk/modules/testsuite/cxf-tests/src/test: resources/jaxws/samples/wsse/policy/oasis/WEB-INF/wsdl and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2012-09-12 10:04:33 -0400 (Wed, 12 Sep 2012)
New Revision: 16713
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2314Impl.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2315Impl.java
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/WSSecurityPolicyExamples21xTestCase.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/WSSecurityPolicyExamples23xTestCase.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/oasis/WEB-INF/wsdl/SecurityService23x.wsdl
Log:
[JBWS-3405] Adding testcases for 2.3.1.4 and 2.3.1.5 scenarios of WS-SecurityPolicy Example 1.0 + minor fixes
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2314Impl.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2314Impl.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2314Impl.java 2012-09-12 14:04:33 UTC (rev 16713)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.samples.wsse.policy.oasis;
+
+import javax.ejb.Stateless;
+import javax.jws.WebService;
+
+import org.apache.cxf.annotations.EndpointProperties;
+import org.apache.cxf.annotations.EndpointProperty;
+import org.jboss.ws.api.annotation.WebContext;
+
+@WebService
+(
+ portName = "SecurityService2314Port",
+ serviceName = "SecurityService",
+ wsdlLocation = "WEB-INF/wsdl/SecurityService23x.wsdl",
+ targetNamespace = "http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy/oasis-samples",
+ endpointInterface = "org.jboss.test.ws.jaxws.samples.wsse.policy.oasis.ServiceIface"
+)
+@EndpointProperties(value = {
+ @EndpointProperty(key = "ws-security.signature.properties", value = "bob.properties"),
+ @EndpointProperty(key = "ws-security.signature.username", value = "bob"),
+ @EndpointProperty(key = "ws-security.encryption.properties", value = "bob.properties"),
+ @EndpointProperty(key = "ws-security.encryption.username", value = "useReqSigCert"),
+ @EndpointProperty(key = "ws-security.callback-handler", value = "org.jboss.test.ws.jaxws.samples.wsse.policy.oasis.KeystorePasswordCallback")
+ }
+)
+@Stateless
+@WebContext(urlPattern = "SecurityService2314")
+public class Service2314Impl implements ServiceIface
+{
+ public String sayHello()
+ {
+ return "Hello - (WSS1.0) SAML1.1 Sender Vouches with X.509 Certificates, Sign, Optional Encrypt";
+ }
+}
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2315Impl.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2315Impl.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2315Impl.java 2012-09-12 14:04:33 UTC (rev 16713)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.samples.wsse.policy.oasis;
+
+import javax.ejb.Stateless;
+import javax.jws.WebService;
+
+import org.apache.cxf.annotations.EndpointProperties;
+import org.apache.cxf.annotations.EndpointProperty;
+import org.jboss.ws.api.annotation.WebContext;
+
+@WebService
+(
+ portName = "SecurityService2315Port",
+ serviceName = "SecurityService",
+ wsdlLocation = "WEB-INF/wsdl/SecurityService23x.wsdl",
+ targetNamespace = "http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy/oasis-samples",
+ endpointInterface = "org.jboss.test.ws.jaxws.samples.wsse.policy.oasis.ServiceIface"
+)
+@EndpointProperties(value = {
+ @EndpointProperty(key = "ws-security.signature.properties", value = "bob.properties"),
+ @EndpointProperty(key = "ws-security.signature.username", value = "bob"),
+ @EndpointProperty(key = "ws-security.encryption.properties", value = "bob.properties"),
+ @EndpointProperty(key = "ws-security.encryption.username", value = "useReqSigCert"),
+ @EndpointProperty(key = "ws-security.callback-handler", value = "org.jboss.test.ws.jaxws.samples.wsse.policy.oasis.KeystorePasswordCallback")
+ }
+)
+@Stateless
+@WebContext(urlPattern = "SecurityService2315")
+public class Service2315Impl implements ServiceIface
+{
+ public String sayHello()
+ {
+ return "Hello - (WSS1.0) SAML1.1 Holder of Key, Sign, Optional Encrypt";
+ }
+}
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/WSSecurityPolicyExamples21xTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/WSSecurityPolicyExamples21xTestCase.java 2012-09-12 10:57:03 UTC (rev 16712)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/WSSecurityPolicyExamples21xTestCase.java 2012-09-12 14:04:33 UTC (rev 16713)
@@ -48,6 +48,7 @@
{
private final String NS = "http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy/oasis-samples";
private final String serviceURL = "http://" + getServerHost() + ":8080/jaxws-samples-wsse-policy-oasis-21x/";
+ private final String serviceURLHttps = "https://" + getServerHost() + ":8443/jaxws-samples-wsse-policy-oasis-21x/";
private final QName serviceName = new QName(NS, "SecurityService");
public static Test suite()
@@ -115,7 +116,7 @@
*/
public void test2121() throws Exception
{
- Service service = Service.create(new URL(serviceURL + "SecurityService2121?wsdl"), serviceName);
+ Service service = Service.create(new URL(serviceURLHttps + "SecurityService2121?wsdl"), serviceName);
ServiceIface proxy = (ServiceIface)service.getPort(new QName(NS, "SecurityService2121Port"), ServiceIface.class);
setupWsse(proxy);
assertTrue(proxy.sayHello().equals("Hello - UsernameToken as supporting token"));
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/WSSecurityPolicyExamples23xTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/WSSecurityPolicyExamples23xTestCase.java 2012-09-12 10:57:03 UTC (rev 16712)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/WSSecurityPolicyExamples23xTestCase.java 2012-09-12 14:04:33 UTC (rev 16713)
@@ -47,6 +47,7 @@
{
private final String NS = "http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy/oasis-samples";
private final String serviceURL = "http://" + getServerHost() + ":8080/jaxws-samples-wsse-policy-oasis-23x/";
+ private final String serviceURLHttps = "https://" + getServerHost() + ":8443/jaxws-samples-wsse-policy-oasis-23x/";
private final QName serviceName = new QName(NS, "SecurityService");
public static Test suite()
@@ -93,7 +94,7 @@
*/
public void test2312() throws Exception
{
- Service service = Service.create(new URL(serviceURL + "SecurityService2312?wsdl"), serviceName);
+ Service service = Service.create(new URL(serviceURLHttps + "SecurityService2312?wsdl"), serviceName);
ServiceIface proxy = (ServiceIface)service.getPort(new QName(NS, "SecurityService2312Port"), ServiceIface.class);
SamlCallbackHandler cbh = new SamlCallbackHandler();
cbh.setConfirmationMethod("urn:oasis:names:tc:SAML:1.0:cm:sender-vouches");
@@ -108,16 +109,60 @@
*/
public void test2313() throws Exception
{
- Service service = Service.create(new URL(serviceURL + "SecurityService2313?wsdl"), serviceName);
+ Service service = Service.create(new URL(serviceURLHttps + "SecurityService2313?wsdl"), serviceName);
ServiceIface proxy = (ServiceIface)service.getPort(new QName(NS, "SecurityService2313Port"), ServiceIface.class);
+ Map<String, Object> reqCtx = ((BindingProvider) proxy).getRequestContext();
SamlCallbackHandler cbh = new SamlCallbackHandler();
cbh.setConfirmationMethod("urn:oasis:names:tc:SAML:1.0:cm:holder-of-key");
- ((BindingProvider) proxy).getRequestContext().put(SecurityConstants.SAML_CALLBACK_HANDLER, cbh);
- ((BindingProvider) proxy).getRequestContext().put(SecurityConstants.SIGNATURE_PROPERTIES,
- Thread.currentThread().getContextClassLoader().getResource("META-INF/alice.properties"));
- ((BindingProvider)proxy).getRequestContext().put(SecurityConstants.SIGNATURE_USERNAME, "alice");
- ((BindingProvider)proxy).getRequestContext().put(SecurityConstants.CALLBACK_HANDLER, new KeystorePasswordCallback());
- ((BindingProvider)proxy).getRequestContext().put(SecurityConstants.SELF_SIGN_SAML_ASSERTION, "true");
+ reqCtx.put(SecurityConstants.SAML_CALLBACK_HANDLER, cbh);
+ reqCtx.put(SecurityConstants.SIGNATURE_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/alice.properties"));
+ reqCtx.put(SecurityConstants.SIGNATURE_USERNAME, "alice");
+ reqCtx.put(SecurityConstants.CALLBACK_HANDLER, new KeystorePasswordCallback());
+ reqCtx.put(SecurityConstants.SELF_SIGN_SAML_ASSERTION, "true");
assertTrue(proxy.sayHello().equals("Hello - (WSS1.0) SAML1.1 Assertion (HK) over SSL"));
}
+
+ /**
+ * 2.3.1.4 (WSS1.0) SAML1.1 Sender Vouches with X.509 Certificates, Sign, Optional Encrypt
+ *
+ * @throws Exception
+ */
+ public void test2314() throws Exception
+ {
+ Service service = Service.create(new URL(serviceURL + "SecurityService2314?wsdl"), serviceName);
+ ServiceIface proxy = (ServiceIface)service.getPort(new QName(NS, "SecurityService2314Port"), ServiceIface.class);
+ Map<String, Object> reqCtx = ((BindingProvider) proxy).getRequestContext();
+ SamlCallbackHandler cbh = new SamlCallbackHandler();
+ cbh.setConfirmationMethod("urn:oasis:names:tc:SAML:1.0:cm:sender-vouches");
+ reqCtx.put(SecurityConstants.SAML_CALLBACK_HANDLER, cbh);
+ reqCtx.put(SecurityConstants.CALLBACK_HANDLER, new KeystorePasswordCallback());
+ reqCtx.put(SecurityConstants.SIGNATURE_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/alice.properties"));
+ reqCtx.put(SecurityConstants.ENCRYPT_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/alice.properties"));
+ reqCtx.put(SecurityConstants.SIGNATURE_USERNAME, "alice");
+ reqCtx.put(SecurityConstants.ENCRYPT_USERNAME, "bob");
+ assertTrue(proxy.sayHello().equals("Hello - (WSS1.0) SAML1.1 Sender Vouches with X.509 Certificates, Sign, Optional Encrypt"));
+ }
+
+ /**
+ * 2.3.1.5 (WSS1.0) SAML1.1 Holder of Key, Sign, Optional Encrypt
+ *
+ * @throws Exception
+ */
+ public void test2315() throws Exception
+ {
+ Service service = Service.create(new URL(serviceURL + "SecurityService2315?wsdl"), serviceName);
+ ServiceIface proxy = (ServiceIface)service.getPort(new QName(NS, "SecurityService2315Port"), ServiceIface.class);
+ Map<String, Object> reqCtx = ((BindingProvider) proxy).getRequestContext();
+ SamlCallbackHandler cbh = new SamlCallbackHandler();
+ cbh.setConfirmationMethod("urn:oasis:names:tc:SAML:1.0:cm:holder-of-key");
+ reqCtx.put(SecurityConstants.SAML_CALLBACK_HANDLER, cbh);
+ reqCtx.put(SecurityConstants.CALLBACK_HANDLER, new KeystorePasswordCallback());
+ reqCtx.put(SecurityConstants.SIGNATURE_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/alice.properties"));
+ reqCtx.put(SecurityConstants.ENCRYPT_PROPERTIES, Thread.currentThread().getContextClassLoader().getResource("META-INF/alice.properties"));
+ reqCtx.put(SecurityConstants.SIGNATURE_USERNAME, "alice");
+ reqCtx.put(SecurityConstants.ENCRYPT_USERNAME, "bob");
+ reqCtx.put(SecurityConstants.SELF_SIGN_SAML_ASSERTION, "true");
+ assertTrue(proxy.sayHello().equals("Hello - (WSS1.0) SAML1.1 Holder of Key, Sign, Optional Encrypt"));
+ }
+
}
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/oasis/WEB-INF/wsdl/SecurityService23x.wsdl
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/oasis/WEB-INF/wsdl/SecurityService23x.wsdl 2012-09-12 10:57:03 UTC (rev 16712)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/oasis/WEB-INF/wsdl/SecurityService23x.wsdl 2012-09-12 14:04:33 UTC (rev 16713)
@@ -66,6 +66,36 @@
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
+ <wsdl:binding name="SecurityService2314PortBinding" type="tns:ServiceIface">
+ <wsp:PolicyReference URI="#SecurityService2314_policy"/>
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
+ <wsdl:operation name="sayHello">
+ <soap:operation soapAction=""/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ <wsp:PolicyReference URI="#Input_Policy"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ <wsp:PolicyReference URI="#Output_Policy"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:binding name="SecurityService2315PortBinding" type="tns:ServiceIface">
+ <wsp:PolicyReference URI="#SecurityService2315_policy"/>
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
+ <wsdl:operation name="sayHello">
+ <soap:operation soapAction=""/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ <wsp:PolicyReference URI="#Input_Policy"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ <wsp:PolicyReference URI="#Output_Policy"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
<wsdl:service name="SecurityService">
<wsdl:port name="SecurityService2311Port" binding="tns:SecurityService2311PortBinding">
<soap:address location="http://@jboss.bind.address@:8080/jaxws-samples-wsse-policy-oasis/SecurityService2311"/>
@@ -76,6 +106,12 @@
<wsdl:port name="SecurityService2313Port" binding="tns:SecurityService2313PortBinding">
<soap:address location="https://@jboss.bind.address@:8443/jaxws-samples-wsse-policy-oasis/SecurityService2313"/>
</wsdl:port>
+ <wsdl:port name="SecurityService2314Port" binding="tns:SecurityService2314PortBinding">
+ <soap:address location="http://@jboss.bind.address@:8080/jaxws-samples-wsse-policy-oasis/SecurityService2314"/>
+ </wsdl:port>
+ <wsdl:port name="SecurityService2315Port" binding="tns:SecurityService2315PortBinding">
+ <soap:address location="http://@jboss.bind.address@:8080/jaxws-samples-wsse-policy-oasis/SecurityService2315"/>
+ </wsdl:port>
</wsdl:service>
<!-- 2.3.1.1 (WSS1.0) SAML1.1 Assertion (Bearer) -->
<wsp:Policy wsu:Id="SecurityService2311_policy">
@@ -142,7 +178,7 @@
</sp:TransportToken>
<sp:AlgorithmSuite>
<wsp:Policy>
- <sp:Basic128 />
+ <sp:Basic256 />
</wsp:Policy>
</sp:AlgorithmSuite>
<sp:Layout>
@@ -164,4 +200,135 @@
</wsp:Policy>
</sp:SignedEndorsingSupportingTokens>
</wsp:Policy>
+ <!-- 2.3.1.4 (WSS1.0) SAML1.1 Sender Vouches with X.509 Certificates, Sign, Optional Encrypt -->
+ <wsp:Policy wsu:Id="SecurityService2314_policy">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <sp:AsymmetricBinding>
+ <wsp:Policy>
+ <sp:InitiatorToken>
+ <wsp:Policy>
+ <sp:X509Token
+ sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/Al...">
+ <wsp:Policy>
+ <sp:WssX509V3Token10 />
+ </wsp:Policy>
+ </sp:X509Token>
+ </wsp:Policy>
+ </sp:InitiatorToken>
+ <sp:RecipientToken>
+ <wsp:Policy>
+ <sp:X509Token
+ sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/Never">
+ <wsp:Policy>
+ <sp:WssX509V3Token10 />
+ </wsp:Policy>
+ </sp:X509Token>
+ </wsp:Policy>
+ </sp:RecipientToken>
+ <sp:AlgorithmSuite>
+ <wsp:Policy>
+ <sp:Basic256/>
+ </wsp:Policy>
+ </sp:AlgorithmSuite>
+ <sp:Layout>
+ <wsp:Policy>
+ <sp:Strict/>
+ </wsp:Policy>
+ </sp:Layout>
+ <sp:IncludeTimestamp/>
+ <sp:OnlySignEntireHeadersAndBody/>
+ </wsp:Policy>
+ </sp:AsymmetricBinding>
+ <sp:Wss10>
+ <wsp:Policy>
+ <sp:MustSupportRefKeyIdentifier/>
+ </wsp:Policy>
+ </sp:Wss10>
+ <sp:SignedSupportingTokens>
+ <wsp:Policy>
+ <sp:SamlToken
+ sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/Al...">
+ <wsp:Policy>
+ <sp:WssSamlV11Token10/>
+ </wsp:Policy>
+ </sp:SamlToken>
+ </wsp:Policy>
+ </sp:SignedSupportingTokens>
+ </wsp:All>
+ </wsp:ExactlyOne>
+ </wsp:Policy>
+ <!-- 2.3.1.5 (WSS1.0) SAML1.1 Holder of Key, Sign, Optional Encrypt -->
+ <wsp:Policy wsu:Id="SecurityService2315_policy">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <sp:AsymmetricBinding>
+ <wsp:Policy>
+ <sp:InitiatorToken>
+ <wsp:Policy>
+ <sp:SamlToken
+ sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/Al...">
+ <wsp:Policy>
+ <sp:WssSamlV11Token10/>
+ </wsp:Policy>
+ </sp:SamlToken>
+ </wsp:Policy>
+ </sp:InitiatorToken>
+ <sp:RecipientToken>
+ <wsp:Policy>
+ <sp:X509Token
+ sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/Never">
+ <wsp:Policy>
+ <sp:WssX509V3Token10 />
+ </wsp:Policy>
+ </sp:X509Token>
+ </wsp:Policy>
+ </sp:RecipientToken>
+ <sp:AlgorithmSuite>
+ <wsp:Policy>
+ <sp:Basic256/>
+ </wsp:Policy>
+ </sp:AlgorithmSuite>
+ <sp:Layout>
+ <wsp:Policy>
+ <sp:Strict/>
+ </wsp:Policy>
+ </sp:Layout>
+ <sp:IncludeTimestamp/>
+ <sp:OnlySignEntireHeadersAndBody/>
+ </wsp:Policy>
+ </sp:AsymmetricBinding>
+ <sp:Wss10>
+ <wsp:Policy>
+ <sp:MustSupportRefKeyIdentifier/>
+ </wsp:Policy>
+ </sp:Wss10>
+ </wsp:All>
+ </wsp:ExactlyOne>
+ </wsp:Policy>
+
+ <wsp:Policy wsu:Id="Input_Policy">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <sp:EncryptedParts wsp:Optional="true">
+ <sp:Body/>
+ </sp:EncryptedParts>
+ <sp:SignedParts>
+ <sp:Body/>
+ </sp:SignedParts>
+ </wsp:All>
+ </wsp:ExactlyOne>
+ </wsp:Policy>
+ <wsp:Policy wsu:Id="Output_Policy">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <sp:EncryptedParts>
+ <sp:Body/>
+ </sp:EncryptedParts>
+ <sp:SignedParts>
+ <sp:Body/>
+ </sp:SignedParts>
+ </wsp:All>
+ </wsp:ExactlyOne>
+ </wsp:Policy>
</wsdl:definitions>
\ No newline at end of file
12 years, 3 months