JBossWS SVN: r18972 - common/trunk/src/main/java/org/jboss/ws/common/configuration.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2014-10-03 18:02:20 -0400 (Fri, 03 Oct 2014)
New Revision: 18972
Modified:
common/trunk/src/main/java/org/jboss/ws/common/configuration/ConfigHelper.java
Log:
[JBWS-3836] Also support default client config files when using ClientConfigurer API
Modified: common/trunk/src/main/java/org/jboss/ws/common/configuration/ConfigHelper.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/configuration/ConfigHelper.java 2014-10-03 16:55:15 UTC (rev 18971)
+++ common/trunk/src/main/java/org/jboss/ws/common/configuration/ConfigHelper.java 2014-10-03 22:02:20 UTC (rev 18972)
@@ -34,6 +34,7 @@
import javax.xml.ws.Binding;
import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Dispatch;
import javax.xml.ws.handler.Handler;
import javax.xml.ws.handler.LogicalHandler;
import javax.xml.ws.handler.soap.SOAPHandler;
@@ -74,7 +75,8 @@
@Override
public void setConfigHandlers(BindingProvider port, String configFile, String configName)
{
- ClientConfig config = readConfig(configFile, configName);
+ Class<?> clazz = !(port instanceof Dispatch) ? port.getClass() : null;
+ ClientConfig config = readConfig(configFile, configName, clazz);
setupConfigHandlers(port.getBinding(), config);
}
@@ -84,7 +86,7 @@
throw MESSAGES.operationNotSupportedBy("setConfigProperties", this.getClass());
}
- protected ClientConfig readConfig(String configFile, String configName) {
+ protected ClientConfig readConfig(String configFile, String configName, Class<?> clientProxyClass) {
if (configFile != null) {
InputStream is = null;
try
@@ -92,9 +94,20 @@
is = SecurityActions.getContextClassLoader().getResourceAsStream(configFile);
if (is != null) {
ConfigRoot config = ConfigMetaDataParser.parse(is);
- ClientConfig cc = config != null ? config.getClientConfigByName(configName) : null;
- if (cc != null) {
- return cc;
+ if (config != null) {
+ if (configName == null) {
+ for (Class<?> itf : clientProxyClass.getInterfaces()) {
+ ClientConfig cc = config.getClientConfigByName(itf.getName());
+ if (cc != null) {
+ return cc;
+ }
+ }
+ } else {
+ ClientConfig cc = config.getClientConfigByName(configName);
+ if (cc != null) {
+ return cc;
+ }
+ }
}
}
}
@@ -111,13 +124,43 @@
}
}
} else {
- ServerConfig sc = getServerConfig();
- if (sc != null) {
- ClientConfig cf = sc.getClientConfig(configName);
- if (cf != null) {
- return cf;
+ if (configName != null) {
+ InputStream is = null;
+ try
+ {
+ is = SecurityActions.getContextClassLoader().getResourceAsStream(ClientConfig.DEFAULT_CLIENT_CONFIG_FILE);
+ if (is != null) {
+ ConfigRoot config = ConfigMetaDataParser.parse(is);
+ ClientConfig cc = config != null ? config.getClientConfigByName(configName) : null;
+ if (cc != null) {
+ return cc;
+ }
+ }
}
+ catch (Exception e)
+ {
+ throw MESSAGES.couldNotReadConfiguration(configFile, e);
+ }
+ finally
+ {
+ if (is != null) {
+ try {
+ is.close();
+ } catch (IOException e) { } //ignore
+ }
+ }
}
+ try {
+ ServerConfig sc = getServerConfig();
+ if (sc != null) {
+ ClientConfig cf = sc.getClientConfig(configName);
+ if (cf != null) {
+ return cf;
+ }
+ }
+ } catch (Exception e) {
+ throw MESSAGES.configurationNotFound(configName);
+ }
}
throw MESSAGES.configurationNotFound(configName);
}
10 years, 2 months
JBossWS SVN: r18971 - stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2014-10-03 12:55:15 -0400 (Fri, 03 Oct 2014)
New Revision: 18971
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/ClientConfigurationTestCaseForked.java
Log:
Remove useless dep
Modified: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/ClientConfigurationTestCaseForked.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/ClientConfigurationTestCaseForked.java 2014-10-03 16:10:29 UTC (rev 18970)
+++ stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/ClientConfigurationTestCaseForked.java 2014-10-03 16:55:15 UTC (rev 18971)
@@ -45,12 +45,6 @@
{
public static BaseDeployment<?>[] createDeployments() {
List<BaseDeployment<?>> list = new LinkedList<BaseDeployment<?>>();
- list.add(new JBossWSTestHelper.JarDeployment("jaxws-clientConfig-client.jar") { {
- archive
- .addManifest()
- .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/clientConfig/META-INF/jaxws-client-config.xml"), "jaxws-client-config.xml");
- }
- });
list.add(new JBossWSTestHelper.WarDeployment("jaxws-clientConfig-inContainer-client.war") { {
archive
.setManifest(new StringAsset("Manifest-Version: 1.0\n"
10 years, 2 months
JBossWS SVN: r18970 - in stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws: jbws3282 and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2014-10-03 12:10:29 -0400 (Fri, 03 Oct 2014)
New Revision: 18970
Added:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/Endpoint2.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/jaxws-client-config.xml
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/ClientConfigurationTestCaseForked.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/Helper.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3282/Helper.java
Log:
[JBWS-3836] Improving and extending tests
Modified: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/ClientConfigurationTestCaseForked.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/ClientConfigurationTestCaseForked.java 2014-10-03 16:09:51 UTC (rev 18969)
+++ stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/ClientConfigurationTestCaseForked.java 2014-10-03 16:10:29 UTC (rev 18970)
@@ -60,6 +60,8 @@
.addClass(org.jboss.test.helper.TestServlet.class)
.addClass(org.jboss.test.ws.jaxws.clientConfig.CustomHandler.class)
.addClass(org.jboss.test.ws.jaxws.clientConfig.Endpoint.class)
+ .addClass(org.jboss.test.ws.jaxws.clientConfig.Endpoint2.class)
+ .addAsResource("org/jboss/test/ws/jaxws/clientConfig/jaxws-client-config.xml", "jaxws-client-config.xml")
.addClass(org.jboss.test.ws.jaxws.clientConfig.Helper.class)
.addClass(org.jboss.test.ws.jaxws.clientConfig.LogHandler.class)
.addClass(org.jboss.test.ws.jaxws.clientConfig.RoutingHandler.class)
@@ -104,10 +106,17 @@
public void testSEIClassDefaultClientConfigurationInContainer() throws Exception {
assertEquals("1", runTestInContainer("testSEIClassDefaultClientConfiguration"));
}
+ //no corresponding test on Dispatch, as that has no SEI
- public void testSEIClassDefaultClientConfigurationOnDispatchInContainer() throws Exception {
- assertEquals("1", runTestInContainer("testSEIClassDefaultClientConfigurationOnDispatch"));
+ /**
+ * Verifies the SEI class FQN client configuration from default conf file
+ *
+ * @throws Exception
+ */
+ public void testSEIClassDefaultFileClientConfigurationInContainer() throws Exception {
+ assertEquals("1", runTestInContainer("testSEIClassDefaultFileClientConfiguration"));
}
+ //no corresponding test on Dispatch, as that has no SEI
/**
* Verifies a client configuration from AS model can be set
Added: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/Endpoint2.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/Endpoint2.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/Endpoint2.java 2014-10-03 16:10:29 UTC (rev 18970)
@@ -0,0 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.clientConfig;
+
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+@WebService(name="Endpoint")
+@SOAPBinding(style = SOAPBinding.Style.RPC)
+public interface Endpoint2
+{
+ public String echo(String input);
+}
Property changes on: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/Endpoint2.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Modified: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/Helper.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/Helper.java 2014-10-03 16:09:51 UTC (rev 18969)
+++ stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/Helper.java 2014-10-03 16:10:29 UTC (rev 18970)
@@ -462,11 +462,20 @@
}
}
- public boolean testSEIClassDefaultClientConfigurationOnDispatch() throws Exception
+ /**
+ * This test hacks the current ServerConfig temporarily adding a test client configuration
+ * (named as the Endoint SEI class FQN)- Then it calls the sends messages to the same endpoint,
+ * initially using the Endpoint SEI and then using the Endpoint2 SEI. The two port proxies are
+ * expected to behave differently because of a default jaxws-client-config.xml descriptor
+ * including a configuration for Endpoint2 SEI class FQN. The test eventually removes the test
+ * client configuration from the ServerConfig.
+ *
+ * @return
+ * @throws Exception
+ */
+ public boolean testSEIClassDefaultFileClientConfiguration() throws Exception
{
- final String reqString = "<ns1:echo xmlns:ns1=\"http://clientConfig.jaxws.ws.test.jboss.org/\"><arg0>Kermit</arg0></ns1:echo>";
QName serviceName = new QName("http://clientConfig.jaxws.ws.test.jboss.org/", "EndpointImplService");
- QName portName = new QName("http://clientConfig.jaxws.ws.test.jboss.org/", "EndpointPort");
URL wsdlURL = new URL(address + "?wsdl");
final String testConfigName = "org.jboss.test.ws.jaxws.clientConfig.Endpoint";
@@ -477,19 +486,29 @@
// --
Service service = Service.create(wsdlURL, serviceName);
- Dispatch<Source> dispatch = service.createDispatch(portName, Source.class, Mode.PAYLOAD);
+ Endpoint port = (Endpoint)service.getPort(Endpoint.class);
- BindingProvider bp = (BindingProvider)dispatch;
+ BindingProvider bp = (BindingProvider)port;
@SuppressWarnings("rawtypes")
List<Handler> hc = bp.getBinding().getHandlerChain();
hc.add(new UserHandler());
bp.getBinding().setHandlerChain(hc);
- ClientConfigUtil.setConfigHandlers(bp, null, testConfigName);
+ String resStr = port.echo("Kermit");
+ if (!"Kermit|RoutOut|UserOut|endpoint|UserIn|RoutIn".equals(resStr)) {
+ return false;
+ }
+
+ Endpoint2 port2 = (Endpoint2)service.getPort(Endpoint2.class);
- Source resSource = dispatch.invoke(new DOMSource(DOMUtils.parse(reqString)));
- String resStr = DOMUtils.getTextContent(DOMUtils.sourceToElement(resSource).getElementsByTagName("return").item(0));
- return ("Kermit|RoutOut|UserOut|endpoint|UserIn|RoutIn".equals(resStr));
+ bp = (BindingProvider)port2;
+ hc = bp.getBinding().getHandlerChain();
+ hc.add(new UserHandler());
+ bp.getBinding().setHandlerChain(hc);
+
+ resStr = port2.echo("Kermit");
+ return ("Kermit|RoutOut|UserOut|LogOut|endpoint|LogIn|UserIn|RoutIn".equals(resStr));
+
}
finally
{
Added: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/jaxws-client-config.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/jaxws-client-config.xml (rev 0)
+++ stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/jaxws-client-config.xml 2014-10-03 16:10:29 UTC (rev 18970)
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jaxws-config xmlns="urn:jboss:jbossws-jaxws-config:4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:javaee="http://java.sun.com/xml/ns/javaee"
+ xsi:schemaLocation="urn:jboss:jbossws-jaxws-config:4.0 schema/jbossws-jaxws-config_4_0.xsd">
+
+ <client-config>
+ <config-name>org.jboss.test.ws.jaxws.clientConfig.Endpoint2</config-name>
+ <pre-handler-chains>
+ <javaee:handler-chain>
+ <javaee:handler>
+ <javaee:handler-name>Routing Handler</javaee:handler-name>
+ <javaee:handler-class>org.jboss.test.ws.jaxws.clientConfig.RoutingHandler</javaee:handler-class>
+ </javaee:handler>
+ </javaee:handler-chain>
+ </pre-handler-chains>
+ <post-handler-chains>
+ <javaee:handler-chain>
+ <javaee:handler>
+ <javaee:handler-name>Log Handler</javaee:handler-name>
+ <javaee:handler-class>org.jboss.test.ws.jaxws.clientConfig.LogHandler</javaee:handler-class>
+ </javaee:handler>
+ </javaee:handler-chain>
+ </post-handler-chains>
+ </client-config>
+
+</jaxws-config>
\ No newline at end of file
Property changes on: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/jaxws-client-config.xml
___________________________________________________________________
Added: svn:mime-type
+ text/xml
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Modified: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3282/Helper.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3282/Helper.java 2014-10-03 16:09:51 UTC (rev 18969)
+++ stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3282/Helper.java 2014-10-03 16:10:29 UTC (rev 18970)
@@ -21,44 +21,15 @@
*/
package org.jboss.test.ws.jaxws.jbws3282;
-import java.net.URL;
-
-import javax.xml.namespace.QName;
-import javax.xml.ws.Service;
-
import org.jboss.test.helper.ClientHelper;
import org.jboss.wsf.spi.metadata.config.EndpointConfig;
public class Helper implements ClientHelper
{
- private final String targetNS = "http://jbws3282.jaxws.ws.test.jboss.org/";
private final String testConfig = "org.jboss.test.ws.jaxws.jbws3282.Endpoint2Impl";
private String address;
private static volatile EndpointConfig defaultEndpointConfig;
- public boolean testHandlerChainVanillaServer() throws Exception
- {
- QName serviceName = new QName(targetNS, "Endpoint2ImplService");
- URL wsdlURL = new URL(address + "/ep2?wsdl");
- Service service = Service.create(wsdlURL, serviceName);
- Endpoint port = (Endpoint)service.getPort(Endpoint.class);
- String resStr = port.echo("Kermit");
- if (!"Kermit|EpIn|endpoint2|EpOut".equals(resStr)) {
- return false;
- }
-
- serviceName = new QName(targetNS, "Endpoint3ImplService");
- wsdlURL = new URL(address + "/ep3?wsdl");
- service = Service.create(wsdlURL, serviceName);
- port = (Endpoint)service.getPort(Endpoint.class);
- resStr = port.echo("Kermit");
- if (!"Kermit|EpIn|endpoint3|EpOut".equals(resStr)) {
- return false;
- }
-
- return true;
- }
-
public boolean setupConfigurations() throws Exception
{
defaultEndpointConfig = TestUtils.getAndVerifyDefaultEndpointConfiguration();
@@ -75,39 +46,6 @@
return true;
}
- public boolean testHandlerChainModifiedServer() throws Exception
- {
- final EndpointConfig defaultEndpointConfig = TestUtils.getAndVerifyDefaultEndpointConfiguration();
- final String testConfig = "org.jboss.test.ws.jaxws.jbws3282.Endpoint2Impl";
- try {
- TestUtils.addTestCaseEndpointConfiguration(testConfig);
- TestUtils.changeDefaultEndpointConfiguration();
-
- QName serviceName = new QName(targetNS, "Endpoint2ImplService");
- URL wsdlURL = new URL(address + "/ep2?wsdl");
- Service service = Service.create(wsdlURL, serviceName);
- Endpoint port = (Endpoint)service.getPort(Endpoint.class);
- String resStr = port.echo("Kermit");
- if (!"Kermit|RoutIn|EpIn|endpoint2|EpOut|RoutOut".equals(resStr)) {
- return false;
- }
-
- serviceName = new QName(targetNS, "Endpoint3ImplService");
- wsdlURL = new URL(address + "/ep3?wsdl");
- service = Service.create(wsdlURL, serviceName);
- port = (Endpoint)service.getPort(Endpoint.class);
- resStr = port.echo("Kermit");
- if (!"Kermit|EpIn|LogIn|endpoint3|LogOut|EpOut".equals(resStr)) {
- return false;
- }
-
- return true;
- } finally {
- TestUtils.setEndpointConfigAndReload(defaultEndpointConfig);
- TestUtils.removeTestCaseEndpointConfiguration(testConfig);
- }
- }
-
@Override
public void setTargetEndpoint(String address)
{
10 years, 2 months
JBossWS SVN: r18969 - stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2014-10-03 12:09:51 -0400 (Fri, 03 Oct 2014)
New Revision: 18969
Modified:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ProviderImpl.java
Log:
[JBWS-3836] Adding support for default client config file when no configuration is specified
Modified: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ProviderImpl.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ProviderImpl.java 2014-10-03 16:08:10 UTC (rev 18968)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ProviderImpl.java 2014-10-03 16:09:51 UTC (rev 18969)
@@ -21,12 +21,15 @@
*/
package org.jboss.wsf.stack.cxf.client;
+import static org.jboss.ws.common.Messages.MESSAGES;
import static org.jboss.wsf.stack.cxf.client.Constants.NEW_BUS_STRATEGY;
import static org.jboss.wsf.stack.cxf.client.Constants.TCCL_BUS_STRATEGY;
import static org.jboss.wsf.stack.cxf.client.Constants.THREAD_BUS_STRATEGY;
import static org.jboss.wsf.stack.cxf.client.SecurityActions.getContextClassLoader;
import static org.jboss.wsf.stack.cxf.client.SecurityActions.setContextClassLoader;
+import java.io.IOException;
+import java.io.InputStream;
import java.net.URL;
import java.security.AccessController;
import java.security.PrivilegedAction;
@@ -61,6 +64,8 @@
import org.jboss.wsf.spi.classloading.ClassLoaderProvider;
import org.jboss.wsf.spi.management.ServerConfig;
import org.jboss.wsf.spi.metadata.config.ClientConfig;
+import org.jboss.wsf.spi.metadata.config.ConfigMetaDataParser;
+import org.jboss.wsf.spi.metadata.config.ConfigRoot;
import org.jboss.wsf.stack.cxf.Loggers;
import org.jboss.wsf.stack.cxf.Messages;
import org.jboss.wsf.stack.cxf.client.configuration.CXFClientConfigurer;
@@ -567,7 +572,7 @@
Mode mode,
WebServiceFeature... features) {
Dispatch<T> dispatch = super.createDispatch(portName, type, context, mode, features);
- setupClient(dispatch, type, features);
+ setupClient(dispatch, null, features);
return dispatch;
}
@@ -575,19 +580,11 @@
Binding binding = ((BindingProvider)obj).getBinding();
Client client = obj instanceof DispatchImpl<?> ? ((DispatchImpl<?>)obj).getClient() : ClientProxy.getClient(obj);
client.getOutInterceptors().add(new HandlerChainSortInterceptor(binding));
- if (ClassLoaderProvider.isSet()) { //optimization for avoiding checking for a server config when we know for sure we're out-of-container
- ServerConfig sc = getServerConfig();
- if (sc != null) {
- ClientConfig config = sc.getClientConfig(seiClass.getName());
- if (config == null) {
- config = sc.getClientConfig(ClientConfig.STANDARD_CLIENT_CONFIG);
- }
- if (config != null) {
- CXFClientConfigurer helper = new CXFClientConfigurer();
- helper.setupConfigHandlers(binding, config);
- helper.setConfigProperties(client, config.getProperties());
- }
- }
+ ClientConfig config = readConfig(seiClass);
+ if (config != null) {
+ CXFClientConfigurer helper = new CXFClientConfigurer();
+ helper.setupConfigHandlers(binding, config);
+ helper.setConfigProperties(client, config.getProperties());
}
if (features != null) {
for (WebServiceFeature f : features) {
@@ -604,6 +601,52 @@
}
return AccessController.doPrivileged(AbstractServerConfig.GET_SERVER_INTEGRATION_SERVER_CONFIG);
}
+
+ private static ClientConfig readConfig(Class<?> seiClass) {
+ final String configName;
+ if (seiClass == null) { //nothing to do for Dispatch, as there's no SEI
+ configName = null;
+ } else {
+ configName = seiClass.getName();
+ InputStream is = null;
+ try
+ {
+ is = seiClass.getResourceAsStream("/" + ClientConfig.DEFAULT_CLIENT_CONFIG_FILE);
+ if (is != null) {
+ ConfigRoot config = ConfigMetaDataParser.parse(is);
+ ClientConfig cc = config != null ? config.getClientConfigByName(configName) : null;
+ if (cc != null) {
+ return cc;
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ throw MESSAGES.couldNotReadConfiguration(ClientConfig.DEFAULT_CLIENT_CONFIG_FILE, e);
+ }
+ finally
+ {
+ if (is != null) {
+ try {
+ is.close();
+ } catch (IOException e) { } //ignore
+ }
+ }
+ }
+ if (ClassLoaderProvider.isSet()) { //optimization for avoiding checking for a server config when we know for sure we're out-of-container
+ ServerConfig sc = getServerConfig();
+ if (sc != null) {
+ ClientConfig cf = configName != null ? sc.getClientConfig(configName) : null;
+ if (cf == null) {
+ cf = sc.getClientConfig(ClientConfig.STANDARD_CLIENT_CONFIG);
+ }
+ if (cf != null) {
+ return cf;
+ }
+ }
+ }
+ return null;
+ }
}
}
10 years, 2 months
JBossWS SVN: r18968 - spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/config.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2014-10-03 12:08:10 -0400 (Fri, 03 Oct 2014)
New Revision: 18968
Modified:
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/config/ConfigRoot.java
Log:
[JBWS-3836] Do not fallback to the only existing conf in a file, always require a name match
Modified: spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/config/ConfigRoot.java
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/config/ConfigRoot.java 2014-10-03 09:04:58 UTC (rev 18967)
+++ spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/config/ConfigRoot.java 2014-10-03 16:08:10 UTC (rev 18968)
@@ -77,9 +77,6 @@
}
}
- if (config == null && clientConfigList.size() == 1)
- config = clientConfigList.get(0);
-
return config;
}
@@ -95,9 +92,6 @@
}
}
- if (config == null && endpointConfigList.size() == 1)
- config = endpointConfigList.get(0);
-
return config;
}
10 years, 2 months
JBossWS SVN: r18967 - in stack/cxf/trunk/modules/testsuite/shared-tests/src/test: java/org/jboss/test/ws/jaxws/jbws3282 and 3 other directories.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2014-10-03 05:04:58 -0400 (Fri, 03 Oct 2014)
New Revision: 18967
Added:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3282/Endpoint2Impl.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3282/Endpoint3Impl.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3282/Endpoint4Impl.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3282/Endpoint5Impl.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3282/Endpoint6Impl.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3282/HandlerChainTestCaseForked.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3282/Helper.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3282/TestUtils.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/resources/jaxws/jbws3282/META-INF/
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/resources/jaxws/jbws3282/META-INF/permissions.xml
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/resources/jaxws/jbws3282/WEB-INF/my-endpoint-config.xml
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/resources/jaxws/jbws3282/WEB-INF/web-f.xml
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/ClientConfigurationTestCaseForked.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/Helper.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3282/EndpointImpl.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3282/HandlerChainTestCase.java
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/resources/jaxws/jbws3282/WEB-INF/jaxws-endpoint-config.xml
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/resources/jaxws/jbws3282/WEB-INF/web.xml
Log:
[JBWS-3836] Addign some tests
Modified: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/ClientConfigurationTestCaseForked.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/ClientConfigurationTestCaseForked.java 2014-10-03 09:03:48 UTC (rev 18966)
+++ stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/ClientConfigurationTestCaseForked.java 2014-10-03 09:04:58 UTC (rev 18967)
@@ -97,6 +97,19 @@
}
/**
+ * Verifies the SEI class FQN default client configuration from AS model is used
+ *
+ * @throws Exception
+ */
+ public void testSEIClassDefaultClientConfigurationInContainer() throws Exception {
+ assertEquals("1", runTestInContainer("testSEIClassDefaultClientConfiguration"));
+ }
+
+ public void testSEIClassDefaultClientConfigurationOnDispatchInContainer() throws Exception {
+ assertEquals("1", runTestInContainer("testSEIClassDefaultClientConfigurationOnDispatch"));
+ }
+
+ /**
* Verifies a client configuration from AS model can be set
*
* @throws Exception
Modified: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/Helper.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/Helper.java 2014-10-03 09:03:48 UTC (rev 18966)
+++ stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/clientConfig/Helper.java 2014-10-03 09:04:58 UTC (rev 18967)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2014, 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.
*
@@ -422,6 +422,83 @@
}
}
+ /**
+ * This test hacks the current ServerConfig temporarily adding a test client configuration
+ * (named as the SEI class FQN), let the container use that for the test client and
+ * finally removes it from the ServerConfig.
+ *
+ * @return
+ * @throws Exception
+ */
+ public boolean testSEIClassDefaultClientConfiguration() throws Exception
+ {
+ QName serviceName = new QName("http://clientConfig.jaxws.ws.test.jboss.org/", "EndpointImplService");
+ URL wsdlURL = new URL(address + "?wsdl");
+
+ final String testConfigName = "org.jboss.test.ws.jaxws.clientConfig.Endpoint";
+ try
+ {
+ //-- add test client configuration
+ TestUtils.addTestCaseClientConfiguration(testConfigName);
+ // --
+
+ Service service = Service.create(wsdlURL, serviceName);
+ Endpoint port = (Endpoint)service.getPort(Endpoint.class);
+
+ BindingProvider bp = (BindingProvider)port;
+ @SuppressWarnings("rawtypes")
+ List<Handler> hc = bp.getBinding().getHandlerChain();
+ hc.add(new UserHandler());
+ bp.getBinding().setHandlerChain(hc);
+
+ String resStr = port.echo("Kermit");
+ return ("Kermit|RoutOut|UserOut|endpoint|UserIn|RoutIn".equals(resStr));
+ }
+ finally
+ {
+ // -- remove test client configuration --
+ TestUtils.removeTestCaseClientConfiguration(testConfigName);
+ // --
+ }
+ }
+
+ public boolean testSEIClassDefaultClientConfigurationOnDispatch() throws Exception
+ {
+ final String reqString = "<ns1:echo xmlns:ns1=\"http://clientConfig.jaxws.ws.test.jboss.org/\"><arg0>Kermit</arg0></ns1:echo>";
+ QName serviceName = new QName("http://clientConfig.jaxws.ws.test.jboss.org/", "EndpointImplService");
+ QName portName = new QName("http://clientConfig.jaxws.ws.test.jboss.org/", "EndpointPort");
+ URL wsdlURL = new URL(address + "?wsdl");
+
+ final String testConfigName = "org.jboss.test.ws.jaxws.clientConfig.Endpoint";
+ try
+ {
+ //-- add test client configuration
+ TestUtils.addTestCaseClientConfiguration(testConfigName);
+ // --
+
+ Service service = Service.create(wsdlURL, serviceName);
+ Dispatch<Source> dispatch = service.createDispatch(portName, Source.class, Mode.PAYLOAD);
+
+ BindingProvider bp = (BindingProvider)dispatch;
+ @SuppressWarnings("rawtypes")
+ List<Handler> hc = bp.getBinding().getHandlerChain();
+ hc.add(new UserHandler());
+ bp.getBinding().setHandlerChain(hc);
+
+ ClientConfigUtil.setConfigHandlers(bp, null, testConfigName);
+
+ Source resSource = dispatch.invoke(new DOMSource(DOMUtils.parse(reqString)));
+ String resStr = DOMUtils.getTextContent(DOMUtils.sourceToElement(resSource).getElementsByTagName("return").item(0));
+ return ("Kermit|RoutOut|UserOut|endpoint|UserIn|RoutIn".equals(resStr));
+ }
+ finally
+ {
+ // -- remove test client configuration --
+ TestUtils.removeTestCaseClientConfiguration(testConfigName);
+ // --
+ }
+ }
+
@Override
public void setTargetEndpoint(String address)
{
Added: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3282/Endpoint2Impl.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3282/Endpoint2Impl.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3282/Endpoint2Impl.java 2014-10-03 09:04:58 UTC (rev 18967)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, 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.jbws3282;
+
+import javax.jws.HandlerChain;
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+import org.jboss.logging.Logger;
+
+@WebService(name="Endpoint")
+@SOAPBinding(style = SOAPBinding.Style.RPC)
+@HandlerChain(file = "jaxws-handlers-server.xml") // relative path from the class file
+public class Endpoint2Impl
+{
+ // Provide logging
+ private static Logger log = Logger.getLogger(Endpoint2Impl.class);
+
+ @WebMethod
+ public String echo(String input)
+ {
+ log.info("echo2: " + input);
+ return input + "|endpoint2";
+ }
+}
Property changes on: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3282/Endpoint2Impl.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3282/Endpoint3Impl.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3282/Endpoint3Impl.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3282/Endpoint3Impl.java 2014-10-03 09:04:58 UTC (rev 18967)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, 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.jbws3282;
+
+import javax.jws.HandlerChain;
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+import org.jboss.logging.Logger;
+
+@WebService(name="Endpoint")
+@SOAPBinding(style = SOAPBinding.Style.RPC)
+@HandlerChain(file = "jaxws-handlers-server.xml") // relative path from the class file
+public class Endpoint3Impl
+{
+ // Provide logging
+ private static Logger log = Logger.getLogger(Endpoint3Impl.class);
+
+ @WebMethod
+ public String echo(String input)
+ {
+ log.info("echo3: " + input);
+ return input + "|endpoint3";
+ }
+}
Property changes on: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3282/Endpoint3Impl.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3282/Endpoint4Impl.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3282/Endpoint4Impl.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3282/Endpoint4Impl.java 2014-10-03 09:04:58 UTC (rev 18967)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, 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.jbws3282;
+
+import javax.jws.HandlerChain;
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+import org.jboss.logging.Logger;
+
+@WebService(name="Endpoint")
+@SOAPBinding(style = SOAPBinding.Style.RPC)
+@HandlerChain(file = "jaxws-handlers-server.xml") // relative path from the class file
+public class Endpoint4Impl
+{
+ // Provide logging
+ private static Logger log = Logger.getLogger(Endpoint4Impl.class);
+
+ @WebMethod
+ public String echo(String input)
+ {
+ log.info("echo4: " + input);
+ return input + "|endpoint4";
+ }
+}
Property changes on: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3282/Endpoint4Impl.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3282/Endpoint5Impl.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3282/Endpoint5Impl.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3282/Endpoint5Impl.java 2014-10-03 09:04:58 UTC (rev 18967)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, 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.jbws3282;
+
+import javax.jws.HandlerChain;
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.api.annotation.EndpointConfig;
+
+@WebService(name="Endpoint")
+@SOAPBinding(style = SOAPBinding.Style.RPC)
+@EndpointConfig(configFile = "WEB-INF/my-endpoint-config.xml")
+@HandlerChain(file = "jaxws-handlers-server.xml") // relative path from the class file
+public class Endpoint5Impl
+{
+ // Provide logging
+ private static Logger log = Logger.getLogger(Endpoint5Impl.class);
+
+ @WebMethod
+ public String echo(String input)
+ {
+ log.info("echo5: " + input);
+ return input + "|endpoint5";
+ }
+}
Property changes on: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3282/Endpoint5Impl.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3282/Endpoint6Impl.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3282/Endpoint6Impl.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3282/Endpoint6Impl.java 2014-10-03 09:04:58 UTC (rev 18967)
@@ -0,0 +1,47 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, 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.jbws3282;
+
+import javax.jws.HandlerChain;
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.api.annotation.EndpointConfig;
+
+@WebService(name="Endpoint")
+@SOAPBinding(style = SOAPBinding.Style.RPC)
+@EndpointConfig(configName = "EP6-config")
+@HandlerChain(file = "jaxws-handlers-server.xml") // relative path from the class file
+public class Endpoint6Impl
+{
+ // Provide logging
+ private static Logger log = Logger.getLogger(Endpoint6Impl.class);
+
+ @WebMethod
+ public String echo(String input)
+ {
+ log.info("echo6: " + input);
+ return input + "|endpoint6";
+ }
+}
Property changes on: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3282/Endpoint6Impl.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Modified: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3282/EndpointImpl.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3282/EndpointImpl.java 2014-10-03 09:03:48 UTC (rev 18966)
+++ stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3282/EndpointImpl.java 2014-10-03 09:04:58 UTC (rev 18967)
@@ -31,7 +31,7 @@
@WebService(name="Endpoint")
@SOAPBinding(style = SOAPBinding.Style.RPC)
-@EndpointConfig(configFile = "WEB-INF/jaxws-endpoint-config.xml", configName = "Custom Endpoint")
+@EndpointConfig(configFile = "WEB-INF/my-endpoint-config.xml", configName = "Custom Endpoint")
@HandlerChain(file = "jaxws-handlers-server.xml") // relative path from the class file
public class EndpointImpl
{
Modified: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3282/HandlerChainTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3282/HandlerChainTestCase.java 2014-10-03 09:03:48 UTC (rev 18966)
+++ stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3282/HandlerChainTestCase.java 2014-10-03 09:04:58 UTC (rev 18967)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2014, 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.
*
@@ -40,13 +40,14 @@
* Test the handlers (pre/post) declaration in jaxws endpoint configuration
*
* https://issues.jboss.org/browse/JBWS-3282
+ * https://issues.jboss.org/browse/JBWS-3836
*
* @author alessio.soldano(a)jboss.com
* @since 03-May-2011
*/
public class HandlerChainTestCase extends JBossWSTest
{
- private static final String targetNS = "http://jbws3282.jaxws.ws.test.jboss.org/";
+ private final String targetNS = "http://jbws3282.jaxws.ws.test.jboss.org/";
public static BaseDeployment<?>[] createDeployments() {
List<BaseDeployment<?>> list = new LinkedList<BaseDeployment<?>>();
@@ -57,10 +58,14 @@
.addClass(org.jboss.test.ws.jaxws.jbws3282.Endpoint.class)
.addClass(org.jboss.test.ws.jaxws.jbws3282.EndpointHandler.class)
.addClass(org.jboss.test.ws.jaxws.jbws3282.EndpointImpl.class)
+ .addClass(org.jboss.test.ws.jaxws.jbws3282.Endpoint4Impl.class)
+ .addClass(org.jboss.test.ws.jaxws.jbws3282.Endpoint5Impl.class)
+ .addClass(org.jboss.test.ws.jaxws.jbws3282.Endpoint6Impl.class)
.addClass(org.jboss.test.ws.jaxws.jbws3282.LogHandler.class)
.addClass(org.jboss.test.ws.jaxws.jbws3282.RoutingHandler.class)
.addAsResource("org/jboss/test/ws/jaxws/jbws3282/jaxws-handlers-server.xml")
- .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws3282/WEB-INF/jaxws-endpoint-config.xml"), "jaxws-endpoint-config.xml")
+ .addAsResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws3282/WEB-INF/jaxws-endpoint-config.xml"))
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws3282/WEB-INF/my-endpoint-config.xml"), "my-endpoint-config.xml")
.setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws3282/WEB-INF/web.xml"));
}
});
@@ -75,7 +80,7 @@
public void testHandlerChain() throws Exception
{
QName serviceName = new QName(targetNS, "EndpointImplService");
- URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-jbws3282/TestService?wsdl");
+ URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-jbws3282/ep?wsdl");
Service service = Service.create(wsdlURL, serviceName);
Endpoint port = (Endpoint)service.getPort(Endpoint.class);
@@ -83,4 +88,57 @@
String resStr = port.echo("Kermit");
assertEquals("Kermit|RoutIn|AuthIn|EpIn|LogIn|endpoint|LogOut|EpOut|AuthOut|RoutOut", resStr);
}
+
+ /**
+ * [JBWS-3836] Test endpoint configuration from default file and named as the endpoint impl class
+ *
+ * @throws Exception
+ */
+ public void testHandlerChain4() throws Exception
+ {
+ QName serviceName = new QName(targetNS, "Endpoint4ImplService");
+ URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-jbws3282/ep4?wsdl");
+
+ Service service = Service.create(wsdlURL, serviceName);
+ Endpoint port = (Endpoint)service.getPort(Endpoint.class);
+
+ String resStr = port.echo("Kermit");
+ assertEquals("Kermit|RoutIn|EpIn|LogIn|endpoint4|LogOut|EpOut|RoutOut", resStr);
+ }
+
+ /**
+ * [JBWS-3836] Test endpoint configuration from custom file and named as the endpoint impl class
+ * @EndpointConfig(configFile = "WEB-INF/my-endpoint-config.xml")
+ *
+ * @throws Exception
+ */
+ public void testHandlerChain5() throws Exception
+ {
+ QName serviceName = new QName(targetNS, "Endpoint5ImplService");
+ URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-jbws3282/ep5?wsdl");
+
+ Service service = Service.create(wsdlURL, serviceName);
+ Endpoint port = (Endpoint)service.getPort(Endpoint.class);
+
+ String resStr = port.echo("Kermit");
+ assertEquals("Kermit|EpIn|LogIn|endpoint5|LogOut|EpOut", resStr);
+ }
+
+ /**
+ * [JBWS-3836] Test endpoint configuration from default file and with a specified name
+ * @EndpointConfig(configName = "EP6-config")
+ *
+ * @throws Exception
+ */
+ public void testHandlerChain6() throws Exception
+ {
+ QName serviceName = new QName(targetNS, "Endpoint6ImplService");
+ URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-jbws3282/ep6?wsdl");
+
+ Service service = Service.create(wsdlURL, serviceName);
+ Endpoint port = (Endpoint)service.getPort(Endpoint.class);
+
+ String resStr = port.echo("Kermit");
+ assertEquals("Kermit|AuthIn|EpIn|LogIn|endpoint6|LogOut|EpOut|AuthOut", resStr);
+ }
}
Added: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3282/HandlerChainTestCaseForked.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3282/HandlerChainTestCaseForked.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3282/HandlerChainTestCaseForked.java 2014-10-03 09:04:58 UTC (rev 18967)
@@ -0,0 +1,150 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, 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.jbws3282;
+
+import java.io.File;
+import java.net.URL;
+import java.util.LinkedList;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+
+import junit.framework.Test;
+
+import org.jboss.shrinkwrap.api.asset.StringAsset;
+import org.jboss.ws.common.IOUtils;
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestHelper;
+import org.jboss.wsf.test.JBossWSTestHelper.BaseDeployment;
+import org.jboss.wsf.test.JBossWSTestSetup;
+
+/**
+ * Test the handlers (pre/post) declaration in jaxws endpoint configuration
+ *
+ * https://issues.jboss.org/browse/JBWS-3282
+ * https://issues.jboss.org/browse/JBWS-3836
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 03-Oct-2014
+ */
+public class HandlerChainTestCaseForked extends JBossWSTest
+{
+ private final String targetNS = "http://jbws3282.jaxws.ws.test.jboss.org/";
+
+ public static BaseDeployment<?>[] createDeployments() {
+ List<BaseDeployment<?>> list = new LinkedList<BaseDeployment<?>>();
+ list.add(new JBossWSTestHelper.WarDeployment("jaxws-jbws3832-f-inContainer-client.war") { {
+ archive
+ .setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ + "Dependencies: org.jboss.ws.cxf.jbossws-cxf-client\n"))
+ .addClass(org.jboss.test.ws.jaxws.jbws3282.Endpoint.class)
+ .addClass(org.jboss.test.ws.jaxws.jbws3282.Helper.class)
+ .addClass(org.jboss.test.ws.jaxws.jbws3282.TestUtils.class)
+ .addClass(org.jboss.test.helper.ClientHelper.class)
+ .addClass(org.jboss.test.helper.TestServlet.class)
+ .addAsManifestResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws3282/META-INF/permissions.xml"), "permissions.xml");
+ }
+ });
+ return list.toArray(new BaseDeployment<?>[list.size()]);
+ }
+
+ private static String DEP = JBossWSTestHelper.writeToFile(new JBossWSTestHelper.WarDeployment("jaxws-jbws3282-f.war") { {
+ archive
+ .addManifest()
+ .addClass(org.jboss.test.ws.jaxws.jbws3282.Endpoint.class)
+ .addClass(org.jboss.test.ws.jaxws.jbws3282.EndpointHandler.class)
+ .addClass(org.jboss.test.ws.jaxws.jbws3282.Endpoint2Impl.class)
+ .addClass(org.jboss.test.ws.jaxws.jbws3282.Endpoint3Impl.class)
+ .addClass(org.jboss.test.ws.jaxws.jbws3282.LogHandler.class)
+ .addClass(org.jboss.test.ws.jaxws.jbws3282.RoutingHandler.class)
+ .addAsResource("org/jboss/test/ws/jaxws/jbws3282/jaxws-handlers-server.xml")
+ .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/jbws3282/WEB-INF/web-f.xml"));
+ }
+ });
+
+ public static Test suite()
+ {
+ return new JBossWSTestSetup(HandlerChainTestCaseForked.class, JBossWSTestHelper.writeToFile(createDeployments()));
+ }
+
+ public void testHandlerChainVanillaServer() throws Exception
+ {
+ try {
+ JBossWSTestHelper.deploy(DEP);
+
+ QName serviceName = new QName(targetNS, "Endpoint2ImplService");
+ URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-jbws3282-f/ep2?wsdl");
+ Service service = Service.create(wsdlURL, serviceName);
+ Endpoint port = (Endpoint)service.getPort(Endpoint.class);
+ String resStr = port.echo("Kermit");
+ assertEquals("Kermit|EpIn|endpoint2|EpOut", resStr);
+
+ serviceName = new QName(targetNS, "Endpoint3ImplService");
+ wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-jbws3282-f/ep3?wsdl");
+ service = Service.create(wsdlURL, serviceName);
+ port = (Endpoint)service.getPort(Endpoint.class);
+ resStr = port.echo("Kermit");
+ assertEquals("Kermit|EpIn|endpoint3|EpOut", resStr);
+ } finally {
+ JBossWSTestHelper.undeploy(DEP);
+ }
+ }
+
+ public void testHandlerChainModifiedServer() throws Exception
+ {
+ try {
+ assertEquals("1", runTestInContainer("setupConfigurations"));
+ try {
+ JBossWSTestHelper.deploy(DEP);
+
+ QName serviceName = new QName(targetNS, "Endpoint2ImplService");
+ URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-jbws3282-f/ep2?wsdl");
+ Service service = Service.create(wsdlURL, serviceName);
+ Endpoint port = (Endpoint)service.getPort(Endpoint.class);
+ String resStr = port.echo("Kermit");
+ assertEquals("Kermit|EpIn|RoutIn|endpoint2|RoutOut|EpOut", resStr);
+
+ serviceName = new QName(targetNS, "Endpoint3ImplService");
+ wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-jbws3282-f/ep3?wsdl");
+ service = Service.create(wsdlURL, serviceName);
+ port = (Endpoint)service.getPort(Endpoint.class);
+ resStr = port.echo("Kermit");
+ assertEquals("Kermit|LogIn|EpIn|endpoint3|EpOut|LogOut", resStr);
+ } finally {
+ JBossWSTestHelper.undeploy(DEP);
+ }
+ } finally {
+ assertEquals("1", runTestInContainer("restoreConfigurations"));
+ }
+ }
+
+ // -------------------------
+
+ private String runTestInContainer(String test) throws Exception
+ {
+ URL url = new URL("http://" + getServerHost()
+ + ":8080/jaxws-jbws3832-f-inContainer-client?path=/jaxws-jbws3282-f&method=" + test
+ + "&helper=" + Helper.class.getName());
+ return IOUtils.readAndCloseStream(url.openStream());
+ }
+}
Property changes on: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3282/HandlerChainTestCaseForked.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3282/Helper.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3282/Helper.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3282/Helper.java 2014-10-03 09:04:58 UTC (rev 18967)
@@ -0,0 +1,116 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, 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.jbws3282;
+
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+
+import org.jboss.test.helper.ClientHelper;
+import org.jboss.wsf.spi.metadata.config.EndpointConfig;
+
+public class Helper implements ClientHelper
+{
+ private final String targetNS = "http://jbws3282.jaxws.ws.test.jboss.org/";
+ private final String testConfig = "org.jboss.test.ws.jaxws.jbws3282.Endpoint2Impl";
+ private String address;
+ private static volatile EndpointConfig defaultEndpointConfig;
+
+ public boolean testHandlerChainVanillaServer() throws Exception
+ {
+ QName serviceName = new QName(targetNS, "Endpoint2ImplService");
+ URL wsdlURL = new URL(address + "/ep2?wsdl");
+ Service service = Service.create(wsdlURL, serviceName);
+ Endpoint port = (Endpoint)service.getPort(Endpoint.class);
+ String resStr = port.echo("Kermit");
+ if (!"Kermit|EpIn|endpoint2|EpOut".equals(resStr)) {
+ return false;
+ }
+
+ serviceName = new QName(targetNS, "Endpoint3ImplService");
+ wsdlURL = new URL(address + "/ep3?wsdl");
+ service = Service.create(wsdlURL, serviceName);
+ port = (Endpoint)service.getPort(Endpoint.class);
+ resStr = port.echo("Kermit");
+ if (!"Kermit|EpIn|endpoint3|EpOut".equals(resStr)) {
+ return false;
+ }
+
+ return true;
+ }
+
+ public boolean setupConfigurations() throws Exception
+ {
+ defaultEndpointConfig = TestUtils.getAndVerifyDefaultEndpointConfiguration();
+ TestUtils.addTestCaseEndpointConfiguration(testConfig);
+ TestUtils.changeDefaultEndpointConfiguration();
+ return true;
+ }
+
+ public boolean restoreConfigurations() throws Exception
+ {
+ TestUtils.setEndpointConfigAndReload(defaultEndpointConfig);
+ TestUtils.removeTestCaseEndpointConfiguration(testConfig);
+ defaultEndpointConfig = null;
+ return true;
+ }
+
+ public boolean testHandlerChainModifiedServer() throws Exception
+ {
+ final EndpointConfig defaultEndpointConfig = TestUtils.getAndVerifyDefaultEndpointConfiguration();
+ final String testConfig = "org.jboss.test.ws.jaxws.jbws3282.Endpoint2Impl";
+ try {
+ TestUtils.addTestCaseEndpointConfiguration(testConfig);
+ TestUtils.changeDefaultEndpointConfiguration();
+
+ QName serviceName = new QName(targetNS, "Endpoint2ImplService");
+ URL wsdlURL = new URL(address + "/ep2?wsdl");
+ Service service = Service.create(wsdlURL, serviceName);
+ Endpoint port = (Endpoint)service.getPort(Endpoint.class);
+ String resStr = port.echo("Kermit");
+ if (!"Kermit|RoutIn|EpIn|endpoint2|EpOut|RoutOut".equals(resStr)) {
+ return false;
+ }
+
+ serviceName = new QName(targetNS, "Endpoint3ImplService");
+ wsdlURL = new URL(address + "/ep3?wsdl");
+ service = Service.create(wsdlURL, serviceName);
+ port = (Endpoint)service.getPort(Endpoint.class);
+ resStr = port.echo("Kermit");
+ if (!"Kermit|EpIn|LogIn|endpoint3|LogOut|EpOut".equals(resStr)) {
+ return false;
+ }
+
+ return true;
+ } finally {
+ TestUtils.setEndpointConfigAndReload(defaultEndpointConfig);
+ TestUtils.removeTestCaseEndpointConfiguration(testConfig);
+ }
+ }
+
+ @Override
+ public void setTargetEndpoint(String address)
+ {
+ this.address = address;
+ }
+}
Property changes on: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3282/Helper.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3282/TestUtils.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3282/TestUtils.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3282/TestUtils.java 2014-10-03 09:04:58 UTC (rev 18967)
@@ -0,0 +1,96 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, 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.jbws3282;
+
+import java.util.Collections;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.jboss.wsf.spi.SPIProvider;
+import org.jboss.wsf.spi.SPIProviderResolver;
+import org.jboss.wsf.spi.classloading.ClassLoaderProvider;
+import org.jboss.wsf.spi.management.ServerConfig;
+import org.jboss.wsf.spi.management.ServerConfigFactory;
+import org.jboss.wsf.spi.metadata.config.EndpointConfig;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainMetaData;
+import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData;
+
+/**
+ * Support utils for endpoint config testcase; this basically collects methods
+ * for test purposes only to allow having a clean testcase without dependencies
+ * the user is not actually going to need.
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 03-Oct-2014
+ */
+public class TestUtils
+{
+ public static EndpointConfig getAndVerifyDefaultEndpointConfiguration() throws Exception {
+ ServerConfig sc = getServerConfig();
+ EndpointConfig defaultConfig = sc.getEndpointConfig(EndpointConfig.STANDARD_ENDPOINT_CONFIG);
+ if (defaultConfig == null) {
+ throw new Exception("Missing AS endpoint config '" + EndpointConfig.STANDARD_ENDPOINT_CONFIG + "'!");
+ }
+ List<UnifiedHandlerChainMetaData> preHC = defaultConfig.getPreHandlerChains();
+ List<UnifiedHandlerChainMetaData> postHC = defaultConfig.getPostHandlerChains();
+ if ((preHC != null && !preHC.isEmpty()) || (postHC != null && !postHC.isEmpty())) {
+ throw new Exception("'" + EndpointConfig.STANDARD_ENDPOINT_CONFIG + "' is not empty!");
+ }
+ return defaultConfig;
+ }
+
+ public static void changeDefaultEndpointConfiguration() {
+ UnifiedHandlerMetaData handler = new UnifiedHandlerMetaData("org.jboss.test.ws.jaxws.jbws3282.LogHandler", "Log Handler", null, null, null, null);
+ UnifiedHandlerChainMetaData uhcmd = new UnifiedHandlerChainMetaData(null, null, null, Collections.singletonList(handler), false, null);
+ List<UnifiedHandlerChainMetaData> postHC = Collections.singletonList(uhcmd);
+
+ EndpointConfig newDefaultEndpointConfig = new EndpointConfig(EndpointConfig.STANDARD_ENDPOINT_CONFIG, null, postHC, null, null);
+ setEndpointConfigAndReload(newDefaultEndpointConfig);
+ }
+
+ public static void setEndpointConfigAndReload(EndpointConfig config) {
+ ServerConfig sc = getServerConfig();
+ sc.registerEndpointConfig(config);
+ sc.reloadEndpointConfigs();
+ }
+
+ public static void addTestCaseEndpointConfiguration(String testConfigName) {
+ UnifiedHandlerMetaData handler = new UnifiedHandlerMetaData("org.jboss.test.ws.jaxws.jbws3282.RoutingHandler", "Routing Handler", null, null, null, null);
+ UnifiedHandlerChainMetaData uhcmd = new UnifiedHandlerChainMetaData(null, null, null, Collections.singletonList(handler), false, null);
+ List<UnifiedHandlerChainMetaData> preHC = new LinkedList<UnifiedHandlerChainMetaData>();
+ preHC.add(uhcmd);
+ setEndpointConfigAndReload(new EndpointConfig(testConfigName, preHC, null, null, null));
+ }
+
+ public static void removeTestCaseEndpointConfiguration(String testConfigName) {
+ ServerConfig sc = getServerConfig();
+ sc.unregisterEndpointConfig(new EndpointConfig(testConfigName, null, null, null, null));
+ sc.reloadEndpointConfigs();
+ }
+
+ private static ServerConfig getServerConfig()
+ {
+ final ClassLoader cl = ClassLoaderProvider.getDefaultProvider().getServerIntegrationClassLoader();
+ SPIProvider spiProvider = SPIProviderResolver.getInstance(cl).getProvider();
+ return spiProvider.getSPI(ServerConfigFactory.class, cl).getServerConfig();
+ }
+}
Property changes on: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws3282/TestUtils.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/resources/jaxws/jbws3282/META-INF/permissions.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/shared-tests/src/test/resources/jaxws/jbws3282/META-INF/permissions.xml (rev 0)
+++ stack/cxf/trunk/modules/testsuite/shared-tests/src/test/resources/jaxws/jbws3282/META-INF/permissions.xml 2014-10-03 09:04:58 UTC (rev 18967)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<permissions xmlns="http://xmlns.jcp.org/xml/ns/javaee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/permissions_7.xsd"
+ version="7">
+ <permission>
+ <class-name>java.lang.RuntimePermission</class-name>
+ <name>org.jboss.as.server.LOOKUP_CURRENT_SERVICE_CONTAINER</name>
+ </permission>
+</permissions>
Property changes on: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/resources/jaxws/jbws3282/META-INF/permissions.xml
___________________________________________________________________
Added: svn:mime-type
+ text/xml
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Modified: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/resources/jaxws/jbws3282/WEB-INF/jaxws-endpoint-config.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/shared-tests/src/test/resources/jaxws/jbws3282/WEB-INF/jaxws-endpoint-config.xml 2014-10-03 09:03:48 UTC (rev 18966)
+++ stack/cxf/trunk/modules/testsuite/shared-tests/src/test/resources/jaxws/jbws3282/WEB-INF/jaxws-endpoint-config.xml 2014-10-03 09:04:58 UTC (rev 18967)
@@ -4,7 +4,7 @@
xsi:schemaLocation="urn:jboss:jbossws-jaxws-config:4.0 schema/jbossws-jaxws-config_4_0.xsd">
<endpoint-config>
- <config-name>Custom Endpoint</config-name>
+ <config-name>org.jboss.test.ws.jaxws.jbws3282.Endpoint4Impl</config-name>
<pre-handler-chains>
<javaee:handler-chain>
<javaee:handler>
@@ -16,15 +16,31 @@
<post-handler-chains>
<javaee:handler-chain>
<javaee:handler>
- <javaee:handler-name>Authorization Handler</javaee:handler-name>
- <javaee:handler-class>org.jboss.test.ws.jaxws.jbws3282.AuthorizationHandler</javaee:handler-class>
- </javaee:handler>
- <javaee:handler>
<javaee:handler-name>Routing Handler</javaee:handler-name>
<javaee:handler-class>org.jboss.test.ws.jaxws.jbws3282.RoutingHandler</javaee:handler-class>
</javaee:handler>
</javaee:handler-chain>
</post-handler-chains>
</endpoint-config>
+ <endpoint-config>
+ <config-name>EP6-config</config-name>
+ <pre-handler-chains>
+ <javaee:handler-chain>
+ <javaee:handler>
+ <javaee:handler-name>Log Handler</javaee:handler-name>
+ <javaee:handler-class>org.jboss.test.ws.jaxws.jbws3282.LogHandler</javaee:handler-class>
+ </javaee:handler>
+ </javaee:handler-chain>
+ </pre-handler-chains>
+ <post-handler-chains>
+ <javaee:handler-chain>
+ <javaee:handler>
+ <javaee:handler-name>Authorization Handler</javaee:handler-name>
+ <javaee:handler-class>org.jboss.test.ws.jaxws.jbws3282.AuthorizationHandler</javaee:handler-class>
+ </javaee:handler>
+ </javaee:handler-chain>
+ </post-handler-chains>
+ </endpoint-config>
+
</jaxws-config>
\ No newline at end of file
Added: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/resources/jaxws/jbws3282/WEB-INF/my-endpoint-config.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/shared-tests/src/test/resources/jaxws/jbws3282/WEB-INF/my-endpoint-config.xml (rev 0)
+++ stack/cxf/trunk/modules/testsuite/shared-tests/src/test/resources/jaxws/jbws3282/WEB-INF/my-endpoint-config.xml 2014-10-03 09:04:58 UTC (rev 18967)
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jaxws-config xmlns="urn:jboss:jbossws-jaxws-config:4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:javaee="http://java.sun.com/xml/ns/javaee"
+ xsi:schemaLocation="urn:jboss:jbossws-jaxws-config:4.0 schema/jbossws-jaxws-config_4_0.xsd">
+
+ <endpoint-config>
+ <config-name>Custom Endpoint</config-name>
+ <pre-handler-chains>
+ <javaee:handler-chain>
+ <javaee:handler>
+ <javaee:handler-name>Log Handler</javaee:handler-name>
+ <javaee:handler-class>org.jboss.test.ws.jaxws.jbws3282.LogHandler</javaee:handler-class>
+ </javaee:handler>
+ </javaee:handler-chain>
+ </pre-handler-chains>
+ <post-handler-chains>
+ <javaee:handler-chain>
+ <javaee:handler>
+ <javaee:handler-name>Authorization Handler</javaee:handler-name>
+ <javaee:handler-class>org.jboss.test.ws.jaxws.jbws3282.AuthorizationHandler</javaee:handler-class>
+ </javaee:handler>
+ <javaee:handler>
+ <javaee:handler-name>Routing Handler</javaee:handler-name>
+ <javaee:handler-class>org.jboss.test.ws.jaxws.jbws3282.RoutingHandler</javaee:handler-class>
+ </javaee:handler>
+ </javaee:handler-chain>
+ </post-handler-chains>
+ </endpoint-config>
+ <endpoint-config>
+ <config-name>org.jboss.test.ws.jaxws.jbws3282.Endpoint5Impl</config-name>
+ <pre-handler-chains>
+ <javaee:handler-chain>
+ <javaee:handler>
+ <javaee:handler-name>Log Handler</javaee:handler-name>
+ <javaee:handler-class>org.jboss.test.ws.jaxws.jbws3282.LogHandler</javaee:handler-class>
+ </javaee:handler>
+ </javaee:handler-chain>
+ </pre-handler-chains>
+ </endpoint-config>
+
+</jaxws-config>
\ No newline at end of file
Property changes on: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/resources/jaxws/jbws3282/WEB-INF/my-endpoint-config.xml
___________________________________________________________________
Added: svn:mime-type
+ text/xml
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Added: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/resources/jaxws/jbws3282/WEB-INF/web-f.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/shared-tests/src/test/resources/jaxws/jbws3282/WEB-INF/web-f.xml (rev 0)
+++ stack/cxf/trunk/modules/testsuite/shared-tests/src/test/resources/jaxws/jbws3282/WEB-INF/web-f.xml 2014-10-03 09:04:58 UTC (rev 18967)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+ version="2.4">
+
+ <servlet>
+ <servlet-name>TestService2</servlet-name>
+ <servlet-class>org.jboss.test.ws.jaxws.jbws3282.Endpoint2Impl</servlet-class>
+ </servlet>
+ <servlet>
+ <servlet-name>TestService3</servlet-name>
+ <servlet-class>org.jboss.test.ws.jaxws.jbws3282.Endpoint3Impl</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>TestService2</servlet-name>
+ <url-pattern>/ep2</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>TestService3</servlet-name>
+ <url-pattern>/ep3</url-pattern>
+ </servlet-mapping>
+
+</web-app>
+
Property changes on: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/resources/jaxws/jbws3282/WEB-INF/web-f.xml
___________________________________________________________________
Added: svn:mime-type
+ text/xml
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
Modified: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/resources/jaxws/jbws3282/WEB-INF/web.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/shared-tests/src/test/resources/jaxws/jbws3282/WEB-INF/web.xml 2014-10-03 09:03:48 UTC (rev 18966)
+++ stack/cxf/trunk/modules/testsuite/shared-tests/src/test/resources/jaxws/jbws3282/WEB-INF/web.xml 2014-10-03 09:04:58 UTC (rev 18967)
@@ -9,11 +9,35 @@
<servlet-name>TestService</servlet-name>
<servlet-class>org.jboss.test.ws.jaxws.jbws3282.EndpointImpl</servlet-class>
</servlet>
+ <servlet>
+ <servlet-name>TestService4</servlet-name>
+ <servlet-class>org.jboss.test.ws.jaxws.jbws3282.Endpoint4Impl</servlet-class>
+ </servlet>
+ <servlet>
+ <servlet-name>TestService5</servlet-name>
+ <servlet-class>org.jboss.test.ws.jaxws.jbws3282.Endpoint5Impl</servlet-class>
+ </servlet>
+ <servlet>
+ <servlet-name>TestService6</servlet-name>
+ <servlet-class>org.jboss.test.ws.jaxws.jbws3282.Endpoint6Impl</servlet-class>
+ </servlet>
<servlet-mapping>
<servlet-name>TestService</servlet-name>
- <url-pattern>/*</url-pattern>
+ <url-pattern>/ep</url-pattern>
</servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>TestService4</servlet-name>
+ <url-pattern>/ep4</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>TestService5</servlet-name>
+ <url-pattern>/ep5</url-pattern>
+ </servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>TestService6</servlet-name>
+ <url-pattern>/ep6</url-pattern>
+ </servlet-mapping>
</web-app>
10 years, 2 months
JBossWS SVN: r18966 - in stack/cxf/trunk/modules: server/src/main/java/org/jboss/wsf/stack/cxf/configuration and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2014-10-03 05:03:48 -0400 (Fri, 03 Oct 2014)
New Revision: 18966
Modified:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ProviderImpl.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/ServerBeanCustomizer.java
Log:
[JBWS-3836] Convention for automatic predefined client/endpoint configuration retrieval
Modified: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ProviderImpl.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ProviderImpl.java 2014-10-03 09:00:51 UTC (rev 18965)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/ProviderImpl.java 2014-10-03 09:03:48 UTC (rev 18966)
@@ -556,7 +556,7 @@
protected <T> T createPort(QName portName, EndpointReferenceType epr, Class<T> serviceEndpointInterface,
WebServiceFeature... features) {
T port = super.createPort(portName, epr, serviceEndpointInterface, features);
- setupClient(port, features);
+ setupClient(port, serviceEndpointInterface, features);
return port;
}
@@ -567,18 +567,21 @@
Mode mode,
WebServiceFeature... features) {
Dispatch<T> dispatch = super.createDispatch(portName, type, context, mode, features);
- setupClient(dispatch, features);
+ setupClient(dispatch, type, features);
return dispatch;
}
- protected void setupClient(Object obj, WebServiceFeature... features) {
+ protected void setupClient(Object obj, Class<?> seiClass, WebServiceFeature... features) {
Binding binding = ((BindingProvider)obj).getBinding();
Client client = obj instanceof DispatchImpl<?> ? ((DispatchImpl<?>)obj).getClient() : ClientProxy.getClient(obj);
client.getOutInterceptors().add(new HandlerChainSortInterceptor(binding));
if (ClassLoaderProvider.isSet()) { //optimization for avoiding checking for a server config when we know for sure we're out-of-container
ServerConfig sc = getServerConfig();
if (sc != null) {
- ClientConfig config = sc.getClientConfig(ClientConfig.STANDARD_CLIENT_CONFIG);
+ ClientConfig config = sc.getClientConfig(seiClass.getName());
+ if (config == null) {
+ config = sc.getClientConfig(ClientConfig.STANDARD_CLIENT_CONFIG);
+ }
if (config != null) {
CXFClientConfigurer helper = new CXFClientConfigurer();
helper.setupConfigHandlers(binding, config);
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/ServerBeanCustomizer.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/ServerBeanCustomizer.java 2014-10-03 09:00:51 UTC (rev 18965)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/ServerBeanCustomizer.java 2014-10-03 09:03:48 UTC (rev 18966)
@@ -1,6 +1,6 @@
/*
* JBoss, Home of Professional Open Source.
- * Copyright 2013, Red Hat Middleware LLC, and individual contributors
+ * Copyright 2014, 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.
*
@@ -22,6 +22,7 @@
package org.jboss.wsf.stack.cxf.configuration;
import java.io.IOException;
+import java.net.URL;
import java.security.AccessController;
import java.util.List;
@@ -32,6 +33,7 @@
import org.jboss.ws.api.util.ServiceLoader;
import org.jboss.ws.common.management.AbstractServerConfig;
import org.jboss.wsf.spi.classloading.ClassLoaderProvider;
+import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.deployment.UnifiedVirtualFile;
import org.jboss.wsf.spi.management.ServerConfig;
@@ -122,8 +124,9 @@
// ** Endpoint configuration setup **
// 1) default values
- String configName = org.jboss.wsf.spi.metadata.config.EndpointConfig.STANDARD_ENDPOINT_CONFIG;
- String configFile = null;
+ //String configName = org.jboss.wsf.spi.metadata.config.EndpointConfig.STANDARD_ENDPOINT_CONFIG;
+ String configName = implementor.getClass().getName();
+ String configFile = org.jboss.wsf.spi.metadata.config.EndpointConfig.DEFAULT_ENDPOINT_CONFIG_FILE;
boolean specifiedConfig = false;
// 2) annotation contribution
EndpointConfig epConfigAnn = implementor.getClass().getAnnotation(EndpointConfig.class);
@@ -150,32 +153,66 @@
configFile = epConfigFile;
}
// 4) setup of configuration
- if (configFile == null)
- {
- //use endpoint configs from AS domain
- ServerConfig sc = getServerConfig();
- org.jboss.wsf.spi.metadata.config.EndpointConfig config = sc.getEndpointConfig(configName);
- if (config != null) {
- endpoint.setEndpointConfig(config);
- }
- if (config == null && specifiedConfig) {
- throw Messages.MESSAGES.couldNotFindEndpointConfigName(configName);
- }
- }
- else
- {
+ if (configFile != org.jboss.wsf.spi.metadata.config.EndpointConfig.DEFAULT_ENDPOINT_CONFIG_FILE) {
//look for provided endpoint config file
try
{
UnifiedVirtualFile vf = deploymentRoot.findChild(configFile);
- ConfigRoot config = ConfigMetaDataParser.parse(vf.toURL());
- endpoint.setEndpointConfig(config.getEndpointConfigByName(configName));
+ ConfigRoot configRoot = ConfigMetaDataParser.parse(vf.toURL());
+ org.jboss.wsf.spi.metadata.config.EndpointConfig config = configRoot.getEndpointConfigByName(configName);
+ if (config == null && !specifiedConfig) {
+ config = configRoot.getEndpointConfigByName(org.jboss.wsf.spi.metadata.config.EndpointConfig.STANDARD_ENDPOINT_CONFIG);
+ }
+ if (config != null) {
+ endpoint.setEndpointConfig(config);
+ }
}
catch (IOException e)
{
throw Messages.MESSAGES.couldNotReadConfigFile(configFile);
}
}
+ else
+ {
+ org.jboss.wsf.spi.metadata.config.EndpointConfig config = null;
+ URL url = implementor.getClass().getResource("/" + configFile);
+ if (url == null) {
+ UnifiedVirtualFile vf = deploymentRoot.findChildFailSafe(configFile);
+ if (vf != null) {
+ url = vf.toURL();
+ }
+ }
+ if (url != null) {
+ //the default file exists
+ try
+ {
+ ConfigRoot configRoot = ConfigMetaDataParser.parse(url);
+ config = configRoot.getEndpointConfigByName(configName);
+ if (config == null && !specifiedConfig) {
+ config = configRoot.getEndpointConfigByName(org.jboss.wsf.spi.metadata.config.EndpointConfig.STANDARD_ENDPOINT_CONFIG);
+ }
+ }
+ catch (IOException e)
+ {
+ throw Messages.MESSAGES.couldNotReadConfigFile(configFile);
+ }
+ }
+ if (config == null) {
+ //use endpoint configs from AS domain
+ ServerConfig sc = getServerConfig();
+ config = sc.getEndpointConfig(configName);
+ if (config == null && !specifiedConfig) {
+ config = sc.getEndpointConfig(org.jboss.wsf.spi.metadata.config.EndpointConfig.STANDARD_ENDPOINT_CONFIG);
+ }
+ if (config == null && specifiedConfig) {
+ throw Messages.MESSAGES.couldNotFindEndpointConfigName(configName);
+ }
+ }
+ if (config != null) {
+ endpoint.setEndpointConfig(config);
+ }
+ }
+
//JASPI
final JASPIAuthenticationProvider jaspiProvider = (JASPIAuthenticationProvider) ServiceLoader.loadService(
JASPIAuthenticationProvider.class.getName(), null, ClassLoaderProvider.getDefaultProvider().getServerIntegrationClassLoader());
10 years, 2 months
JBossWS SVN: r18965 - spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/config.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2014-10-03 05:00:51 -0400 (Fri, 03 Oct 2014)
New Revision: 18965
Modified:
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/config/ClientConfig.java
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/config/EndpointConfig.java
Log:
[JBWS-3836] Adding constants for default conf files
Modified: spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/config/ClientConfig.java
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/config/ClientConfig.java 2014-10-02 07:13:40 UTC (rev 18964)
+++ spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/config/ClientConfig.java 2014-10-03 09:00:51 UTC (rev 18965)
@@ -35,6 +35,7 @@
public class ClientConfig extends AbstractCommonConfig
{
public static final String STANDARD_CLIENT_CONFIG = "Standard-Client-Config";
+ public static final String DEFAULT_CLIENT_CONFIG_FILE = "jaxws-client-config.xml";
public ClientConfig(String configName, List<UnifiedHandlerChainMetaData> preHandlerChains,
List<UnifiedHandlerChainMetaData> postHandlerChains, Map<String, String> properties,
Modified: spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/config/EndpointConfig.java
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/config/EndpointConfig.java 2014-10-02 07:13:40 UTC (rev 18964)
+++ spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/config/EndpointConfig.java 2014-10-03 09:00:51 UTC (rev 18965)
@@ -35,6 +35,7 @@
public class EndpointConfig extends AbstractCommonConfig
{
public static final String STANDARD_ENDPOINT_CONFIG = "Standard-Endpoint-Config";
+ public static final String DEFAULT_ENDPOINT_CONFIG_FILE = "jaxws-endpoint-config.xml";
public static final String STATISTICS_ENABLED = "statistics-enabled";
public EndpointConfig(String configName, List<UnifiedHandlerChainMetaData> preHandlerChains,
10 years, 2 months
JBossWS SVN: r18964 - in stack/cxf/trunk/modules/testsuite: cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3805 and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2014-10-02 03:13:40 -0400 (Thu, 02 Oct 2014)
New Revision: 18964
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3805/JBWS3805TestCase.java
stack/cxf/trunk/modules/testsuite/pom.xml
Log:
[JBWS-3805] Removing exclusions and adding source header
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3805/JBWS3805TestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3805/JBWS3805TestCase.java 2014-10-01 15:49:12 UTC (rev 18963)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3805/JBWS3805TestCase.java 2014-10-02 07:13:40 UTC (rev 18964)
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2014, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.test.ws.jaxws.cxf.jbws3805;
import java.io.BufferedReader;
@@ -16,10 +37,12 @@
import org.jboss.wsf.test.JBossWSTestHelper.BaseDeployment;
import org.jboss.wsf.test.JBossWSTestSetup;
+/**
+ * [JBWS-3805] Allow overriding soap:address rewrite options in jboss-webservices.xml
+ *
+ */
public class JBWS3805TestCase extends JBossWSTest
{
- private static String publishURL = "http://" + getServerHost() + ":8080/jaxws-cxf-jbws3805/HelloService";
-
public static BaseDeployment<?>[] createDeployments()
{
List<BaseDeployment<?>> list = new LinkedList<BaseDeployment<?>>();
@@ -41,7 +64,7 @@
public void testWsdlSoapAddress() throws Exception
{
- URL wsdlURL = new URL(publishURL + "?wsdl");
+ URL wsdlURL = new URL("http://" + getServerHost() + ":8080/jaxws-cxf-jbws3805/HelloService?wsdl");
HttpURLConnection connection = (HttpURLConnection)wsdlURL.openConnection();
try
{
Modified: stack/cxf/trunk/modules/testsuite/pom.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/pom.xml 2014-10-01 15:49:12 UTC (rev 18963)
+++ stack/cxf/trunk/modules/testsuite/pom.xml 2014-10-02 07:13:40 UTC (rev 18964)
@@ -689,9 +689,6 @@
<!-- # [JBWS-3620] Authentication failures w/ Undertow -->
<exclude>org/jboss/test/ws/jaxws/cxf/httpauth/HelloDigestTestCase*</exclude>
- <!-- # [JBWS-3805]:Allow overriding soap:address rewrite options in jboss-webservices.xml;Not supposed to support in WFLY8 -->
- <exclude>org/jboss/test/ws/jaxws/cxf/jbws3805/*TestCase*</exclude>
-
<!-- Manually setup KDC before run this test-->
<exclude>org/jboss/test/ws/jaxws/samples/wsse/kerberos/*TestCase*</exclude>
</excludes>
@@ -773,9 +770,6 @@
<!-- Manually setup KDC before run this test-->
<exclude>org/jboss/test/ws/jaxws/samples/wsse/kerberos/*TestCase*</exclude>
-
- <!-- # [JBWS-3805]:Allow overriding soap:address rewrite options in jboss-webservices.xml;Not supposed to support in WFLY8 -->
- <exclude>org/jboss/test/ws/jaxws/cxf/jbws3805/*TestCase*</exclude>
</excludes>
</configuration>
</plugin>
10 years, 2 months
JBossWS SVN: r18963 - in stack/cxf/trunk/modules/testsuite: cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf and 5 other directories.
by jbossws-commits@lists.jboss.org
Author: rsearls
Date: 2014-10-01 11:49:12 -0400 (Wed, 01 Oct 2014)
New Revision: 18963
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3827/
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3827/GreetingsWs.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3827/GreetingsWsImpl.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3827/JWBS3827TestCase.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3827/SayHello.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3827/SayHelloResponse.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3827/ServerUsernamePasswordCallback.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3827/ServiceIface.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3827/ServiceImpl.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3827/UsernamePasswordCallback.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3827/
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3827/WEB-INF/
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3827/WEB-INF/jaxws-endpoint-config.xml
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3827/WEB-INF/serviceKeystore.properties
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3827/WEB-INF/servicestore.jks
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3827/WEB-INF/web.xml
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3827/WEB-INF/wsdl/
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3827/WEB-INF/wsdl/Greeting_Simplest.wsdl
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3827/WEB-INF/wsdl/SecurityService.wsdl
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3827/WEB-INF/wsdl/SecurityService_schema1.xsd
Modified:
stack/cxf/trunk/modules/testsuite/pom.xml
Log:
[JBWS-3827] this test imports wsdl from secure URL
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3827/GreetingsWs.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3827/GreetingsWs.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3827/GreetingsWs.java 2014-10-01 15:49:12 UTC (rev 18963)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2013, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.cxf.jbws3827;
+
+import javax.jws.WebService;
+
+/**
+ *
+ */
+@WebService(name = GreetingsWs.NAME, targetNamespace = GreetingsWs.TARGET_NAMESPACE)
+public interface GreetingsWs
+{
+ public final static String NAME = "GreetingsService";
+
+ public final static String TARGET_NAMESPACE = "http://greetings/test";
+}
+
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3827/GreetingsWsImpl.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3827/GreetingsWsImpl.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3827/GreetingsWsImpl.java 2014-10-01 15:49:12 UTC (rev 18963)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2013, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.cxf.jbws3827;
+
+import javax.jws.WebService;
+
+/**
+ *
+ */
+
+@WebService(
+ wsdlLocation = "WEB-INF/wsdl/Greeting_Simplest.wsdl",
+ targetNamespace = GreetingsWs.TARGET_NAMESPACE,
+ name = GreetingsWs.NAME,
+ serviceName = GreetingsWs.NAME,
+ endpointInterface = "org.jboss.test.ws.jaxws.cxf.jbws3827.GreetingsWs")
+public class GreetingsWsImpl implements GreetingsWs {
+}
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3827/JWBS3827TestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3827/JWBS3827TestCase.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3827/JWBS3827TestCase.java 2014-10-01 15:49:12 UTC (rev 18963)
@@ -0,0 +1,160 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2013, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.cxf.jbws3827;
+
+import junit.framework.Test;
+import org.jboss.shrinkwrap.api.asset.StringAsset;
+import org.jboss.wsf.test.JBossWSCXFTestSetup;
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestHelper;
+import org.jboss.wsf.test.JBossWSTestSetup;
+import org.apache.cxf.ws.security.SecurityConstants;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Service;
+import java.io.File;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Test imported wsdl identified by URL of deployed app.
+ */
+public class JWBS3827TestCase extends JBossWSTest
+{
+ private final String serviceURL = "https://" + getServerHost()
+ + ":8443/jaxws-jbws3827-wsse-policy-username";
+
+ public static JBossWSTestHelper.BaseDeployment<?>[] createDeployments() {
+ List<JBossWSTestHelper.BaseDeployment<?>> list = new LinkedList<JBossWSTestHelper.BaseDeployment<?>>();
+ list.add(new JBossWSTestHelper.WarDeployment("jaxws-jbws3827-wsse-policy-username.war") { {
+ archive
+ .setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ + "Dependencies: org.jboss.ws.cxf.jbossws-cxf-client\n"))
+ .addClass(org.jboss.test.ws.jaxws.cxf.jbws3827.ServerUsernamePasswordCallback.class)
+ .addClass(org.jboss.test.ws.jaxws.cxf.jbws3827.ServiceIface.class)
+ .addClass(org.jboss.test.ws.jaxws.cxf.jbws3827.ServiceImpl.class)
+ .addClass(org.jboss.test.ws.jaxws.cxf.jbws3827.SayHello.class)
+ .addClass(org.jboss.test.ws.jaxws.cxf.jbws3827.SayHelloResponse.class)
+
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/cxf/jbws3827/WEB-INF/jaxws-endpoint-config.xml"), "jaxws-endpoint-config.xml")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/cxf/jbws3827/WEB-INF/wsdl/SecurityService.wsdl"), "wsdl/SecurityService.wsdl")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/cxf/jbws3827/WEB-INF/wsdl/SecurityService_schema1.xsd"), "wsdl/SecurityService_schema1.xsd")
+ .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/cxf/jbws3827/WEB-INF/web.xml"));
+ }
+ });
+
+ /**/
+ list.add(
+ new JBossWSTestHelper.WarDeployment("jbws3827-wsdlImport.war") {
+ {
+ archive
+ .setManifest(new StringAsset("Manifest-Version: 1.0\n"
+ + "Dependencies: org.jboss.ws.cxf.jbossws-cxf-client\n"))
+ .addClass(org.jboss.test.ws.jaxws.cxf.jbws3827.GreetingsWsImpl.class)
+ .addClass(org.jboss.test.ws.jaxws.cxf.jbws3827.GreetingsWs.class)
+
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir()
+ + "/jaxws/cxf/jbws3827/WEB-INF/servicestore.jks"), "classes/servicestore.jks")
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir()
+ + "/jaxws/cxf/jbws3827/WEB-INF/serviceKeystore.properties"), "classes/serviceKeystore.properties")
+
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir()
+ + "/jaxws/cxf/jbws3827/WEB-INF/wsdl/Greeting_Simplest.wsdl"),
+ "wsdl/Greeting_Simplest.wsdl")
+ ;
+ }
+ });
+
+ /**/
+
+ return list.toArray(new JBossWSTestHelper.BaseDeployment<?>[list.size()]);
+ }
+
+ public static Test suite()
+ {
+ /**
+ //System properties - currently set at testsuite start time
+ System.setProperty("javax.net.ssl.trustStore", JBossWSTestHelper.getTestResourcesDir() + "/jaxws/cxf/jbws3827/WEB-INF/servicestore.jks");
+ System.setProperty("javax.net.ssl.trustStorePassword", "sspass");
+ System.setProperty("javax.net.ssl.trustStoreType", "jks");
+ System.setProperty("org.jboss.security.ignoreHttpsHost", "true");
+ **/
+ JBossWSTestSetup setup = new JBossWSCXFTestSetup(JWBS3827TestCase.class, JBossWSTestHelper.writeToFile(createDeployments()));
+ Map<String, String> sslOptions = new HashMap<String, String>();
+ sslOptions.put("server-identity.ssl.keystore-path", System.getProperty("org.jboss.ws.testsuite.server.keystore"));
+ sslOptions.put("server-identity.ssl.keystore-password", "changeit");
+ sslOptions.put("server-identity.ssl.alias", "tomcat");
+ setup.setHttpsConnectorRequirement(sslOptions);
+ return setup;
+ }
+
+ public void test() throws Exception
+ {
+ QName serviceName = new QName("http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy", "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 testPre() throws Exception {
+
+ URL wsdlURL = new URL("http://" + getServerHost()
+ + ":8443/jaxws-jbws3827-wsse-policy-username/SecurityService?wsdl");
+ QName qname = new QName(
+ "http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy",
+ "SecurityService");
+ Service service = Service.create(wsdlURL, qname);
+ ServiceIface proxy = (ServiceIface)service.getPort(ServiceIface.class);
+ setupWsse(proxy, "kermit");
+ assertEquals("Secure Hello World!", proxy.sayHello());
+ }
+
+ public void testAfter() throws Exception {
+
+ URL wsdlURL = new URL("http://" + getServerHost()
+ + ":8080/jbws3827-wsdlImport/GreetingsService?wsdl");
+ QName qname = new QName(
+ "http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy",
+ "SecurityService");
+ Service service = Service.create(wsdlURL, qname);
+ ServiceIface proxy = (ServiceIface)service.getPort(ServiceIface.class);
+ setupWsse(proxy, "kermit");
+ assertEquals("Secure Hello World!", proxy.sayHello());
+ }
+ **/
+
+ private void setupWsse(ServiceIface proxy, String username)
+ {
+ ((BindingProvider)proxy).getRequestContext().put(
+ SecurityConstants.USERNAME, username);
+ ((BindingProvider)proxy).getRequestContext().put(
+ SecurityConstants.CALLBACK_HANDLER,
+ "org.jboss.test.ws.jaxws.cxf.jbws3827.UsernamePasswordCallback");
+ }
+}
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3827/SayHello.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3827/SayHello.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3827/SayHello.java 2014-10-01 15:49:12 UTC (rev 18963)
@@ -0,0 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.cxf.jbws3827;
+
+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 = "sayHello", namespace = "http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy")
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "sayHello", namespace = "http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy")
+public class SayHello {}
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3827/SayHelloResponse.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3827/SayHelloResponse.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3827/SayHelloResponse.java 2014-10-01 15:49:12 UTC (rev 18963)
@@ -0,0 +1,49 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.cxf.jbws3827;
+
+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 = "sayHelloResponse", namespace = "http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy")
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "sayHelloResponse", namespace = "http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy")
+public class SayHelloResponse
+{
+
+ @XmlElement(name = "return", namespace = "")
+ private String _return;
+
+ public String getReturn()
+ {
+ return this._return;
+ }
+
+ public void setReturn(String _return)
+ {
+ this._return = _return;
+ }
+
+}
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3827/ServerUsernamePasswordCallback.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3827/ServerUsernamePasswordCallback.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3827/ServerUsernamePasswordCallback.java 2014-10-01 15:49:12 UTC (rev 18963)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.cxf.jbws3827;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jboss.wsf.stack.cxf.extensions.security.PasswordCallbackHandler;
+
+public class ServerUsernamePasswordCallback extends PasswordCallbackHandler
+{
+ public ServerUsernamePasswordCallback()
+ {
+ super(getInitMap());
+ }
+
+ private static Map<String, String> getInitMap() {
+ Map<String, String> passwords = new HashMap<String, String>();
+ passwords.put("kermit", "thefrog");
+ return passwords;
+ }
+}
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3827/ServiceIface.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3827/ServiceIface.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3827/ServiceIface.java 2014-10-01 15:49:12 UTC (rev 18963)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.cxf.jbws3827;
+
+import javax.jws.WebMethod;
+import javax.jws.WebService;
+
+@WebService
+(
+ targetNamespace = "http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy"
+)
+public interface ServiceIface
+{
+ @WebMethod
+ String sayHello();
+}
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3827/ServiceImpl.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3827/ServiceImpl.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3827/ServiceImpl.java 2014-10-01 15:49:12 UTC (rev 18963)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.cxf.jbws3827;
+
+import javax.jws.WebService;
+
+import org.jboss.ws.api.annotation.EndpointConfig;
+
+@WebService
+(
+ portName = "SecurityServicePort",
+ serviceName = "SecurityService",
+ wsdlLocation = "WEB-INF/wsdl/SecurityService.wsdl",
+ targetNamespace = "http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy",
+ endpointInterface = "org.jboss.test.ws.jaxws.cxf.jbws3827.ServiceIface"
+)
+@EndpointConfig(configFile = "WEB-INF/jaxws-endpoint-config.xml", configName = "Custom WS-Security Endpoint")
+public class ServiceImpl implements ServiceIface
+{
+ public String sayHello()
+ {
+ return "Secure Hello World!";
+ }
+}
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3827/UsernamePasswordCallback.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3827/UsernamePasswordCallback.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3827/UsernamePasswordCallback.java 2014-10-01 15:49:12 UTC (rev 18963)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.cxf.jbws3827;
+
+import java.io.IOException;
+
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.UnsupportedCallbackException;
+
+import org.apache.wss4j.common.ext.WSPasswordCallback;
+
+public class UsernamePasswordCallback implements CallbackHandler
+{
+ public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException
+ {
+ WSPasswordCallback pc = (WSPasswordCallback)callbacks[0];
+ if ("kermit".equals(pc.getIdentifier()))
+ pc.setPassword("thefrog");
+ else
+ pc.setPassword("wrong password");
+ }
+}
+
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3827/WEB-INF/jaxws-endpoint-config.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3827/WEB-INF/jaxws-endpoint-config.xml (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3827/WEB-INF/jaxws-endpoint-config.xml 2014-10-01 15:49:12 UTC (rev 18963)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jaxws-config xmlns="urn:jboss:jbossws-jaxws-config:4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:javaee="http://java.sun.com/xml/ns/javaee"
+ xsi:schemaLocation="urn:jboss:jbossws-jaxws-config:4.0 schema/jbossws-jaxws-config_4_0.xsd">
+
+ <endpoint-config>
+ <config-name>Custom WS-Security Endpoint</config-name>
+ <property>
+ <property-name>ws-security.callback-handler</property-name>
+ <property-value>org.jboss.test.ws.jaxws.cxf.jbws3827.ServerUsernamePasswordCallback</property-value>
+ </property>
+ </endpoint-config>
+
+</jaxws-config>
\ No newline at end of file
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3827/WEB-INF/serviceKeystore.properties
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3827/WEB-INF/serviceKeystore.properties (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3827/WEB-INF/serviceKeystore.properties 2014-10-01 15:49:12 UTC (rev 18963)
@@ -0,0 +1,24 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin
+org.apache.ws.security.crypto.merlin.keystore.type=jks
+org.apache.ws.security.crypto.merlin.keystore.password=sspass
+org.apache.ws.security.crypto.merlin.keystore.alias=myservicekey
+org.apache.ws.security.crypto.merlin.keystore.file=servicestore.jks
+
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3827/WEB-INF/servicestore.jks
===================================================================
(Binary files differ)
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3827/WEB-INF/servicestore.jks
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3827/WEB-INF/web.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3827/WEB-INF/web.xml (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3827/WEB-INF/web.xml 2014-10-01 15:49:12 UTC (rev 18963)
@@ -0,0 +1,25 @@
+<?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.cxf.jbws3827.ServiceImpl</servlet-class>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>TestService</servlet-name>
+ <url-pattern>/*</url-pattern>
+ </servlet-mapping>
+
+ <security-constraint>
+ <web-resource-collection>
+ <web-resource-name>TestService</web-resource-name>
+ <url-pattern>/*</url-pattern>
+ </web-resource-collection>
+ <user-data-constraint>
+ <transport-guarantee>CONFIDENTIAL</transport-guarantee>
+ </user-data-constraint>
+ </security-constraint>
+</web-app>
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3827/WEB-INF/wsdl/Greeting_Simplest.wsdl
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3827/WEB-INF/wsdl/Greeting_Simplest.wsdl (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3827/WEB-INF/wsdl/Greeting_Simplest.wsdl 2014-10-01 15:49:12 UTC (rev 18963)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions
+ targetNamespace="http://greetings/test"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:tns="http://greetings/test"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ >
+ <wsdl:import namespace="http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy"
+ location="https://localhost:8443/jaxws-jbws3827-wsse-policy-username/SecurityServic..." />
+
+ <wsdl:portType name="GreetingsService">
+ </wsdl:portType>
+
+ <wsdl:binding name="GreetingsServiceSoapBinding" type="tns:GreetingsService">
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ </wsdl:binding>
+
+ <wsdl:service name="GreetingsService">
+ <wsdl:port name="GreetingsServicePort" binding="tns:GreetingsServiceSoapBinding">
+ <soap:address location="http://localhost:8080/GreetingsServicePort"/>
+ </wsdl:port>
+ </wsdl:service>
+
+</wsdl:definitions>
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3827/WEB-INF/wsdl/SecurityService.wsdl
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3827/WEB-INF/wsdl/SecurityService.wsdl (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3827/WEB-INF/wsdl/SecurityService.wsdl 2014-10-01 15:49:12 UTC (rev 18963)
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<definitions targetNamespace="http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy" name="SecurityService"
+ xmlns:tns="http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:wsp="http://www.w3.org/ns/ws-policy"
+ xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit..."
+ xmlns:wsaws="http://www.w3.org/2005/08/addressing"
+ xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
+ <types>
+ <xsd:schema>
+ <xsd:import namespace="http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy" 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>
+ <portType name="ServiceIface">
+ <operation name="sayHello">
+ <input message="tns:sayHello"/>
+ <output message="tns:sayHelloResponse"/>
+ </operation>
+ </portType>
+ <binding name="SecurityServicePortBinding" type="tns:ServiceIface">
+ <wsp:PolicyReference URI="#SecurityServiceBindingPolicy"/>
+ <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>
+ </binding>
+ <service name="SecurityService">
+ <port name="SecurityServicePort" binding="tns:SecurityServicePortBinding">
+ <soap:address location="https://@jboss.bind.address@:8443/jaxws-jbws3827-wsse-policy-username"/>
+ </port>
+ </service>
+
+ <wsp:Policy wsu:Id="SecurityServiceBindingPolicy">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <foo:unknownPolicy xmlns:foo="http://cxf.apache.org/not/a/policy"/>
+ </wsp:All>
+ <wsp:All>
+ <wsaws:UsingAddressing xmlns:wsaws="http://www.w3.org/2006/05/addressing/wsdl"/>
+ <sp:TransportBinding>
+ <wsp:Policy>
+ <sp:TransportToken>
+ <wsp:Policy>
+ <sp:HttpsToken RequireClientCertificate="false"/>
+ </wsp:Policy>
+ </sp:TransportToken>
+ <sp:Layout>
+ <wsp:Policy>
+ <sp:Lax/>
+ </wsp:Policy>
+ </sp:Layout>
+ <sp:IncludeTimestamp/>
+ <sp:AlgorithmSuite>
+ <wsp:Policy>
+ <sp:Basic128/>
+ </wsp:Policy>
+ </sp:AlgorithmSuite>
+ </wsp:Policy>
+ </sp:TransportBinding>
+ <sp:Wss10>
+ <wsp:Policy>
+ <sp:MustSupportRefKeyIdentifier/>
+ </wsp:Policy>
+ </sp:Wss10>
+ <sp:SignedSupportingTokens>
+ <wsp:Policy>
+ <sp:UsernameToken sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysT...">
+ <wsp:Policy>
+ <sp:WssUsernameToken10/>
+ </wsp:Policy>
+ </sp:UsernameToken>
+ </wsp:Policy>
+ </sp:SignedSupportingTokens>
+ </wsp:All>
+ </wsp:ExactlyOne>
+ </wsp:Policy>
+
+</definitions>
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3827/WEB-INF/wsdl/SecurityService_schema1.xsd
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3827/WEB-INF/wsdl/SecurityService_schema1.xsd (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3827/WEB-INF/wsdl/SecurityService_schema1.xsd 2014-10-01 15:49:12 UTC (rev 18963)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<xs:schema version="1.0" targetNamespace="http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy" xmlns:tns="http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy" 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:schema>
+
Modified: stack/cxf/trunk/modules/testsuite/pom.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/pom.xml 2014-10-01 13:28:25 UTC (rev 18962)
+++ stack/cxf/trunk/modules/testsuite/pom.xml 2014-10-01 15:49:12 UTC (rev 18963)
@@ -859,6 +859,9 @@
<!-- # [JBWS-3832] WFLY master still to be updated -->
<exclude>org/jboss/test/ws/jaxws/cxf/in_container_client/CustomBusServletTestCaseForked*</exclude>
+
+ <!-- [JBWS-3827] certificate to be resolved -->
+ <exclude>org/jboss/test/ws/jaxws/cxf/jbws3827/JWBS3827TestCase</exclude>
</excludes>
</configuration>
</plugin>
10 years, 2 months