JBossWS SVN: r12231 - spi/trunk/src/main/java/org/jboss/wsf/spi/tools/ant.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2010-05-14 02:53:26 -0400 (Fri, 14 May 2010)
New Revision: 12231
Added:
spi/trunk/src/main/java/org/jboss/wsf/spi/tools/ant/AntTaskHelper.java
Modified:
spi/trunk/src/main/java/org/jboss/wsf/spi/tools/ant/WSConsumeTask.java
spi/trunk/src/main/java/org/jboss/wsf/spi/tools/ant/WSProvideTask.java
Log:
[JBWS-3024] propagate JVM args to JVM system properties in forked ANT tools
Added: spi/trunk/src/main/java/org/jboss/wsf/spi/tools/ant/AntTaskHelper.java
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/tools/ant/AntTaskHelper.java (rev 0)
+++ spi/trunk/src/main/java/org/jboss/wsf/spi/tools/ant/AntTaskHelper.java 2010-05-14 06:53:26 UTC (rev 12231)
@@ -0,0 +1,93 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.wsf.spi.tools.ant;
+
+import org.apache.tools.ant.types.CommandlineJava.SysProperties;
+import org.apache.tools.ant.types.Environment.Variable;
+
+/**
+ * Helper class for ANT tasks.
+ *
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ */
+final class AntTaskHelper
+{
+ /**
+ * Constructor.
+ */
+ private AntTaskHelper()
+ {
+ // forbidden constructor
+ }
+
+ /**
+ * Converts array of JVM arguments to ANT SysProperties object.
+ *
+ * @param arguments to be converted.
+ * @return ANT SysProperties object.
+ */
+ static SysProperties toSystemProperties(final String[] arguments)
+ {
+ final SysProperties retVal = new SysProperties();
+
+ if (arguments != null && arguments.length != 0)
+ {
+ for (final String argument : arguments)
+ {
+ if (argument.startsWith("-D"))
+ {
+ Variable var = AntTaskHelper.toVariable(argument);
+ retVal.addVariable(var);
+ }
+ }
+ }
+
+ return retVal;
+ }
+
+ /**
+ * Converts JVM property of format -Dkey=value to ANT Variable object.
+ *
+ * @param argument to be converted
+ * @return ANT Variable object
+ */
+ private static Variable toVariable(final String argument)
+ {
+ final Variable retVal = new Variable();
+ final int equalSignIndex = argument.indexOf('=');
+
+ if (equalSignIndex == -1)
+ {
+ final String key = argument.substring(2);
+ retVal.setKey(key);
+ }
+ else
+ {
+ final String key = argument.substring(2, equalSignIndex);
+ retVal.setKey(key);
+ final String value = argument.substring(equalSignIndex + 1);
+ retVal.setValue(value);
+ }
+
+ return retVal;
+ }
+}
Modified: spi/trunk/src/main/java/org/jboss/wsf/spi/tools/ant/WSConsumeTask.java
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/tools/ant/WSConsumeTask.java 2010-05-13 18:32:02 UTC (rev 12230)
+++ spi/trunk/src/main/java/org/jboss/wsf/spi/tools/ant/WSConsumeTask.java 2010-05-14 06:53:26 UTC (rev 12231)
@@ -37,6 +37,7 @@
import org.apache.tools.ant.types.CommandlineJava;
import org.apache.tools.ant.types.FileSet;
import org.apache.tools.ant.types.Path;
+import org.apache.tools.ant.types.CommandlineJava.SysProperties;
import org.jboss.wsf.spi.tools.WSContractConsumer;
/**
@@ -75,6 +76,7 @@
* </pre>
*
* @author <a href="mailto:jason.greene@jboss.com">Jason T. Greene</a>
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
*/
public class WSConsumeTask extends Task
{
@@ -343,6 +345,12 @@
ExecuteJava execute = new ExecuteJava();
execute.setClasspath(path);
execute.setJavaCommand(command.getJavaCommand());
+
+ // propagate system properties (useful e.g. for endorsing)
+ String[] arguments = command.getVmCommand().getArguments();
+ SysProperties properties = AntTaskHelper.toSystemProperties(arguments);
+ execute.setSystemProperties(properties);
+
if (execute.fork(this) != 0)
throw new BuildException("Could not invoke WSConsumeTask", getLocation());
}
Modified: spi/trunk/src/main/java/org/jboss/wsf/spi/tools/ant/WSProvideTask.java
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/tools/ant/WSProvideTask.java 2010-05-13 18:32:02 UTC (rev 12230)
+++ spi/trunk/src/main/java/org/jboss/wsf/spi/tools/ant/WSProvideTask.java 2010-05-14 06:53:26 UTC (rev 12231)
@@ -31,6 +31,8 @@
import org.apache.tools.ant.types.CommandlineJava;
import org.apache.tools.ant.types.Path;
import org.apache.tools.ant.types.Reference;
+import org.apache.tools.ant.types.CommandlineJava.SysProperties;
+import org.apache.tools.ant.types.Environment.Variable;
import org.jboss.wsf.spi.tools.WSContractProvider;
import java.io.File;
@@ -317,7 +319,12 @@
ExecuteJava execute = new ExecuteJava();
execute.setClasspath(path);
execute.setJavaCommand(command.getJavaCommand());
-
+
+ // propagate system properties (useful e.g. for endorsing)
+ String[] arguments = command.getVmCommand().getArguments();
+ SysProperties properties = AntTaskHelper.toSystemProperties(arguments);
+ execute.setSystemProperties(properties);
+
if (execute.fork(this) != 0)
throw new BuildException("Could not invoke WSProvideTask", getLocation());
}
14 years, 7 months
JBossWS SVN: r12230 - stack/cxf/branches/jbossws-cxf-3.1.2/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2010-05-13 14:32:02 -0400 (Thu, 13 May 2010)
New Revision: 12230
Modified:
stack/cxf/branches/jbossws-cxf-3.1.2/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ServiceObjectFactory.java
stack/cxf/branches/jbossws-cxf-3.1.2/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ServiceRefStubPropertyConfigurer.java
Log:
[JBPAPP-4309] Cleaning default Bus in ServiceObjectFactory and improving port match in ServiceRefStubPropertyConfigurer
Modified: stack/cxf/branches/jbossws-cxf-3.1.2/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ServiceObjectFactory.java
===================================================================
--- stack/cxf/branches/jbossws-cxf-3.1.2/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ServiceObjectFactory.java 2010-05-13 18:31:54 UTC (rev 12229)
+++ stack/cxf/branches/jbossws-cxf-3.1.2/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ServiceObjectFactory.java 2010-05-13 18:32:02 UTC (rev 12230)
@@ -100,7 +100,7 @@
UnifiedServiceRefMetaData serviceRef = unmarshallServiceRef(ref);
//Reset bus before constructing Service
- BusFactory.setThreadDefaultBus(null);
+ BusFactory.setDefaultBus(null);
Bus bus = BusFactory.getThreadDefaultBus();
//Add extension to configure stub properties using the UnifiedServiceRefMetaData
Configurer configurer = bus.getExtension(Configurer.class);
Modified: stack/cxf/branches/jbossws-cxf-3.1.2/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ServiceRefStubPropertyConfigurer.java
===================================================================
--- stack/cxf/branches/jbossws-cxf-3.1.2/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ServiceRefStubPropertyConfigurer.java 2010-05-13 18:31:54 UTC (rev 12229)
+++ stack/cxf/branches/jbossws-cxf-3.1.2/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ServiceRefStubPropertyConfigurer.java 2010-05-13 18:32:02 UTC (rev 12230)
@@ -24,8 +24,11 @@
import java.util.HashMap;
import java.util.Map;
+import javax.xml.namespace.QName;
+
import org.apache.cxf.configuration.Configurer;
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
+import org.jboss.logging.Logger;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedPortComponentRefMetaData;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedServiceRefMetaData;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedStubPropertyMetaData;
@@ -49,10 +52,6 @@
public void configureBean(Object beanInstance)
{
- if (beanInstance instanceof JaxWsProxyFactoryBean)
- {
- configureJaxWsProxyFactoryBean((JaxWsProxyFactoryBean)beanInstance);
- }
if (delegate != null)
{
delegate.configureBean(beanInstance);
@@ -61,9 +60,19 @@
public void configureBean(String name, Object beanInstance)
{
- if (beanInstance instanceof JaxWsProxyFactoryBean)
+ if (name != null && beanInstance instanceof JaxWsProxyFactoryBean)
{
- configureJaxWsProxyFactoryBean((JaxWsProxyFactoryBean)beanInstance);
+ QName portQName = null;
+ try
+ {
+ String portName = name.substring(0, name.indexOf(".jaxws-client.proxyFactory"));
+ portQName = QName.valueOf(portName);
+ }
+ catch (Exception e)
+ {
+ Logger.getLogger(this.getClass()).warn("Unable to retrieve port QName from '" + name + "', trying matching port using endpoint interface name only.");
+ }
+ configureJaxWsProxyFactoryBean(portQName, (JaxWsProxyFactoryBean)beanInstance);
}
if (delegate != null)
{
@@ -71,21 +80,28 @@
}
}
- private synchronized void configureJaxWsProxyFactoryBean(JaxWsProxyFactoryBean proxyFactory)
+ private synchronized void configureJaxWsProxyFactoryBean(QName portQName, JaxWsProxyFactoryBean proxyFactory)
{
- Map<String, Object> properties = new HashMap<String, Object>();
- for (UnifiedPortComponentRefMetaData pcRef : serviceRefMD.getPortComponentRefs())
+ Class<?> clazz = proxyFactory.getServiceClass();
+ UnifiedPortComponentRefMetaData upcmd = serviceRefMD.getPortComponentRef(clazz != null ? clazz.getName() : null, portQName);
+ if (upcmd != null)
{
- String sei = pcRef.getServiceEndpointInterface();
- if (sei != null && sei.equals(proxyFactory.getServiceClass().getName()))
- {
- for (UnifiedStubPropertyMetaData prop : pcRef.getStubProperties())
- {
- properties.put(prop.getPropName(), prop.getPropValue());
- }
- }
+ setProperties(proxyFactory, upcmd);
}
- proxyFactory.setProperties(properties);
}
+
+ private void setProperties(JaxWsProxyFactoryBean proxyFactory, UnifiedPortComponentRefMetaData upcmd)
+ {
+ Map<String, Object> properties = proxyFactory.getProperties();
+ if (properties == null)
+ {
+ properties = new HashMap<String, Object>();
+ proxyFactory.setProperties(properties);
+ }
+ for (UnifiedStubPropertyMetaData prop : upcmd.getStubProperties())
+ {
+ properties.put(prop.getPropName(), prop.getPropValue());
+ }
+ }
}
14 years, 7 months
JBossWS SVN: r12229 - in framework/branches/jbossws-framework-3.1.2/testsuite/test: java/org/jboss/test/ws/jaxws/samples and 5 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2010-05-13 14:31:54 -0400 (Thu, 13 May 2010)
New Revision: 12229
Added:
framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/
framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/Client.java
framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/Endpoint.java
framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/EndpointImpl.java
framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/EndpointService.java
framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/WebServiceRefSecTestCase.java
framework/branches/jbossws-framework-3.1.2/testsuite/test/resources/jaxws/samples/webservicerefsec/
framework/branches/jbossws-framework-3.1.2/testsuite/test/resources/jaxws/samples/webservicerefsec/WEB-INF/
framework/branches/jbossws-framework-3.1.2/testsuite/test/resources/jaxws/samples/webservicerefsec/WEB-INF/jboss-web.xml
framework/branches/jbossws-framework-3.1.2/testsuite/test/resources/jaxws/samples/webservicerefsec/WEB-INF/web.xml
framework/branches/jbossws-framework-3.1.2/testsuite/test/resources/jaxws/samples/webservicerefsec/WEB-INF/wsdl/
framework/branches/jbossws-framework-3.1.2/testsuite/test/resources/jaxws/samples/webservicerefsec/WEB-INF/wsdl/Endpoint.wsdl
Removed:
framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/Client.java
framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/Endpoint.java
framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/EndpointImpl.java
framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/EndpointService.java
framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/WebServiceRefSecTestCase.java
framework/branches/jbossws-framework-3.1.2/testsuite/test/resources/jaxws/samples/webservicerefsec/WEB-INF/
framework/branches/jbossws-framework-3.1.2/testsuite/test/resources/jaxws/samples/webservicerefsec/WEB-INF/jboss-web.xml
framework/branches/jbossws-framework-3.1.2/testsuite/test/resources/jaxws/samples/webservicerefsec/WEB-INF/web.xml
framework/branches/jbossws-framework-3.1.2/testsuite/test/resources/jaxws/samples/webservicerefsec/WEB-INF/wsdl/
framework/branches/jbossws-framework-3.1.2/testsuite/test/resources/jaxws/samples/webservicerefsec/WEB-INF/wsdl/Endpoint.wsdl
Modified:
framework/branches/jbossws-framework-3.1.2/testsuite/test/ant-import/build-samples-jaxws.xml
Log:
[JBPAPP-4309] Adding testcase with multiple webservicerefs using the same service/port with different security credentials
Modified: framework/branches/jbossws-framework-3.1.2/testsuite/test/ant-import/build-samples-jaxws.xml
===================================================================
--- framework/branches/jbossws-framework-3.1.2/testsuite/test/ant-import/build-samples-jaxws.xml 2010-05-13 15:38:57 UTC (rev 12228)
+++ framework/branches/jbossws-framework-3.1.2/testsuite/test/ant-import/build-samples-jaxws.xml 2010-05-13 18:31:54 UTC (rev 12229)
@@ -408,6 +408,25 @@
<include name="wsdl/**"/>
</metainf>
</jar>
+
+ <!-- jaxws-samples-webservicerefsec -->
+ <jar destfile="${tests.output.dir}/test-libs/jaxws-samples-webservicerefsec.jar">
+ <fileset dir="${tests.output.dir}/test-classes">
+ <include name="org/jboss/test/ws/jaxws/samples/webservicerefsec/EndpointImpl.class" />
+ </fileset>
+ </jar>
+ <war destfile="${tests.output.dir}/test-libs/jaxws-samples-webservicerefsec-servlet-client.war"
+ webxml="${tests.output.dir}/test-resources/jaxws/samples/webservicerefsec/WEB-INF/web.xml">
+ <classes dir="${tests.output.dir}/test-classes">
+ <include name="org/jboss/test/ws/jaxws/samples/webservicerefsec/Client.class" />
+ <include name="org/jboss/test/ws/jaxws/samples/webservicerefsec/Endpoint.class" />
+ <include name="org/jboss/test/ws/jaxws/samples/webservicerefsec/EndpointService.class" />
+ </classes>
+ <webinf dir="${tests.output.dir}/test-resources/jaxws/samples/webservicerefsec/WEB-INF">
+ <include name="wsdl/**"/>
+ <include name="jboss-web.xml"/>
+ </webinf>
+ </war>
<!-- jaxws-samples-xop-doclit -->
<war jarfile="${tests.output.dir}/test-libs/jaxws-samples-xop-doclit.war" webxml="${tests.output.dir}/test-resources/jaxws/samples/xop/doclit/WEB-INF/web.xml">
Copied: framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec (from rev 12222, framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec)
Deleted: framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/Client.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/Client.java 2010-05-13 08:23:30 UTC (rev 12222)
+++ framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/Client.java 2010-05-13 18:31:54 UTC (rev 12229)
@@ -1,82 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2010, 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.webservicerefsec;
-
-import java.io.IOException;
-
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.xml.ws.BindingProvider;
-import javax.xml.ws.WebServiceException;
-import javax.xml.ws.WebServiceRef;
-
-import org.jboss.logging.Logger;
-
-public class Client extends HttpServlet
-{
- private static final long serialVersionUID = -5930858947901509123L;
-
- // Provide logging
- private static Logger log = Logger.getLogger(Client.class);
-
- @WebServiceRef
- static EndpointService authorizedService;
-
- @WebServiceRef
- static EndpointService unauthorizedService;
-
-
- @Override
- protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
- {
- String inStr = req.getParameter("echo");
- log.info("doGet: " + inStr);
-
- String outStr = null;
- Endpoint ep = authorizedService.getPort(Endpoint.class);
- log.info("Performing invocation with username: " + ((BindingProvider) ep).getRequestContext().get(BindingProvider.USERNAME_PROPERTY));
- outStr = ep.echo(inStr);
- if (inStr.equals(outStr) == false)
- throw new WebServiceException("Invalid echo return: " + inStr);
-
- boolean invokationSucceeded = false;
- try
- {
- Endpoint uep = unauthorizedService.getPort(Endpoint.class);
- log.info("Performing invocation with username: " + ((BindingProvider) uep).getRequestContext().get(BindingProvider.USERNAME_PROPERTY));
- uep.echo(inStr);
- invokationSucceeded = true;
- }
- catch (Exception e)
- {
- log.info(e);
- }
- if (invokationSucceeded)
- {
- throw new RuntimeException("Expected exception!");
- }
-
- res.getWriter().print(outStr);
- }
-}
Copied: framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/Client.java (from rev 12222, framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/Client.java)
===================================================================
--- framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/Client.java (rev 0)
+++ framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/Client.java 2010-05-13 18:31:54 UTC (rev 12229)
@@ -0,0 +1,82 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.webservicerefsec;
+
+import java.io.IOException;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.WebServiceRef;
+
+import org.jboss.logging.Logger;
+
+public class Client extends HttpServlet
+{
+ private static final long serialVersionUID = -5930858947901509123L;
+
+ // Provide logging
+ private static Logger log = Logger.getLogger(Client.class);
+
+ @WebServiceRef
+ static EndpointService authorizedService;
+
+ @WebServiceRef
+ static EndpointService unauthorizedService;
+
+
+ @Override
+ protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
+ {
+ String inStr = req.getParameter("echo");
+ log.info("doGet: " + inStr);
+
+ String outStr = null;
+ Endpoint ep = authorizedService.getPort(Endpoint.class);
+ log.info("Performing invocation with username: " + ((BindingProvider) ep).getRequestContext().get(BindingProvider.USERNAME_PROPERTY));
+ outStr = ep.echo(inStr);
+ if (inStr.equals(outStr) == false)
+ throw new WebServiceException("Invalid echo return: " + inStr);
+
+ boolean invokationSucceeded = false;
+ try
+ {
+ Endpoint uep = unauthorizedService.getPort(Endpoint.class);
+ log.info("Performing invocation with username: " + ((BindingProvider) uep).getRequestContext().get(BindingProvider.USERNAME_PROPERTY));
+ uep.echo(inStr);
+ invokationSucceeded = true;
+ }
+ catch (Exception e)
+ {
+ log.info(e);
+ }
+ if (invokationSucceeded)
+ {
+ throw new RuntimeException("Expected exception!");
+ }
+
+ res.getWriter().print(outStr);
+ }
+}
Deleted: framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/Endpoint.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/Endpoint.java 2010-05-13 08:23:30 UTC (rev 12222)
+++ framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/Endpoint.java 2010-05-13 18:31:54 UTC (rev 12229)
@@ -1,55 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2010, 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.webservicerefsec;
-
-import javax.jws.WebMethod;
-import javax.jws.WebParam;
-import javax.jws.WebResult;
-import javax.jws.WebService;
-import javax.jws.soap.SOAPBinding;
-import javax.jws.soap.SOAPBinding.Style;
-
-
-/**
- * This class was generated by the JAXWS SI.
- * JAX-WS RI 2.0-b26-ea3
- * Generated source version: 2.0
- *
- */
-@WebService(name = "Endpoint", targetNamespace = "http://org.jboss.ws/wsref", wsdlLocation = "http://localhost.localdomain:8080/jaxws-samples-webservicerefsec?wsdl")
-@SOAPBinding(style = Style.RPC)
-public interface Endpoint {
-
-
- /**
- *
- * @param arg0
- * @return
- * returns java.lang.String
- */
- @WebMethod
- @WebResult(targetNamespace = "http://org.jboss.ws/wsref", partName = "return")
- public String echo(
- @WebParam(name = "arg0", partName = "arg0")
- String arg0);
-
-}
Copied: framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/Endpoint.java (from rev 12222, framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/Endpoint.java)
===================================================================
--- framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/Endpoint.java (rev 0)
+++ framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/Endpoint.java 2010-05-13 18:31:54 UTC (rev 12229)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.webservicerefsec;
+
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebResult;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+import javax.jws.soap.SOAPBinding.Style;
+
+
+/**
+ * This class was generated by the JAXWS SI.
+ * JAX-WS RI 2.0-b26-ea3
+ * Generated source version: 2.0
+ *
+ */
+@WebService(name = "Endpoint", targetNamespace = "http://org.jboss.ws/wsref", wsdlLocation = "http://localhost.localdomain:8080/jaxws-samples-webservicerefsec?wsdl")
+@SOAPBinding(style = Style.RPC)
+public interface Endpoint {
+
+
+ /**
+ *
+ * @param arg0
+ * @return
+ * returns java.lang.String
+ */
+ @WebMethod
+ @WebResult(targetNamespace = "http://org.jboss.ws/wsref", partName = "return")
+ public String echo(
+ @WebParam(name = "arg0", partName = "arg0")
+ String arg0);
+
+}
Deleted: framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/EndpointImpl.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/EndpointImpl.java 2010-05-13 08:23:30 UTC (rev 12222)
+++ framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/EndpointImpl.java 2010-05-13 18:31:54 UTC (rev 12229)
@@ -1,62 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2010, 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.webservicerefsec;
-
-import javax.jws.WebMethod;
-import javax.jws.WebService;
-import javax.jws.soap.SOAPBinding;
-import javax.jws.soap.SOAPBinding.Style;
-
-import org.jboss.ejb3.annotation.SecurityDomain;
-import org.jboss.logging.Logger;
-import org.jboss.wsf.spi.annotation.AuthMethod;
-import org.jboss.wsf.spi.annotation.TransportGuarantee;
-import org.jboss.wsf.spi.annotation.WebContext;
-
-import javax.annotation.security.RolesAllowed;
-import javax.ejb.Stateless;
-
-@WebService(name = "Endpoint", serviceName = "EndpointService", targetNamespace = "http://org.jboss.ws/wsref")
-@SOAPBinding(style = Style.RPC)
-@Stateless(name = "webservicerefSecTest")
-@WebContext
-(
- contextRoot = "/jaxws-samples-webservicerefsec",
- urlPattern = "/*",
- authMethod = AuthMethod.BASIC,
- transportGuarantee = TransportGuarantee.NONE,
- secureWSDLAccess = false
-)
-@SecurityDomain("JBossWS")
-public class EndpointImpl
-{
- // Provide logging
- private static Logger log = Logger.getLogger(EndpointImpl.class);
-
- @WebMethod
- @RolesAllowed("friend")
- public String echo(String input)
- {
- log.info(input);
- return input;
- }
-}
Copied: framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/EndpointImpl.java (from rev 12222, framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/EndpointImpl.java)
===================================================================
--- framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/EndpointImpl.java (rev 0)
+++ framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/EndpointImpl.java 2010-05-13 18:31:54 UTC (rev 12229)
@@ -0,0 +1,62 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.webservicerefsec;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+import javax.jws.soap.SOAPBinding.Style;
+
+import org.jboss.ejb3.annotation.SecurityDomain;
+import org.jboss.logging.Logger;
+import org.jboss.wsf.spi.annotation.AuthMethod;
+import org.jboss.wsf.spi.annotation.TransportGuarantee;
+import org.jboss.wsf.spi.annotation.WebContext;
+
+import javax.annotation.security.RolesAllowed;
+import javax.ejb.Stateless;
+
+@WebService(name = "Endpoint", serviceName = "EndpointService", targetNamespace = "http://org.jboss.ws/wsref")
+@SOAPBinding(style = Style.RPC)
+@Stateless(name = "webservicerefSecTest")
+@WebContext
+(
+ contextRoot = "/jaxws-samples-webservicerefsec",
+ urlPattern = "/*",
+ authMethod = AuthMethod.BASIC,
+ transportGuarantee = TransportGuarantee.NONE,
+ secureWSDLAccess = false
+)
+@SecurityDomain("JBossWS")
+public class EndpointImpl
+{
+ // Provide logging
+ private static Logger log = Logger.getLogger(EndpointImpl.class);
+
+ @WebMethod
+ @RolesAllowed("friend")
+ public String echo(String input)
+ {
+ log.info(input);
+ return input;
+ }
+}
Deleted: framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/EndpointService.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/EndpointService.java 2010-05-13 08:23:30 UTC (rev 12222)
+++ framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/EndpointService.java 2010-05-13 18:31:54 UTC (rev 12229)
@@ -1,108 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2010, 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.webservicerefsec;
-
-import java.net.URL;
-
-import javax.xml.namespace.QName;
-import javax.xml.ws.Service;
-import javax.xml.ws.WebEndpoint;
-import javax.xml.ws.WebServiceClient;
-import javax.xml.ws.WebServiceException;
-import javax.xml.ws.WebServiceFeature;
-
-/**
- * This class was generated by the JAX-WS RI.
- * JAX-WS RI 2.2-12/14/2009 02:16 PM(ramkris)-
- * Generated source version: 2.2
- *
- */
-@WebServiceClient(name = "EndpointService", targetNamespace = "http://org.jboss.ws/wsref", wsdlLocation = "META-INF/wsdl/Endpoint.wsdl")
-public class EndpointService extends Service
-{
-
- private final static URL ENDPOINTSERVICE_WSDL_LOCATION;
- private final static WebServiceException ENDPOINTSERVICE_EXCEPTION;
- private final static QName ENDPOINTSERVICE_QNAME = new QName("http://org.jboss.ws/wsref", "EndpointService");
-
- static
- {
- URL url = null;
- WebServiceException e = null;
- url = EndpointService.class.getResource("bogusAddress"); //invalid address on purpose
- if (url == null)
- {
- e = new WebServiceException("Cannot find wsdl, please put in classpath");
- }
- ENDPOINTSERVICE_WSDL_LOCATION = url;
- ENDPOINTSERVICE_EXCEPTION = e;
- }
-
- public EndpointService()
- {
- super(__getWsdlLocation(), ENDPOINTSERVICE_QNAME);
- }
-
- public EndpointService(URL wsdlLocation)
- {
- super(wsdlLocation, ENDPOINTSERVICE_QNAME);
- }
-
- public EndpointService(URL wsdlLocation, QName serviceName)
- {
- super(wsdlLocation, serviceName);
- }
-
- /**
- *
- * @return
- * returns Endpoint
- */
- @WebEndpoint(name = "EndpointPort")
- public Endpoint getEndpointPort()
- {
- return super.getPort(new QName("http://org.jboss.ws/wsref", "EndpointPort"), Endpoint.class);
- }
-
- /**
- *
- * @param features
- * A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy. Supported features not in the <code>features</code> parameter will have their default values.
- * @return
- * returns Endpoint
- */
- @WebEndpoint(name = "EndpointPort")
- public Endpoint getEndpointPort(WebServiceFeature... features)
- {
- return super.getPort(new QName("http://org.jboss.ws/wsref", "EndpointPort"), Endpoint.class, features);
- }
-
- private static URL __getWsdlLocation()
- {
- if (ENDPOINTSERVICE_EXCEPTION != null)
- {
- throw ENDPOINTSERVICE_EXCEPTION;
- }
- return ENDPOINTSERVICE_WSDL_LOCATION;
- }
-
-}
Copied: framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/EndpointService.java (from rev 12222, framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/EndpointService.java)
===================================================================
--- framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/EndpointService.java (rev 0)
+++ framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/EndpointService.java 2010-05-13 18:31:54 UTC (rev 12229)
@@ -0,0 +1,108 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.webservicerefsec;
+
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+import javax.xml.ws.WebEndpoint;
+import javax.xml.ws.WebServiceClient;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.WebServiceFeature;
+
+/**
+ * This class was generated by the JAX-WS RI.
+ * JAX-WS RI 2.2-12/14/2009 02:16 PM(ramkris)-
+ * Generated source version: 2.2
+ *
+ */
+@WebServiceClient(name = "EndpointService", targetNamespace = "http://org.jboss.ws/wsref", wsdlLocation = "META-INF/wsdl/Endpoint.wsdl")
+public class EndpointService extends Service
+{
+
+ private final static URL ENDPOINTSERVICE_WSDL_LOCATION;
+ private final static WebServiceException ENDPOINTSERVICE_EXCEPTION;
+ private final static QName ENDPOINTSERVICE_QNAME = new QName("http://org.jboss.ws/wsref", "EndpointService");
+
+ static
+ {
+ URL url = null;
+ WebServiceException e = null;
+ url = EndpointService.class.getResource("bogusAddress"); //invalid address on purpose
+ if (url == null)
+ {
+ e = new WebServiceException("Cannot find wsdl, please put in classpath");
+ }
+ ENDPOINTSERVICE_WSDL_LOCATION = url;
+ ENDPOINTSERVICE_EXCEPTION = e;
+ }
+
+ public EndpointService()
+ {
+ super(__getWsdlLocation(), ENDPOINTSERVICE_QNAME);
+ }
+
+ public EndpointService(URL wsdlLocation)
+ {
+ super(wsdlLocation, ENDPOINTSERVICE_QNAME);
+ }
+
+ public EndpointService(URL wsdlLocation, QName serviceName)
+ {
+ super(wsdlLocation, serviceName);
+ }
+
+ /**
+ *
+ * @return
+ * returns Endpoint
+ */
+ @WebEndpoint(name = "EndpointPort")
+ public Endpoint getEndpointPort()
+ {
+ return super.getPort(new QName("http://org.jboss.ws/wsref", "EndpointPort"), Endpoint.class);
+ }
+
+ /**
+ *
+ * @param features
+ * A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy. Supported features not in the <code>features</code> parameter will have their default values.
+ * @return
+ * returns Endpoint
+ */
+ @WebEndpoint(name = "EndpointPort")
+ public Endpoint getEndpointPort(WebServiceFeature... features)
+ {
+ return super.getPort(new QName("http://org.jboss.ws/wsref", "EndpointPort"), Endpoint.class, features);
+ }
+
+ private static URL __getWsdlLocation()
+ {
+ if (ENDPOINTSERVICE_EXCEPTION != null)
+ {
+ throw ENDPOINTSERVICE_EXCEPTION;
+ }
+ return ENDPOINTSERVICE_WSDL_LOCATION;
+ }
+
+}
Deleted: framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/WebServiceRefSecTestCase.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/WebServiceRefSecTestCase.java 2010-05-13 08:23:30 UTC (rev 12222)
+++ framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/WebServiceRefSecTestCase.java 2010-05-13 18:31:54 UTC (rev 12229)
@@ -1,63 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2010, 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.webservicerefsec;
-
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
-import java.net.URL;
-
-import junit.framework.Test;
-
-import org.jboss.wsf.test.JBossWSTest;
-import org.jboss.wsf.test.JBossWSTestSetup;
-
-/**
- * Test multiple webserviceref fro the same endpoint with different security credentials
- *
- * @author alessio.soldano(a)jboss.com
- * @since 12-May-2010
- */
-public class WebServiceRefSecTestCase extends JBossWSTest
-{
- public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() + ":8080/jaxws-samples-webservicerefsec";
-
- public static Test suite()
- {
- return new JBossWSTestSetup(WebServiceRefSecTestCase.class, "jaxws-samples-webservicerefsec.jar");
- }
-
- public void testServletClient() throws Exception
- {
- deploy("jaxws-samples-webservicerefsec-servlet-client.war");
- try
- {
- URL url = new URL(TARGET_ENDPOINT_ADDRESS + "-servlet-client?echo=HelloWorld");
- BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
- String retStr = br.readLine();
- assertEquals("HelloWorld", retStr);
- }
- finally
- {
- undeploy("jaxws-samples-webservicerefsec-servlet-client.war");
- }
- }
-}
Copied: framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/WebServiceRefSecTestCase.java (from rev 12222, framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/WebServiceRefSecTestCase.java)
===================================================================
--- framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/WebServiceRefSecTestCase.java (rev 0)
+++ framework/branches/jbossws-framework-3.1.2/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/WebServiceRefSecTestCase.java 2010-05-13 18:31:54 UTC (rev 12229)
@@ -0,0 +1,63 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.webservicerefsec;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.net.URL;
+
+import junit.framework.Test;
+
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+
+/**
+ * Test multiple webserviceref fro the same endpoint with different security credentials
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 12-May-2010
+ */
+public class WebServiceRefSecTestCase extends JBossWSTest
+{
+ public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() + ":8080/jaxws-samples-webservicerefsec";
+
+ public static Test suite()
+ {
+ return new JBossWSTestSetup(WebServiceRefSecTestCase.class, "jaxws-samples-webservicerefsec.jar");
+ }
+
+ public void testServletClient() throws Exception
+ {
+ deploy("jaxws-samples-webservicerefsec-servlet-client.war");
+ try
+ {
+ URL url = new URL(TARGET_ENDPOINT_ADDRESS + "-servlet-client?echo=HelloWorld");
+ BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
+ String retStr = br.readLine();
+ assertEquals("HelloWorld", retStr);
+ }
+ finally
+ {
+ undeploy("jaxws-samples-webservicerefsec-servlet-client.war");
+ }
+ }
+}
Copied: framework/branches/jbossws-framework-3.1.2/testsuite/test/resources/jaxws/samples/webservicerefsec (from rev 12222, framework/trunk/testsuite/test/resources/jaxws/samples/webservicerefsec)
Copied: framework/branches/jbossws-framework-3.1.2/testsuite/test/resources/jaxws/samples/webservicerefsec/WEB-INF (from rev 12222, framework/trunk/testsuite/test/resources/jaxws/samples/webservicerefsec/WEB-INF)
Deleted: framework/branches/jbossws-framework-3.1.2/testsuite/test/resources/jaxws/samples/webservicerefsec/WEB-INF/jboss-web.xml
===================================================================
--- framework/trunk/testsuite/test/resources/jaxws/samples/webservicerefsec/WEB-INF/jboss-web.xml 2010-05-13 08:23:30 UTC (rev 12222)
+++ framework/branches/jbossws-framework-3.1.2/testsuite/test/resources/jaxws/samples/webservicerefsec/WEB-INF/jboss-web.xml 2010-05-13 18:31:54 UTC (rev 12229)
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 5.0//EN" "http://www.jboss.org/j2ee/dtd/jboss-web_5_0.dtd">
-
-<jboss-web>
-
- <service-ref>
- <service-ref-name>org.jboss.test.ws.jaxws.samples.webservicerefsec.Client/authorizedService</service-ref-name>
- <service-qname>{http://org.jboss.ws/wsref}EndpointService</service-qname>
- <port-component-ref>
- <service-endpoint-interface>org.jboss.test.ws.jaxws.samples.webservicerefsec.Endpoint</service-endpoint-interface>
- <port-qname>{http://org.jboss.ws/wsref}EndpointPort</port-qname>
- <stub-property>
- <prop-name>javax.xml.ws.security.auth.username</prop-name>
- <prop-value>kermit</prop-value>
- </stub-property>
- <stub-property>
- <prop-name>javax.xml.ws.security.auth.password</prop-name>
- <prop-value>thefrog</prop-value>
- </stub-property>
- </port-component-ref>
- <wsdl-override>WEB-INF/wsdl/Endpoint.wsdl</wsdl-override>
- </service-ref>
-
- <service-ref>
- <service-ref-name>org.jboss.test.ws.jaxws.samples.webservicerefsec.Client/unauthorizedService</service-ref-name>
- <service-qname>{http://org.jboss.ws/wsref}EndpointService</service-qname>
- <port-component-ref>
- <service-endpoint-interface>org.jboss.test.ws.jaxws.samples.webservicerefsec.Endpoint</service-endpoint-interface>
- <port-qname>{http://org.jboss.ws/wsref}EndpointPort</port-qname>
- <stub-property>
- <prop-name>javax.xml.ws.security.auth.username</prop-name>
- <prop-value>foo</prop-value>
- </stub-property>
- <stub-property>
- <prop-name>javax.xml.ws.security.auth.password</prop-name>
- <prop-value>bar</prop-value>
- </stub-property>
- </port-component-ref>
- <wsdl-override>WEB-INF/wsdl/Endpoint.wsdl</wsdl-override>
- </service-ref>
-
-</jboss-web>
\ No newline at end of file
Copied: framework/branches/jbossws-framework-3.1.2/testsuite/test/resources/jaxws/samples/webservicerefsec/WEB-INF/jboss-web.xml (from rev 12222, framework/trunk/testsuite/test/resources/jaxws/samples/webservicerefsec/WEB-INF/jboss-web.xml)
===================================================================
--- framework/branches/jbossws-framework-3.1.2/testsuite/test/resources/jaxws/samples/webservicerefsec/WEB-INF/jboss-web.xml (rev 0)
+++ framework/branches/jbossws-framework-3.1.2/testsuite/test/resources/jaxws/samples/webservicerefsec/WEB-INF/jboss-web.xml 2010-05-13 18:31:54 UTC (rev 12229)
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 5.0//EN" "http://www.jboss.org/j2ee/dtd/jboss-web_5_0.dtd">
+
+<jboss-web>
+
+ <service-ref>
+ <service-ref-name>org.jboss.test.ws.jaxws.samples.webservicerefsec.Client/authorizedService</service-ref-name>
+ <service-qname>{http://org.jboss.ws/wsref}EndpointService</service-qname>
+ <port-component-ref>
+ <service-endpoint-interface>org.jboss.test.ws.jaxws.samples.webservicerefsec.Endpoint</service-endpoint-interface>
+ <port-qname>{http://org.jboss.ws/wsref}EndpointPort</port-qname>
+ <stub-property>
+ <prop-name>javax.xml.ws.security.auth.username</prop-name>
+ <prop-value>kermit</prop-value>
+ </stub-property>
+ <stub-property>
+ <prop-name>javax.xml.ws.security.auth.password</prop-name>
+ <prop-value>thefrog</prop-value>
+ </stub-property>
+ </port-component-ref>
+ <wsdl-override>WEB-INF/wsdl/Endpoint.wsdl</wsdl-override>
+ </service-ref>
+
+ <service-ref>
+ <service-ref-name>org.jboss.test.ws.jaxws.samples.webservicerefsec.Client/unauthorizedService</service-ref-name>
+ <service-qname>{http://org.jboss.ws/wsref}EndpointService</service-qname>
+ <port-component-ref>
+ <service-endpoint-interface>org.jboss.test.ws.jaxws.samples.webservicerefsec.Endpoint</service-endpoint-interface>
+ <port-qname>{http://org.jboss.ws/wsref}EndpointPort</port-qname>
+ <stub-property>
+ <prop-name>javax.xml.ws.security.auth.username</prop-name>
+ <prop-value>foo</prop-value>
+ </stub-property>
+ <stub-property>
+ <prop-name>javax.xml.ws.security.auth.password</prop-name>
+ <prop-value>bar</prop-value>
+ </stub-property>
+ </port-component-ref>
+ <wsdl-override>WEB-INF/wsdl/Endpoint.wsdl</wsdl-override>
+ </service-ref>
+
+</jboss-web>
\ No newline at end of file
Deleted: framework/branches/jbossws-framework-3.1.2/testsuite/test/resources/jaxws/samples/webservicerefsec/WEB-INF/web.xml
===================================================================
--- framework/trunk/testsuite/test/resources/jaxws/samples/webservicerefsec/WEB-INF/web.xml 2010-05-13 08:23:30 UTC (rev 12222)
+++ framework/branches/jbossws-framework-3.1.2/testsuite/test/resources/jaxws/samples/webservicerefsec/WEB-INF/web.xml 2010-05-13 18:31:54 UTC (rev 12229)
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd">
-
- <servlet>
- <servlet-name>Client</servlet-name>
- <servlet-class>org.jboss.test.ws.jaxws.samples.webservicerefsec.Client</servlet-class>
- </servlet>
-
- <servlet-mapping>
- <servlet-name>Client</servlet-name>
- <url-pattern>/*</url-pattern>
- </servlet-mapping>
-</web-app>
\ No newline at end of file
Copied: framework/branches/jbossws-framework-3.1.2/testsuite/test/resources/jaxws/samples/webservicerefsec/WEB-INF/web.xml (from rev 12222, framework/trunk/testsuite/test/resources/jaxws/samples/webservicerefsec/WEB-INF/web.xml)
===================================================================
--- framework/branches/jbossws-framework-3.1.2/testsuite/test/resources/jaxws/samples/webservicerefsec/WEB-INF/web.xml (rev 0)
+++ framework/branches/jbossws-framework-3.1.2/testsuite/test/resources/jaxws/samples/webservicerefsec/WEB-INF/web.xml 2010-05-13 18:31:54 UTC (rev 12229)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd">
+
+ <servlet>
+ <servlet-name>Client</servlet-name>
+ <servlet-class>org.jboss.test.ws.jaxws.samples.webservicerefsec.Client</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>Client</servlet-name>
+ <url-pattern>/*</url-pattern>
+ </servlet-mapping>
+</web-app>
\ No newline at end of file
Copied: framework/branches/jbossws-framework-3.1.2/testsuite/test/resources/jaxws/samples/webservicerefsec/WEB-INF/wsdl (from rev 12222, framework/trunk/testsuite/test/resources/jaxws/samples/webservicerefsec/WEB-INF/wsdl)
Deleted: framework/branches/jbossws-framework-3.1.2/testsuite/test/resources/jaxws/samples/webservicerefsec/WEB-INF/wsdl/Endpoint.wsdl
===================================================================
--- framework/trunk/testsuite/test/resources/jaxws/samples/webservicerefsec/WEB-INF/wsdl/Endpoint.wsdl 2010-05-13 08:23:30 UTC (rev 12222)
+++ framework/branches/jbossws-framework-3.1.2/testsuite/test/resources/jaxws/samples/webservicerefsec/WEB-INF/wsdl/Endpoint.wsdl 2010-05-13 18:31:54 UTC (rev 12229)
@@ -1,36 +0,0 @@
-<definitions name='EndpointService' targetNamespace='http://org.jboss.ws/wsref' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://org.jboss.ws/wsref' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
-
- <message name='Endpoint_echo'>
- <part name='arg0' type='xsd:string'/>
- </message>
- <message name='Endpoint_echoResponse'>
- <part name='return' type='xsd:string'/>
- </message>
-
- <portType name='Endpoint'>
- <operation name='echo' parameterOrder='arg0'>
- <input message='tns:Endpoint_echo'/>
- <output message='tns:Endpoint_echoResponse'/>
- </operation>
- </portType>
-
- <binding name='EndpointBinding' type='tns:Endpoint'>
- <soap:binding style='rpc' transport='http://schemas.xmlsoap.org/soap/http'/>
- <operation name='echo'>
- <soap:operation soapAction=''/>
- <input>
- <soap:body namespace='http://org.jboss.ws/wsref' use='literal'/>
- </input>
- <output>
- <soap:body namespace='http://org.jboss.ws/wsref' use='literal'/>
- </output>
- </operation>
- </binding>
-
- <service name='EndpointService'>
- <port binding='tns:EndpointBinding' name='EndpointPort'>
- <soap:address location='http://@jboss.bind.address@:8080/jaxws-samples-webservicerefsec'/>
- </port>
- </service>
-
-</definitions>
Copied: framework/branches/jbossws-framework-3.1.2/testsuite/test/resources/jaxws/samples/webservicerefsec/WEB-INF/wsdl/Endpoint.wsdl (from rev 12222, framework/trunk/testsuite/test/resources/jaxws/samples/webservicerefsec/WEB-INF/wsdl/Endpoint.wsdl)
===================================================================
--- framework/branches/jbossws-framework-3.1.2/testsuite/test/resources/jaxws/samples/webservicerefsec/WEB-INF/wsdl/Endpoint.wsdl (rev 0)
+++ framework/branches/jbossws-framework-3.1.2/testsuite/test/resources/jaxws/samples/webservicerefsec/WEB-INF/wsdl/Endpoint.wsdl 2010-05-13 18:31:54 UTC (rev 12229)
@@ -0,0 +1,36 @@
+<definitions name='EndpointService' targetNamespace='http://org.jboss.ws/wsref' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://org.jboss.ws/wsref' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
+
+ <message name='Endpoint_echo'>
+ <part name='arg0' type='xsd:string'/>
+ </message>
+ <message name='Endpoint_echoResponse'>
+ <part name='return' type='xsd:string'/>
+ </message>
+
+ <portType name='Endpoint'>
+ <operation name='echo' parameterOrder='arg0'>
+ <input message='tns:Endpoint_echo'/>
+ <output message='tns:Endpoint_echoResponse'/>
+ </operation>
+ </portType>
+
+ <binding name='EndpointBinding' type='tns:Endpoint'>
+ <soap:binding style='rpc' transport='http://schemas.xmlsoap.org/soap/http'/>
+ <operation name='echo'>
+ <soap:operation soapAction=''/>
+ <input>
+ <soap:body namespace='http://org.jboss.ws/wsref' use='literal'/>
+ </input>
+ <output>
+ <soap:body namespace='http://org.jboss.ws/wsref' use='literal'/>
+ </output>
+ </operation>
+ </binding>
+
+ <service name='EndpointService'>
+ <port binding='tns:EndpointBinding' name='EndpointPort'>
+ <soap:address location='http://@jboss.bind.address@:8080/jaxws-samples-webservicerefsec'/>
+ </port>
+ </service>
+
+</definitions>
14 years, 7 months
JBossWS SVN: r12228 - in stack/cxf/trunk/modules: server/src/main/java/org/jboss/wsf/stack/cxf/security and 8 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2010-05-13 11:38:57 -0400 (Thu, 13 May 2010)
New Revision: 12228
Added:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/AuthenticationManagerLoader.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/SubjectCreatingInterceptor.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/UsernameAuthorizationTestCase.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/jaxws/GreetMe.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/jaxws/GreetMeResponse.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-authorize/
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-authorize/WEB-INF/
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-authorize/WEB-INF/jboss-web.xml
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-authorize/WEB-INF/jbossws-cxf.xml
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-authorize/WEB-INF/web.xml
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-authorize/WEB-INF/wsdl/
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-authorize/WEB-INF/wsdl/SecurityService.wsdl
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-authorize/WEB-INF/wsdl/SecurityService_schema1.xsd
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-samples-jaxws.xml
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/ServiceIface.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/ServiceImpl.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/UsernamePasswordCallback.java
Log:
[JBWS-2210] Applying patch3 from Sergey Beyozkin for CXF Username Token JAAS integration (plus moving SubjectCreatingInterceptor to the stack)
Added: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/AuthenticationManagerLoader.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/AuthenticationManagerLoader.java (rev 0)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/AuthenticationManagerLoader.java 2010-05-13 15:38:57 UTC (rev 12228)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.wsf.stack.cxf.security.authentication;
+
+import java.util.Hashtable;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+import org.jboss.security.AuthenticationManager;
+
+/**
+ * AuthenticationManager loader
+ *
+ * @author Sergey Beryozkin
+ *
+ */
+public class AuthenticationManagerLoader
+{
+ public AuthenticationManager getManager()
+ {
+ try
+ {
+ Context ctx = new InitialContext();
+ Object obj = ctx.lookup("java:/comp/env/security/securityMgr");
+ return (AuthenticationManager)obj;
+ }
+ catch (NamingException ne)
+ {
+ throw new SecurityException("Unable to lookup AuthenticationManager");
+ }
+ }
+}
Property changes on: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/AuthenticationManagerLoader.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/SubjectCreatingInterceptor.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/SubjectCreatingInterceptor.java (rev 0)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/SubjectCreatingInterceptor.java 2010-05-13 15:38:57 UTC (rev 12228)
@@ -0,0 +1,144 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.wsf.stack.cxf.security.authentication;
+
+import java.util.Calendar;
+import java.util.Collections;
+import java.util.Map;
+
+import java.security.Principal;
+import java.security.acl.Group;
+import javax.security.auth.Subject;
+
+import org.apache.cxf.common.classloader.ClassLoaderUtils;
+import org.apache.cxf.common.security.SimplePrincipal;
+import org.apache.cxf.ws.security.wss4j.AbstractUsernameTokenAuthenticatingInterceptor;
+
+import org.jboss.logging.Logger;
+
+import org.jboss.security.AuthenticationManager;
+
+import org.jboss.wsf.spi.SPIProvider;
+import org.jboss.wsf.spi.SPIProviderResolver;
+import org.jboss.wsf.spi.invocation.SecurityAdaptor;
+import org.jboss.wsf.spi.invocation.SecurityAdaptorFactory;
+
+/**
+ * Interceptor which authenticates a current principal and populates Subject
+ *
+ * @author Sergey Beryozkin
+ *
+ */
+public class SubjectCreatingInterceptor extends AbstractUsernameTokenAuthenticatingInterceptor
+{
+ private static final Logger log = Logger.getLogger(SubjectCreatingInterceptor.class);
+ private static final int TIMESTAMP_FRESHNESS_THRESHOLD = 300;
+
+ // private NonceStore nonceStore;
+ private SecurityAdaptorFactory secAdaptorFactory;
+
+ public SubjectCreatingInterceptor()
+ {
+ this(Collections.<String, Object> emptyMap());
+ }
+
+ public SubjectCreatingInterceptor(Map<String, Object> properties)
+ {
+ super(properties);
+ SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+ secAdaptorFactory = spiProvider.getSPI(SecurityAdaptorFactory.class);
+ }
+
+ @Override
+ public Subject createSubject(String name, String password, boolean isDigest, String nonce, String created)
+ {
+ // Load AuthenticationManager
+ // TODO : use PicketBox API
+
+ AuthenticationManagerLoader aml = null;
+ try
+ {
+ aml = AuthenticationManagerLoader.class.newInstance();
+ }
+ catch (Exception ex)
+ {
+ String msg = "AuthenticationManager can not be loaded";
+ log.error(msg);
+ throw new SecurityException(msg);
+ }
+
+ AuthenticationManager am = aml.getManager();
+
+ // verify timestamp and nonce if digest
+ if (isDigest)
+ {
+ verifyUsernameToken(nonce, created);
+ // CallbackHandler cb = new UsernameTokenCallbackHandler(nonce, created);
+ // CallbackHandlerPolicyContextHandler.setCaallbackHandler(cb);
+ }
+
+ // authenticate and populate Subject
+
+ Principal principal = new SimplePrincipal(name);
+ Subject subject = new Subject();
+
+ boolean TRACE = log.isTraceEnabled();
+ if (TRACE)
+ log.trace("About to authenticate, using security domain '" + am.getSecurityDomain() + "'");
+
+ if (am.isValid(principal, password, subject) == false)
+ {
+ String msg = "Authentication failed, principal=" + principal.getName();
+ log.error(msg);
+ throw new SecurityException(msg);
+ }
+
+ // push subject on the thread local storage
+ SecurityAdaptor adaptor = secAdaptorFactory.newSecurityAdapter();
+ adaptor.setPrincipal(principal);
+ adaptor.setCredential(password);
+ adaptor.pushSubjectContext(subject, principal, password);
+
+ if (TRACE)
+ log.trace("Authenticated, principal=" + name);
+
+ return subject;
+ }
+
+ private void verifyUsernameToken(String nonce, String created)
+ {
+// if (created != null)
+// {
+// Calendar cal = SimpleTypeBindings.unmarshalDateTime(created);
+// Calendar ref = Calendar.getInstance();
+// ref.add(Calendar.SECOND, -TIMESTAMP_FRESHNESS_THRESHOLD);
+// if (ref.after(cal))
+// throw new SecurityException("Request rejected since a stale timestamp has been provided: " + created);
+// }
+//
+// if (nonce != null)
+// {
+// if (nonceStore.hasNonce(nonce))
+// throw new SecurityException("Request rejected since a message with the same nonce has been recently received; nonce = " + nonce);
+// }
+ }
+}
Property changes on: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/security/authentication/SubjectCreatingInterceptor.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-samples-jaxws.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-samples-jaxws.xml 2010-05-13 15:36:32 UTC (rev 12227)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-samples-jaxws.xml 2010-05-13 15:38:57 UTC (rev 12228)
@@ -184,6 +184,23 @@
</webinf>
</war>
+ <!-- jaxws-samples-wsse-username-authorize -->
+ <war
+ warfile="${tests.output.dir}/test-libs/jaxws-samples-wsse-username-authorize.war"
+ webxml="${tests.output.dir}/test-resources/jaxws/samples/wsse/username-authorize/WEB-INF/web.xml">
+ <classes dir="${tests.output.dir}/test-classes">
+ <include name="org/jboss/test/ws/jaxws/samples/wsse/Service*.class"/>
+ <include name="org/jboss/test/ws/jaxws/samples/wsse/jaxws/*.class"/>
+ <include name="org/jboss/test/ws/jaxws/samples/wsse/SubjectCreatingInterceptor.class"/>
+ <include name="org/jboss/test/ws/jaxws/samples/wsse/AuthenticationManagerLoader.class"/>
+ </classes>
+ <webinf dir="${tests.output.dir}/test-resources/jaxws/samples/wsse/username-authorize/WEB-INF">
+ <include name="jboss-web.xml"/>
+ <include name="jbossws-cxf.xml"/>
+ <include name="wsdl/*"/>
+ </webinf>
+ </war>
+
<!-- jaxws-samples-wssePolicy-sign -->
<war
warfile="${tests.output.dir}/test-libs/jaxws-samples-wssePolicy-sign.war"
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/ServiceIface.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/ServiceIface.java 2010-05-13 15:36:32 UTC (rev 12227)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/ServiceIface.java 2010-05-13 15:38:57 UTC (rev 12228)
@@ -32,4 +32,7 @@
{
@WebMethod
String sayHello();
+
+ @WebMethod
+ String greetMe();
}
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/ServiceImpl.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/ServiceImpl.java 2010-05-13 15:36:32 UTC (rev 12227)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/ServiceImpl.java 2010-05-13 15:38:57 UTC (rev 12228)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2010, 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.
*
@@ -37,4 +37,8 @@
{
return "Secure Hello World!";
}
+ public String greetMe()
+ {
+ return "Greetings!";
+ }
}
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/UsernameAuthorizationTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/UsernameAuthorizationTestCase.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/UsernameAuthorizationTestCase.java 2010-05-13 15:38:57 UTC (rev 12228)
@@ -0,0 +1,98 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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;
+
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+
+import junit.framework.Test;
+
+import org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor;
+import org.apache.cxf.endpoint.Client;
+import org.apache.cxf.endpoint.Endpoint;
+import org.apache.cxf.frontend.ClientProxy;
+import org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor;
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+
+/**
+ * WS-Security username authorization test case
+ *
+ * @author Sergey Beryozkin
+ *
+ */
+public final class UsernameAuthorizationTestCase extends JBossWSTest
+{
+ private final String serviceURL = "http://" + getServerHost() + ":8080/jaxws-samples-wsse-username-authorize";
+
+ public static Test suite()
+ {
+ return new JBossWSTestSetup(UsernameAuthorizationTestCase.class, "jaxws-samples-wsse-username-authorize.war");
+ }
+
+ public void testAuthorized() throws Exception
+ {
+ QName serviceName = new QName("http://www.jboss.org/jbossws/ws-extensions/wssecurity", "SecurityService");
+ URL wsdlURL = new URL(serviceURL + "?wsdl");
+ Service service = Service.create(wsdlURL, serviceName);
+ ServiceIface proxy = (ServiceIface)service.getPort(ServiceIface.class);
+ setupWsse(proxy, "kermit");
+ assertEquals("Secure Hello World!", proxy.sayHello());
+ }
+
+ public void testUnauthorized() throws Exception
+ {
+ QName serviceName = new QName("http://www.jboss.org/jbossws/ws-extensions/wssecurity", "SecurityService");
+ URL wsdlURL = new URL(serviceURL + "?wsdl");
+ Service service = Service.create(wsdlURL, serviceName);
+ ServiceIface proxy = (ServiceIface)service.getPort(ServiceIface.class);
+ setupWsse(proxy, "kermit");
+ try
+ {
+ proxy.greetMe();
+ fail("User kermit should not be authorized to invoke greetMe.");
+ }
+ catch (Exception ex)
+ {
+ assertEquals("Unauthorized", ex.getMessage());
+ }
+ }
+
+ private void setupWsse(ServiceIface proxy, String username)
+ {
+ Client client = ClientProxy.getClient(proxy);
+ Endpoint cxfEndpoint = client.getEndpoint();
+
+ Map<String, Object> outProps = new HashMap<String, Object>();
+ outProps.put("action", "UsernameToken");
+ outProps.put("user", username);
+ outProps.put("passwordType", "PasswordText");
+ outProps.put("passwordCallbackClass", "org.jboss.test.ws.jaxws.samples.wsse.UsernamePasswordCallback");
+ WSS4JOutInterceptor wssOut = new WSS4JOutInterceptor(outProps); //request
+ cxfEndpoint.getOutInterceptors().add(wssOut);
+ cxfEndpoint.getOutInterceptors().add(new SAAJOutInterceptor());
+ }
+}
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/UsernameAuthorizationTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/UsernamePasswordCallback.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/UsernamePasswordCallback.java 2010-05-13 15:36:32 UTC (rev 12227)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/UsernamePasswordCallback.java 2010-05-13 15:38:57 UTC (rev 12228)
@@ -33,7 +33,7 @@
public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException
{
WSPasswordCallback pc = (WSPasswordCallback)callbacks[0];
- if ("kermit".equals(pc.getIdentifer()))
+ if ("kermit".equals(pc.getIdentifier()))
pc.setPassword("thefrog");
else
pc.setPassword("wrong password");
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/jaxws/GreetMe.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/jaxws/GreetMe.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/jaxws/GreetMe.java 2010-05-13 15:38:57 UTC (rev 12228)
@@ -0,0 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.jaxws;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+@XmlRootElement(name = "greetMe", namespace = "http://www.jboss.org/jbossws/ws-extensions/wssecurity")
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "greetMe", namespace = "http://www.jboss.org/jbossws/ws-extensions/wssecurity")
+public class GreetMe {}
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/jaxws/GreetMe.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/jaxws/GreetMeResponse.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/jaxws/GreetMeResponse.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/jaxws/GreetMeResponse.java 2010-05-13 15:38:57 UTC (rev 12228)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.jaxws;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+@XmlRootElement(name = "greetMeResponse", namespace = "http://www.jboss.org/jbossws/ws-extensions/wssecurity")
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "greetMeResponse", namespace = "http://www.jboss.org/jbossws/ws-extensions/wssecurity")
+public class GreetMeResponse
+{
+
+ @XmlElement(name = "return", namespace = "")
+ private String _return;
+
+ public String getReturn()
+ {
+ return this._return;
+ }
+
+ public void setReturn(String _return)
+ {
+ this._return = _return;
+ }
+
+}
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/jaxws/GreetMeResponse.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-authorize/WEB-INF/jboss-web.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-authorize/WEB-INF/jboss-web.xml (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-authorize/WEB-INF/jboss-web.xml 2010-05-13 15:38:57 UTC (rev 12228)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 2.4//EN" "http://www.jboss.org/j2ee/dtd/jboss-web_4_0.dtd">
+
+<jboss-web>
+ <security-domain>java:/jaas/JBossWS</security-domain>
+</jboss-web>
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-authorize/WEB-INF/jboss-web.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-authorize/WEB-INF/jbossws-cxf.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-authorize/WEB-INF/jbossws-cxf.xml (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-authorize/WEB-INF/jbossws-cxf.xml 2010-05-13 15:38:57 UTC (rev 12228)
@@ -0,0 +1,45 @@
+<beans
+ xmlns='http://www.springframework.org/schema/beans'
+ xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
+ xmlns:beans='http://www.springframework.org/schema/beans'
+ xmlns:jaxws='http://cxf.apache.org/jaxws'
+ xmlns:util='http://www.springframework.org/schema/util'
+ xsi:schemaLocation='http://cxf.apache.org/core
+ http://cxf.apache.org/schemas/core.xsd
+ http://www.springframework.org/schema/util
+ http://www.springframework.org/schema/util/spring-util-2.0.xsd
+ http://www.springframework.org/schema/beans
+ http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+ http://cxf.apache.org/jaxws
+ http://cxf.apache.org/schemas/jaxws.xsd'>
+
+ <bean id="SecurityContextIn" class="org.jboss.wsf.stack.cxf.security.authentication.SubjectCreatingInterceptor">
+ <constructor-arg>
+ <map>
+ <entry key="action" value="UsernameToken"/>
+ </map>
+ </constructor-arg>
+ </bean>
+
+ <util:map id="methodPermissions">
+ <entry key="sayHello" value="friend"/>
+ <entry key="greetMe" value="snoopies"/>
+ </util:map>
+
+ <bean id="AuthorizeIn" class="org.apache.cxf.interceptor.security.SimpleAuthorizingInterceptor">
+ <property name="methodRolesMap" ref="methodPermissions"/>
+ </bean>
+
+ <jaxws:endpoint
+ id='ServiceImpl'
+ address='http://@jboss.bind.address@:8080/jaxws-samples-wsse-username-authorize'
+ implementor='org.jboss.test.ws.jaxws.samples.wsse.ServiceImpl'>
+ <jaxws:inInterceptors>
+ <ref bean="SecurityContextIn"/>
+ <ref bean="AuthorizeIn"/>
+ <bean class="org.apache.cxf.binding.soap.saaj.SAAJInInterceptor"/>
+ </jaxws:inInterceptors>
+ </jaxws:endpoint>
+
+
+</beans>
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-authorize/WEB-INF/jbossws-cxf.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-authorize/WEB-INF/web.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-authorize/WEB-INF/web.xml (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-authorize/WEB-INF/web.xml 2010-05-13 15:38:57 UTC (rev 12228)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<web-app
+ version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
+ <servlet>
+ <servlet-name>TestService</servlet-name>
+ <servlet-class>org.jboss.test.ws.jaxws.samples.wsse.ServiceImpl</servlet-class>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>TestService</servlet-name>
+ <url-pattern>/*</url-pattern>
+ </servlet-mapping>
+</web-app>
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-authorize/WEB-INF/web.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-authorize/WEB-INF/wsdl/SecurityService.wsdl
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-authorize/WEB-INF/wsdl/SecurityService.wsdl (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-authorize/WEB-INF/wsdl/SecurityService.wsdl 2010-05-13 15:38:57 UTC (rev 12228)
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<definitions targetNamespace="http://www.jboss.org/jbossws/ws-extensions/wssecurity" name="SecurityService"
+ xmlns:tns="http://www.jboss.org/jbossws/ws-extensions/wssecurity"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns="http://schemas.xmlsoap.org/wsdl/">
+ <types>
+ <xsd:schema>
+ <xsd:import namespace="http://www.jboss.org/jbossws/ws-extensions/wssecurity" schemaLocation="SecurityService_schema1.xsd"/>
+ </xsd:schema>
+ </types>
+ <message name="sayHello">
+ <part name="parameters" element="tns:sayHello"/>
+ </message>
+ <message name="sayHelloResponse">
+ <part name="parameters" element="tns:sayHelloResponse"/>
+ </message>
+ <message name="greetMe">
+ <part name="parameters" element="tns:greetMe"/>
+ </message>
+ <message name="greetMeResponse">
+ <part name="parameters" element="tns:greetMeResponse"/>
+ </message>
+ <portType name="ServiceIface">
+ <operation name="sayHello">
+ <input message="tns:sayHello"/>
+ <output message="tns:sayHelloResponse"/>
+ </operation>
+ <operation name="greetMe">
+ <input message="tns:greetMe"/>
+ <output message="tns:greetMeResponse"/>
+ </operation>
+ </portType>
+ <binding name="SecurityServicePortBinding" type="tns:ServiceIface">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
+ <operation name="sayHello">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ <operation name="greetMe">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ </binding>
+ <service name="SecurityService">
+ <port name="SecurityServicePort" binding="tns:SecurityServicePortBinding">
+ <soap:address location="http://@jboss.bind.address@:8080/jaxws-samples-wsse-username-authorize"/>
+ </port>
+ </service>
+</definitions>
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-authorize/WEB-INF/wsdl/SecurityService.wsdl
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-authorize/WEB-INF/wsdl/SecurityService_schema1.xsd
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-authorize/WEB-INF/wsdl/SecurityService_schema1.xsd (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-authorize/WEB-INF/wsdl/SecurityService_schema1.xsd 2010-05-13 15:38:57 UTC (rev 12228)
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<xs:schema version="1.0" targetNamespace="http://www.jboss.org/jbossws/ws-extensions/wssecurity" xmlns:tns="http://www.jboss.org/jbossws/ws-extensions/wssecurity" xmlns:xs="http://www.w3.org/2001/XMLSchema">
+
+ <xs:element name="sayHello" type="tns:sayHello"/>
+
+ <xs:element name="sayHelloResponse" type="tns:sayHelloResponse"/>
+
+ <xs:complexType name="sayHello">
+ <xs:sequence/>
+ </xs:complexType>
+
+ <xs:complexType name="sayHelloResponse">
+ <xs:sequence>
+ <xs:element name="return" type="xs:string" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:element name="greetMe" type="tns:greetMe"/>
+
+ <xs:element name="greetMeResponse" type="tns:greetMeResponse"/>
+
+ <xs:complexType name="greetMe">
+ <xs:sequence/>
+ </xs:complexType>
+
+ <xs:complexType name="greetMeResponse">
+ <xs:sequence>
+ <xs:element name="return" type="xs:string" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+</xs:schema>
+
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/username-authorize/WEB-INF/wsdl/SecurityService_schema1.xsd
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
14 years, 7 months
JBossWS SVN: r12227 - in stack/cxf/trunk: modules/server and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2010-05-13 11:36:32 -0400 (Thu, 13 May 2010)
New Revision: 12227
Modified:
stack/cxf/trunk/modules/server/pom.xml
stack/cxf/trunk/pom.xml
Log:
[JBWS-2210] Adding dependency on jboss-security-spi
Modified: stack/cxf/trunk/modules/server/pom.xml
===================================================================
--- stack/cxf/trunk/modules/server/pom.xml 2010-05-13 14:09:55 UTC (rev 12226)
+++ stack/cxf/trunk/modules/server/pom.xml 2010-05-13 15:36:32 UTC (rev 12227)
@@ -171,6 +171,10 @@
<groupId>org.jboss</groupId>
<artifactId>jboss-common-core</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.jboss.security</groupId>
+ <artifactId>jboss-security-spi</artifactId>
+ </dependency>
<!-- transitve dependencies -->
<dependency>
Modified: stack/cxf/trunk/pom.xml
===================================================================
--- stack/cxf/trunk/pom.xml 2010-05-13 14:09:55 UTC (rev 12226)
+++ stack/cxf/trunk/pom.xml 2010-05-13 15:36:32 UTC (rev 12227)
@@ -62,6 +62,7 @@
<fastinfoset.api.version>1.2.7</fastinfoset.api.version>
<jboss.common.core.version>2.2.16.GA</jboss.common.core.version>
<jboss.logging.version>2.2.0.CR1</jboss.logging.version>
+ <jboss.security.spi.version>2.0.4.SP4</jboss.security.spi.version>
<jaxb.api.version>2.1</jaxb.api.version>
<jaxb.impl.version>2.1.12</jaxb.impl.version>
<jaxrpc.api.version>1.1</jaxrpc.api.version>
@@ -375,6 +376,12 @@
<version>${jboss.common.core.version}</version>
<scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>org.jboss.security</groupId>
+ <artifactId>jboss-security-spi</artifactId>
+ <version>${jboss.security.spi.version}</version>
+ <scope>provided</scope>
+ </dependency>
<!-- transitive dependencies -->
<dependency>
14 years, 7 months
JBossWS SVN: r12226 - projects/plugins/maven/jaxws-tools/trunk.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2010-05-13 10:09:55 -0400 (Thu, 13 May 2010)
New Revision: 12226
Modified:
projects/plugins/maven/jaxws-tools/trunk/pom.xml
Log:
Move jaxws tools plugin to using 3.3.0.CR2 jbossws artifacts, new Nexus based jbossws-parent and add profile for looking for tools.jar on Sun JDK only
Modified: projects/plugins/maven/jaxws-tools/trunk/pom.xml
===================================================================
--- projects/plugins/maven/jaxws-tools/trunk/pom.xml 2010-05-13 10:11:45 UTC (rev 12225)
+++ projects/plugins/maven/jaxws-tools/trunk/pom.xml 2010-05-13 14:09:55 UTC (rev 12226)
@@ -7,13 +7,13 @@
<artifactId>maven-jaxws-tools-plugin</artifactId>
<packaging>maven-plugin</packaging>
- <version>1.0.0-SNAPSHOT</version>
+ <version>1.0.1-SNAPSHOT</version>
<!-- Parent -->
<parent>
<groupId>org.jboss.ws</groupId>
<artifactId>jbossws-parent</artifactId>
- <version>1.0.4.GA</version>
+ <version>1.0.6.GA</version>
</parent>
<!-- Source Control Management -->
@@ -25,16 +25,16 @@
<!-- Properties -->
<properties>
- <jbossws.spi.version>1.3.0.Beta3</jbossws.spi.version>
+ <jbossws.spi.version>1.3.0.CR2</jbossws.spi.version>
<maven.project.version>2.0.4</maven.project.version>
<maven.plugin.api.version>2.0.4</maven.plugin.api.version>
<maven.invoker.plugin.version>1.5</maven.invoker.plugin.version>
<!-- For test -->
<junit.version>4.7</junit.version>
<maven.plugin.testing.harness.version>1.1</maven.plugin.testing.harness.version>
- <jbossws.cxf.client.version>3.3.0.Beta1</jbossws.cxf.client.version>
- <jbossws.metro.client.version>3.3.0.Beta1</jbossws.metro.client.version>
- <jbossws.native.client.version>3.3.0.Beta4</jbossws.native.client.version>
+ <jbossws.cxf.client.version>3.3.0.CR2</jbossws.cxf.client.version>
+ <jbossws.metro.client.version>3.3.0.CR2</jbossws.metro.client.version>
+ <jbossws.native.client.version>3.3.0.CR2</jbossws.native.client.version>
<jbossxb.version>2.0.1.GA</jbossxb.version>
</properties>
@@ -97,16 +97,30 @@
<optional>true</optional>
<!-- <scope>test</scope> --> <!-- TODO Move this to test scope instead of making it optional; currently messes up classloader in wsprovide test with Native stack -->
</dependency>
- <dependency>
- <groupId>com.sun</groupId>
- <artifactId>tools</artifactId>
- <version>1.5.0</version>
- <scope>system</scope>
- <systemPath>${java.home}/../lib/tools.jar</systemPath> <!-- Required by wsprovide with Metro stack (because of APT) -->
- </dependency>
-
</dependencies>
+ <profiles>
+ <profile>
+ <id>default-tools.jar</id>
+ <activation>
+ <property>
+ <name>java.vendor</name>
+ <value>Sun Microsystems Inc.</value>
+ </property>
+ </activation>
+ <dependencies>
+ <dependency>
+ <groupId>com.sun</groupId>
+ <artifactId>tools</artifactId>
+ <version>1.5.0</version>
+ <scope>system</scope>
+ <systemPath>${java.home}/../lib/tools.jar</systemPath>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
+
+
<reporting>
<plugins>
<plugin>
14 years, 7 months
JBossWS SVN: r12225 - stack/cxf/trunk/modules/testsuite.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2010-05-13 06:11:45 -0400 (Thu, 13 May 2010)
New Revision: 12225
Modified:
stack/cxf/trunk/modules/testsuite/test-excludes-jboss501.txt
stack/cxf/trunk/modules/testsuite/test-excludes-jboss510.txt
stack/cxf/trunk/modules/testsuite/test-excludes-jboss600.txt
stack/cxf/trunk/modules/testsuite/test-excludes-jboss601.txt
Log:
[JBWS-3018][CXF-1516] Enabling passing test
Modified: stack/cxf/trunk/modules/testsuite/test-excludes-jboss501.txt
===================================================================
--- stack/cxf/trunk/modules/testsuite/test-excludes-jboss501.txt 2010-05-13 09:39:24 UTC (rev 12224)
+++ stack/cxf/trunk/modules/testsuite/test-excludes-jboss501.txt 2010-05-13 10:11:45 UTC (rev 12225)
@@ -8,9 +8,6 @@
org/jboss/test/ws/jaxws/samples/provider/ProviderJAXBTestCase.*
org/jboss/test/ws/jaxws/samples/provider/ProviderPayloadTestCase.*
-# [CXF-1516] Type inheritance with document/literal/bare
-org/jboss/test/ws/jaxws/jbws1702/**
-
# [CXF-1517] HTTP bindings for Provider
org/jboss/test/ws/jaxws/jbws1807/**
Modified: stack/cxf/trunk/modules/testsuite/test-excludes-jboss510.txt
===================================================================
--- stack/cxf/trunk/modules/testsuite/test-excludes-jboss510.txt 2010-05-13 09:39:24 UTC (rev 12224)
+++ stack/cxf/trunk/modules/testsuite/test-excludes-jboss510.txt 2010-05-13 10:11:45 UTC (rev 12225)
@@ -8,9 +8,6 @@
org/jboss/test/ws/jaxws/samples/provider/ProviderJAXBTestCase.*
org/jboss/test/ws/jaxws/samples/provider/ProviderPayloadTestCase.*
-# [CXF-1516] Type inheritance with document/literal/bare
-org/jboss/test/ws/jaxws/jbws1702/**
-
# [CXF-1517] HTTP bindings for Provider
org/jboss/test/ws/jaxws/jbws1807/**
Modified: stack/cxf/trunk/modules/testsuite/test-excludes-jboss600.txt
===================================================================
--- stack/cxf/trunk/modules/testsuite/test-excludes-jboss600.txt 2010-05-13 09:39:24 UTC (rev 12224)
+++ stack/cxf/trunk/modules/testsuite/test-excludes-jboss600.txt 2010-05-13 10:11:45 UTC (rev 12225)
@@ -8,9 +8,6 @@
org/jboss/test/ws/jaxws/samples/provider/ProviderJAXBTestCase.*
org/jboss/test/ws/jaxws/samples/provider/ProviderPayloadTestCase.*
-# [CXF-1516] Type inheritance with document/literal/bare
-org/jboss/test/ws/jaxws/jbws1702/**
-
# [CXF-1517] HTTP bindings for Provider
org/jboss/test/ws/jaxws/jbws1807/**
Modified: stack/cxf/trunk/modules/testsuite/test-excludes-jboss601.txt
===================================================================
--- stack/cxf/trunk/modules/testsuite/test-excludes-jboss601.txt 2010-05-13 09:39:24 UTC (rev 12224)
+++ stack/cxf/trunk/modules/testsuite/test-excludes-jboss601.txt 2010-05-13 10:11:45 UTC (rev 12225)
@@ -8,9 +8,6 @@
org/jboss/test/ws/jaxws/samples/provider/ProviderJAXBTestCase.*
org/jboss/test/ws/jaxws/samples/provider/ProviderPayloadTestCase.*
-# [CXF-1516] Type inheritance with document/literal/bare
-org/jboss/test/ws/jaxws/jbws1702/**
-
# [CXF-1517] HTTP bindings for Provider
org/jboss/test/ws/jaxws/jbws1807/**
14 years, 7 months
JBossWS SVN: r12224 - stack/cxf/trunk/modules/testsuite.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2010-05-13 05:39:24 -0400 (Thu, 13 May 2010)
New Revision: 12224
Modified:
stack/cxf/trunk/modules/testsuite/test-excludes-jboss501.txt
stack/cxf/trunk/modules/testsuite/test-excludes-jboss510.txt
stack/cxf/trunk/modules/testsuite/test-excludes-jboss600.txt
stack/cxf/trunk/modules/testsuite/test-excludes-jboss601.txt
Log:
[JBWS-2571] Re-enabling test
Modified: stack/cxf/trunk/modules/testsuite/test-excludes-jboss501.txt
===================================================================
--- stack/cxf/trunk/modules/testsuite/test-excludes-jboss501.txt 2010-05-13 08:24:12 UTC (rev 12223)
+++ stack/cxf/trunk/modules/testsuite/test-excludes-jboss501.txt 2010-05-13 09:39:24 UTC (rev 12224)
@@ -36,9 +36,6 @@
# [JBWS-2561] XOP request not properly inlined
org/jboss/test/ws/jaxws/samples/xop/doclit/XOPHandlerTestCase.*
-# [JBWS-2571] Mode.INOUT parameter not generated
-org/jboss/test/ws/jaxws/holder/**
-
# [JBWS-2480] Soap attachments are dropped on server response
org/jboss/test/ws/jaxws/jbws1283/**
Modified: stack/cxf/trunk/modules/testsuite/test-excludes-jboss510.txt
===================================================================
--- stack/cxf/trunk/modules/testsuite/test-excludes-jboss510.txt 2010-05-13 08:24:12 UTC (rev 12223)
+++ stack/cxf/trunk/modules/testsuite/test-excludes-jboss510.txt 2010-05-13 09:39:24 UTC (rev 12224)
@@ -36,9 +36,6 @@
# [JBWS-2561] XOP request not properly inlined
org/jboss/test/ws/jaxws/samples/xop/doclit/XOPHandlerTestCase.*
-# [JBWS-2571] Mode.INOUT parameter not generated
-org/jboss/test/ws/jaxws/holder/**
-
# [JBWS-2480] Soap attachments are dropped on server response
org/jboss/test/ws/jaxws/jbws1283/**
Modified: stack/cxf/trunk/modules/testsuite/test-excludes-jboss600.txt
===================================================================
--- stack/cxf/trunk/modules/testsuite/test-excludes-jboss600.txt 2010-05-13 08:24:12 UTC (rev 12223)
+++ stack/cxf/trunk/modules/testsuite/test-excludes-jboss600.txt 2010-05-13 09:39:24 UTC (rev 12224)
@@ -36,9 +36,6 @@
# [JBWS-2561] XOP request not properly inlined
org/jboss/test/ws/jaxws/samples/xop/doclit/XOPHandlerTestCase.*
-# [JBWS-2571] Mode.INOUT parameter not generated
-org/jboss/test/ws/jaxws/holder/**
-
# [JBWS-2480] Soap attachments are dropped on server response
org/jboss/test/ws/jaxws/jbws1283/**
Modified: stack/cxf/trunk/modules/testsuite/test-excludes-jboss601.txt
===================================================================
--- stack/cxf/trunk/modules/testsuite/test-excludes-jboss601.txt 2010-05-13 08:24:12 UTC (rev 12223)
+++ stack/cxf/trunk/modules/testsuite/test-excludes-jboss601.txt 2010-05-13 09:39:24 UTC (rev 12224)
@@ -33,9 +33,6 @@
# [JBWS-2561] XOP request not properly inlined
org/jboss/test/ws/jaxws/samples/xop/doclit/XOPHandlerTestCase.*
-# [JBWS-2571] Mode.INOUT parameter not generated
-org/jboss/test/ws/jaxws/holder/**
-
# [JBWS-2480] Soap attachments are dropped on server response
org/jboss/test/ws/jaxws/jbws1283/**
14 years, 7 months
JBossWS SVN: r12223 - container/jboss60/branches.
by jbossws-commits@lists.jboss.org
Author: jim.ma
Date: 2010-05-13 04:24:12 -0400 (Thu, 13 May 2010)
New Revision: 12223
Removed:
container/jboss60/branches/jbossws-jboss600M2-jms-integration/
Log:
Removed the branch for AS600M2 , use AS600M3
14 years, 7 months
JBossWS SVN: r12222 - in framework/trunk/testsuite/test: java/org/jboss/test/ws/jaxws/samples and 5 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2010-05-13 04:23:30 -0400 (Thu, 13 May 2010)
New Revision: 12222
Added:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/Client.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/Endpoint.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/EndpointImpl.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/EndpointService.java
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/WebServiceRefSecTestCase.java
framework/trunk/testsuite/test/resources/jaxws/samples/webservicerefsec/
framework/trunk/testsuite/test/resources/jaxws/samples/webservicerefsec/WEB-INF/
framework/trunk/testsuite/test/resources/jaxws/samples/webservicerefsec/WEB-INF/jboss-web.xml
framework/trunk/testsuite/test/resources/jaxws/samples/webservicerefsec/WEB-INF/web.xml
framework/trunk/testsuite/test/resources/jaxws/samples/webservicerefsec/WEB-INF/wsdl/
framework/trunk/testsuite/test/resources/jaxws/samples/webservicerefsec/WEB-INF/wsdl/Endpoint.wsdl
Modified:
framework/trunk/testsuite/test/ant-import/build-samples-jaxws.xml
Log:
[JBWS-3025] Adding testcase with multiple webservicerefs using the same service/port with different security credentials
Modified: framework/trunk/testsuite/test/ant-import/build-samples-jaxws.xml
===================================================================
--- framework/trunk/testsuite/test/ant-import/build-samples-jaxws.xml 2010-05-13 08:22:15 UTC (rev 12221)
+++ framework/trunk/testsuite/test/ant-import/build-samples-jaxws.xml 2010-05-13 08:23:30 UTC (rev 12222)
@@ -428,6 +428,25 @@
<include name="wsdl/**"/>
</metainf>
</jar>
+
+ <!-- jaxws-samples-webservicerefsec -->
+ <jar destfile="${tests.output.dir}/test-libs/jaxws-samples-webservicerefsec.jar">
+ <fileset dir="${tests.output.dir}/test-classes">
+ <include name="org/jboss/test/ws/jaxws/samples/webservicerefsec/EndpointImpl.class" />
+ </fileset>
+ </jar>
+ <war destfile="${tests.output.dir}/test-libs/jaxws-samples-webservicerefsec-servlet-client.war"
+ webxml="${tests.output.dir}/test-resources/jaxws/samples/webservicerefsec/WEB-INF/web.xml">
+ <classes dir="${tests.output.dir}/test-classes">
+ <include name="org/jboss/test/ws/jaxws/samples/webservicerefsec/Client.class" />
+ <include name="org/jboss/test/ws/jaxws/samples/webservicerefsec/Endpoint.class" />
+ <include name="org/jboss/test/ws/jaxws/samples/webservicerefsec/EndpointService.class" />
+ </classes>
+ <webinf dir="${tests.output.dir}/test-resources/jaxws/samples/webservicerefsec/WEB-INF">
+ <include name="wsdl/**"/>
+ <include name="jboss-web.xml"/>
+ </webinf>
+ </war>
<!-- jaxws-samples-xop-doclit -->
<war jarfile="${tests.output.dir}/test-libs/jaxws-samples-xop-doclit.war" webxml="${tests.output.dir}/test-resources/jaxws/samples/xop/doclit/WEB-INF/web.xml">
Added: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/Client.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/Client.java (rev 0)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/Client.java 2010-05-13 08:23:30 UTC (rev 12222)
@@ -0,0 +1,82 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.webservicerefsec;
+
+import java.io.IOException;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.WebServiceRef;
+
+import org.jboss.logging.Logger;
+
+public class Client extends HttpServlet
+{
+ private static final long serialVersionUID = -5930858947901509123L;
+
+ // Provide logging
+ private static Logger log = Logger.getLogger(Client.class);
+
+ @WebServiceRef
+ static EndpointService authorizedService;
+
+ @WebServiceRef
+ static EndpointService unauthorizedService;
+
+
+ @Override
+ protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
+ {
+ String inStr = req.getParameter("echo");
+ log.info("doGet: " + inStr);
+
+ String outStr = null;
+ Endpoint ep = authorizedService.getPort(Endpoint.class);
+ log.info("Performing invocation with username: " + ((BindingProvider) ep).getRequestContext().get(BindingProvider.USERNAME_PROPERTY));
+ outStr = ep.echo(inStr);
+ if (inStr.equals(outStr) == false)
+ throw new WebServiceException("Invalid echo return: " + inStr);
+
+ boolean invokationSucceeded = false;
+ try
+ {
+ Endpoint uep = unauthorizedService.getPort(Endpoint.class);
+ log.info("Performing invocation with username: " + ((BindingProvider) uep).getRequestContext().get(BindingProvider.USERNAME_PROPERTY));
+ uep.echo(inStr);
+ invokationSucceeded = true;
+ }
+ catch (Exception e)
+ {
+ log.info(e);
+ }
+ if (invokationSucceeded)
+ {
+ throw new RuntimeException("Expected exception!");
+ }
+
+ res.getWriter().print(outStr);
+ }
+}
Added: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/Endpoint.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/Endpoint.java (rev 0)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/Endpoint.java 2010-05-13 08:23:30 UTC (rev 12222)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.webservicerefsec;
+
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebResult;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+import javax.jws.soap.SOAPBinding.Style;
+
+
+/**
+ * This class was generated by the JAXWS SI.
+ * JAX-WS RI 2.0-b26-ea3
+ * Generated source version: 2.0
+ *
+ */
+@WebService(name = "Endpoint", targetNamespace = "http://org.jboss.ws/wsref", wsdlLocation = "http://localhost.localdomain:8080/jaxws-samples-webservicerefsec?wsdl")
+@SOAPBinding(style = Style.RPC)
+public interface Endpoint {
+
+
+ /**
+ *
+ * @param arg0
+ * @return
+ * returns java.lang.String
+ */
+ @WebMethod
+ @WebResult(targetNamespace = "http://org.jboss.ws/wsref", partName = "return")
+ public String echo(
+ @WebParam(name = "arg0", partName = "arg0")
+ String arg0);
+
+}
Added: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/EndpointImpl.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/EndpointImpl.java (rev 0)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/EndpointImpl.java 2010-05-13 08:23:30 UTC (rev 12222)
@@ -0,0 +1,62 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.webservicerefsec;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+import javax.jws.soap.SOAPBinding.Style;
+
+import org.jboss.ejb3.annotation.SecurityDomain;
+import org.jboss.logging.Logger;
+import org.jboss.wsf.spi.annotation.AuthMethod;
+import org.jboss.wsf.spi.annotation.TransportGuarantee;
+import org.jboss.wsf.spi.annotation.WebContext;
+
+import javax.annotation.security.RolesAllowed;
+import javax.ejb.Stateless;
+
+@WebService(name = "Endpoint", serviceName = "EndpointService", targetNamespace = "http://org.jboss.ws/wsref")
+@SOAPBinding(style = Style.RPC)
+@Stateless(name = "webservicerefSecTest")
+@WebContext
+(
+ contextRoot = "/jaxws-samples-webservicerefsec",
+ urlPattern = "/*",
+ authMethod = AuthMethod.BASIC,
+ transportGuarantee = TransportGuarantee.NONE,
+ secureWSDLAccess = false
+)
+@SecurityDomain("JBossWS")
+public class EndpointImpl
+{
+ // Provide logging
+ private static Logger log = Logger.getLogger(EndpointImpl.class);
+
+ @WebMethod
+ @RolesAllowed("friend")
+ public String echo(String input)
+ {
+ log.info(input);
+ return input;
+ }
+}
Added: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/EndpointService.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/EndpointService.java (rev 0)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/EndpointService.java 2010-05-13 08:23:30 UTC (rev 12222)
@@ -0,0 +1,108 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.webservicerefsec;
+
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+import javax.xml.ws.WebEndpoint;
+import javax.xml.ws.WebServiceClient;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.WebServiceFeature;
+
+/**
+ * This class was generated by the JAX-WS RI.
+ * JAX-WS RI 2.2-12/14/2009 02:16 PM(ramkris)-
+ * Generated source version: 2.2
+ *
+ */
+@WebServiceClient(name = "EndpointService", targetNamespace = "http://org.jboss.ws/wsref", wsdlLocation = "META-INF/wsdl/Endpoint.wsdl")
+public class EndpointService extends Service
+{
+
+ private final static URL ENDPOINTSERVICE_WSDL_LOCATION;
+ private final static WebServiceException ENDPOINTSERVICE_EXCEPTION;
+ private final static QName ENDPOINTSERVICE_QNAME = new QName("http://org.jboss.ws/wsref", "EndpointService");
+
+ static
+ {
+ URL url = null;
+ WebServiceException e = null;
+ url = EndpointService.class.getResource("bogusAddress"); //invalid address on purpose
+ if (url == null)
+ {
+ e = new WebServiceException("Cannot find wsdl, please put in classpath");
+ }
+ ENDPOINTSERVICE_WSDL_LOCATION = url;
+ ENDPOINTSERVICE_EXCEPTION = e;
+ }
+
+ public EndpointService()
+ {
+ super(__getWsdlLocation(), ENDPOINTSERVICE_QNAME);
+ }
+
+ public EndpointService(URL wsdlLocation)
+ {
+ super(wsdlLocation, ENDPOINTSERVICE_QNAME);
+ }
+
+ public EndpointService(URL wsdlLocation, QName serviceName)
+ {
+ super(wsdlLocation, serviceName);
+ }
+
+ /**
+ *
+ * @return
+ * returns Endpoint
+ */
+ @WebEndpoint(name = "EndpointPort")
+ public Endpoint getEndpointPort()
+ {
+ return super.getPort(new QName("http://org.jboss.ws/wsref", "EndpointPort"), Endpoint.class);
+ }
+
+ /**
+ *
+ * @param features
+ * A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy. Supported features not in the <code>features</code> parameter will have their default values.
+ * @return
+ * returns Endpoint
+ */
+ @WebEndpoint(name = "EndpointPort")
+ public Endpoint getEndpointPort(WebServiceFeature... features)
+ {
+ return super.getPort(new QName("http://org.jboss.ws/wsref", "EndpointPort"), Endpoint.class, features);
+ }
+
+ private static URL __getWsdlLocation()
+ {
+ if (ENDPOINTSERVICE_EXCEPTION != null)
+ {
+ throw ENDPOINTSERVICE_EXCEPTION;
+ }
+ return ENDPOINTSERVICE_WSDL_LOCATION;
+ }
+
+}
Added: framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/WebServiceRefSecTestCase.java
===================================================================
--- framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/WebServiceRefSecTestCase.java (rev 0)
+++ framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/samples/webservicerefsec/WebServiceRefSecTestCase.java 2010-05-13 08:23:30 UTC (rev 12222)
@@ -0,0 +1,63 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2010, 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.webservicerefsec;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.net.URL;
+
+import junit.framework.Test;
+
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestSetup;
+
+/**
+ * Test multiple webserviceref fro the same endpoint with different security credentials
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 12-May-2010
+ */
+public class WebServiceRefSecTestCase extends JBossWSTest
+{
+ public final String TARGET_ENDPOINT_ADDRESS = "http://" + getServerHost() + ":8080/jaxws-samples-webservicerefsec";
+
+ public static Test suite()
+ {
+ return new JBossWSTestSetup(WebServiceRefSecTestCase.class, "jaxws-samples-webservicerefsec.jar");
+ }
+
+ public void testServletClient() throws Exception
+ {
+ deploy("jaxws-samples-webservicerefsec-servlet-client.war");
+ try
+ {
+ URL url = new URL(TARGET_ENDPOINT_ADDRESS + "-servlet-client?echo=HelloWorld");
+ BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
+ String retStr = br.readLine();
+ assertEquals("HelloWorld", retStr);
+ }
+ finally
+ {
+ undeploy("jaxws-samples-webservicerefsec-servlet-client.war");
+ }
+ }
+}
Added: framework/trunk/testsuite/test/resources/jaxws/samples/webservicerefsec/WEB-INF/jboss-web.xml
===================================================================
--- framework/trunk/testsuite/test/resources/jaxws/samples/webservicerefsec/WEB-INF/jboss-web.xml (rev 0)
+++ framework/trunk/testsuite/test/resources/jaxws/samples/webservicerefsec/WEB-INF/jboss-web.xml 2010-05-13 08:23:30 UTC (rev 12222)
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 5.0//EN" "http://www.jboss.org/j2ee/dtd/jboss-web_5_0.dtd">
+
+<jboss-web>
+
+ <service-ref>
+ <service-ref-name>org.jboss.test.ws.jaxws.samples.webservicerefsec.Client/authorizedService</service-ref-name>
+ <service-qname>{http://org.jboss.ws/wsref}EndpointService</service-qname>
+ <port-component-ref>
+ <service-endpoint-interface>org.jboss.test.ws.jaxws.samples.webservicerefsec.Endpoint</service-endpoint-interface>
+ <port-qname>{http://org.jboss.ws/wsref}EndpointPort</port-qname>
+ <stub-property>
+ <prop-name>javax.xml.ws.security.auth.username</prop-name>
+ <prop-value>kermit</prop-value>
+ </stub-property>
+ <stub-property>
+ <prop-name>javax.xml.ws.security.auth.password</prop-name>
+ <prop-value>thefrog</prop-value>
+ </stub-property>
+ </port-component-ref>
+ <wsdl-override>WEB-INF/wsdl/Endpoint.wsdl</wsdl-override>
+ </service-ref>
+
+ <service-ref>
+ <service-ref-name>org.jboss.test.ws.jaxws.samples.webservicerefsec.Client/unauthorizedService</service-ref-name>
+ <service-qname>{http://org.jboss.ws/wsref}EndpointService</service-qname>
+ <port-component-ref>
+ <service-endpoint-interface>org.jboss.test.ws.jaxws.samples.webservicerefsec.Endpoint</service-endpoint-interface>
+ <port-qname>{http://org.jboss.ws/wsref}EndpointPort</port-qname>
+ <stub-property>
+ <prop-name>javax.xml.ws.security.auth.username</prop-name>
+ <prop-value>foo</prop-value>
+ </stub-property>
+ <stub-property>
+ <prop-name>javax.xml.ws.security.auth.password</prop-name>
+ <prop-value>bar</prop-value>
+ </stub-property>
+ </port-component-ref>
+ <wsdl-override>WEB-INF/wsdl/Endpoint.wsdl</wsdl-override>
+ </service-ref>
+
+</jboss-web>
\ No newline at end of file
Added: framework/trunk/testsuite/test/resources/jaxws/samples/webservicerefsec/WEB-INF/web.xml
===================================================================
--- framework/trunk/testsuite/test/resources/jaxws/samples/webservicerefsec/WEB-INF/web.xml (rev 0)
+++ framework/trunk/testsuite/test/resources/jaxws/samples/webservicerefsec/WEB-INF/web.xml 2010-05-13 08:23:30 UTC (rev 12222)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd">
+
+ <servlet>
+ <servlet-name>Client</servlet-name>
+ <servlet-class>org.jboss.test.ws.jaxws.samples.webservicerefsec.Client</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>Client</servlet-name>
+ <url-pattern>/*</url-pattern>
+ </servlet-mapping>
+</web-app>
\ No newline at end of file
Added: framework/trunk/testsuite/test/resources/jaxws/samples/webservicerefsec/WEB-INF/wsdl/Endpoint.wsdl
===================================================================
--- framework/trunk/testsuite/test/resources/jaxws/samples/webservicerefsec/WEB-INF/wsdl/Endpoint.wsdl (rev 0)
+++ framework/trunk/testsuite/test/resources/jaxws/samples/webservicerefsec/WEB-INF/wsdl/Endpoint.wsdl 2010-05-13 08:23:30 UTC (rev 12222)
@@ -0,0 +1,36 @@
+<definitions name='EndpointService' targetNamespace='http://org.jboss.ws/wsref' xmlns='http://schemas.xmlsoap.org/wsdl/' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://org.jboss.ws/wsref' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
+
+ <message name='Endpoint_echo'>
+ <part name='arg0' type='xsd:string'/>
+ </message>
+ <message name='Endpoint_echoResponse'>
+ <part name='return' type='xsd:string'/>
+ </message>
+
+ <portType name='Endpoint'>
+ <operation name='echo' parameterOrder='arg0'>
+ <input message='tns:Endpoint_echo'/>
+ <output message='tns:Endpoint_echoResponse'/>
+ </operation>
+ </portType>
+
+ <binding name='EndpointBinding' type='tns:Endpoint'>
+ <soap:binding style='rpc' transport='http://schemas.xmlsoap.org/soap/http'/>
+ <operation name='echo'>
+ <soap:operation soapAction=''/>
+ <input>
+ <soap:body namespace='http://org.jboss.ws/wsref' use='literal'/>
+ </input>
+ <output>
+ <soap:body namespace='http://org.jboss.ws/wsref' use='literal'/>
+ </output>
+ </operation>
+ </binding>
+
+ <service name='EndpointService'>
+ <port binding='tns:EndpointBinding' name='EndpointPort'>
+ <soap:address location='http://@jboss.bind.address@:8080/jaxws-samples-webservicerefsec'/>
+ </port>
+ </service>
+
+</definitions>
14 years, 7 months