JBossWS SVN: r18945 - stack/cxf/trunk/modules/testsuite.
by jbossws-commits@lists.jboss.org
Author: rsearls
Date: 2014-09-23 08:00:27 -0400 (Tue, 23 Sep 2014)
New Revision: 18945
Modified:
stack/cxf/trunk/modules/testsuite/pom.xml
Log:
[JBWS-3831] disabled WSSecurityPolicyExamples23xTestCase waiting on cxf fix.
Modified: stack/cxf/trunk/modules/testsuite/pom.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/pom.xml 2014-09-22 15:56:45 UTC (rev 18944)
+++ stack/cxf/trunk/modules/testsuite/pom.xml 2014-09-23 12:00:27 UTC (rev 18945)
@@ -856,6 +856,9 @@
<!-- Manually setup KDC before run this test-->
<exclude>org/jboss/test/ws/jaxws/samples/wsse/kerberos/*TestCase*</exclude>
+
+ <!-- [JBWS-3831] waiting for cxf fix -->
+ <exclude>org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/WSSecurityPolicyExamples23xTestCase*</exclude>
</excludes>
</configuration>
</plugin>
10 years, 3 months
JBossWS SVN: r18944 - in stack/cxf/trunk/modules/testsuite/cxf-tests/src/test: resources/jaxws/cxf/jbws3805/WEB-INF and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2014-09-22 11:56:45 -0400 (Mon, 22 Sep 2014)
New Revision: 18944
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3805/JBWS3805TestCase.java
Removed:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3805/SoapAddressURISchemeTestCase.java
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3805/WEB-INF/jboss-webservices.xml
Log:
[JBWS-3805] Enriching test
Copied: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3805/JBWS3805TestCase.java (from rev 18938, stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3805/SoapAddressURISchemeTestCase.java)
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3805/JBWS3805TestCase.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3805/JBWS3805TestCase.java 2014-09-22 15:56:45 UTC (rev 18944)
@@ -0,0 +1,71 @@
+package org.jboss.test.ws.jaxws.cxf.jbws3805;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.InputStreamReader;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.util.LinkedList;
+import java.util.List;
+
+import junit.framework.Test;
+
+import org.jboss.shrinkwrap.api.asset.StringAsset;
+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;
+
+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<?>>();
+ list.add(new JBossWSTestHelper.WarDeployment("jaxws-cxf-jbws3805.war") {
+ {
+ archive.setManifest(new StringAsset("Manifest-Version: 1.0\n" + "Dependencies: org.jboss.ws.common\n"))
+ .addClass(org.jboss.test.ws.jaxws.cxf.jbws3805.EndpointOne.class).addClass(org.jboss.test.ws.jaxws.cxf.jbws3805.EndpointOneImpl.class)
+ .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/cxf/jbws3805/WEB-INF/jboss-webservices.xml"), "jboss-webservices.xml")
+ .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/cxf/jbws3805/WEB-INF/web.xml"));
+ }
+ });
+ return list.toArray(new BaseDeployment<?>[list.size()]);
+ }
+
+ public static Test suite()
+ {
+ return new JBossWSTestSetup(JBWS3805TestCase.class, JBossWSTestHelper.writeToFile(createDeployments()));
+ }
+
+ public void testWsdlSoapAddress() throws Exception
+ {
+ URL wsdlURL = new URL(publishURL + "?wsdl");
+ HttpURLConnection connection = (HttpURLConnection)wsdlURL.openConnection();
+ try
+ {
+ connection.connect();
+ assertEquals(200, connection.getResponseCode());
+ connection.getInputStream();
+
+ BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
+ String line;
+ while ((line = in.readLine()) != null)
+ {
+ if (line.contains("address location"))
+ {
+ assertTrue("Unexpected uri scheme", line.contains("https://foo:8443/jaxws-cxf-JBWS3805/HelloService"));
+ return;
+ }
+ }
+ fail("Could not check soap:address!");
+ }
+ finally
+ {
+ connection.disconnect();
+ }
+
+ }
+
+}
Deleted: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3805/SoapAddressURISchemeTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3805/SoapAddressURISchemeTestCase.java 2014-09-22 15:49:37 UTC (rev 18943)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3805/SoapAddressURISchemeTestCase.java 2014-09-22 15:56:45 UTC (rev 18944)
@@ -1,71 +0,0 @@
-package org.jboss.test.ws.jaxws.cxf.jbws3805;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.InputStreamReader;
-import java.net.HttpURLConnection;
-import java.net.URL;
-import java.util.LinkedList;
-import java.util.List;
-
-import junit.framework.Test;
-
-import org.jboss.shrinkwrap.api.asset.StringAsset;
-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;
-
-public class SoapAddressURISchemeTestCase extends JBossWSTest
-{
- private static String publishURL = "http://" + getServerHost() + ":8080/jaxws-cxf-jbws3805/HelloService";
-
- public static BaseDeployment<?>[] createDeployments()
- {
- List<BaseDeployment<?>> list = new LinkedList<BaseDeployment<?>>();
- list.add(new JBossWSTestHelper.WarDeployment("jaxws-cxf-jbws3805.war") {
- {
- archive.setManifest(new StringAsset("Manifest-Version: 1.0\n" + "Dependencies: org.jboss.ws.common\n"))
- .addClass(org.jboss.test.ws.jaxws.cxf.jbws3805.EndpointOne.class).addClass(org.jboss.test.ws.jaxws.cxf.jbws3805.EndpointOneImpl.class)
- .addAsWebInfResource(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/cxf/jbws3805/WEB-INF/jboss-webservices.xml"), "jboss-webservices.xml")
- .setWebXML(new File(JBossWSTestHelper.getTestResourcesDir() + "/jaxws/cxf/jbws3805/WEB-INF/web.xml"));
- }
- });
- return list.toArray(new BaseDeployment<?>[list.size()]);
- }
-
- public static Test suite()
- {
- return new JBossWSTestSetup(SoapAddressURISchemeTestCase.class, JBossWSTestHelper.writeToFile(createDeployments()));
- }
-
- public void testSoapAddressURIScheme() throws Exception
- {
- URL wsdlURL = new URL(publishURL + "?wsdl");
- HttpURLConnection connection = (HttpURLConnection)wsdlURL.openConnection();
- try
- {
- connection.connect();
- assertEquals(200, connection.getResponseCode());
- connection.getInputStream();
-
- BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
- String line;
- while ((line = in.readLine()) != null)
- {
- if (line.contains("address location"))
- {
- assertTrue("Unexpected uri scheme", line.contains("https") && line.contains("8443"));
- return;
- }
- }
- fail("Could not check soap:address!");
- }
- finally
- {
- connection.disconnect();
- }
-
- }
-
-}
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3805/WEB-INF/jboss-webservices.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3805/WEB-INF/jboss-webservices.xml 2014-09-22 15:49:37 UTC (rev 18943)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3805/WEB-INF/jboss-webservices.xml 2014-09-22 15:56:45 UTC (rev 18944)
@@ -8,5 +8,13 @@
<name>wsdl.soapAddress.rewrite.wsdl-uri-scheme</name>
<value>https</value>
</property>
+ <property>
+ <name>wsdl.soapAddress.rewrite.wsdl-path-rewrite-rule</name>
+ <value>s/jbws/JBWS/</value>
+ </property>
+ <property>
+ <name>wsdl.soapAddress.rewrite.wsdl-host</name>
+ <value>foo</value>
+ </property>
</webservices>
10 years, 3 months
JBossWS SVN: r18943 - stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2150.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2014-09-22 11:49:37 -0400 (Mon, 22 Sep 2014)
New Revision: 18943
Modified:
stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2150/JBWS2150TestCaseForked.java
Log:
Minor change to a comment
Modified: stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2150/JBWS2150TestCaseForked.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2150/JBWS2150TestCaseForked.java 2014-09-22 15:49:05 UTC (rev 18942)
+++ stack/cxf/trunk/modules/testsuite/shared-tests/src/test/java/org/jboss/test/ws/jaxws/jbws2150/JBWS2150TestCaseForked.java 2014-09-22 15:49:37 UTC (rev 18943)
@@ -632,7 +632,7 @@
}
/**
- * Basically the same as the test above; even if rewrite is off, we still get the loadbalancer address in the wsdl
+ * Basically the same as testRewriteLoadBalancerCodeFirst; even if rewrite is off, we still get the loadbalancer address in the wsdl
* for code-first endpoint, as there's no user provided wsdl with a different address in it.
*
* @throws Exception
10 years, 3 months
JBossWS SVN: r18942 - stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/metadata.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2014-09-22 11:49:05 -0400 (Mon, 22 Sep 2014)
New Revision: 18942
Modified:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/metadata/MetadataBuilder.java
Log:
[JBWS-3805] Get the metadata from the deployment (they're now created and set earlier)
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/metadata/MetadataBuilder.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/metadata/MetadataBuilder.java 2014-09-22 15:47:53 UTC (rev 18941)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/metadata/MetadataBuilder.java 2014-09-22 15:49:05 UTC (rev 18942)
@@ -25,7 +25,6 @@
import static org.jboss.wsf.stack.cxf.Messages.MESSAGES;
import java.net.URL;
-import java.security.AccessController;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
@@ -42,17 +41,14 @@
import org.jboss.ws.common.JavaUtils;
import org.jboss.ws.common.deployment.SOAPAddressWSDLParser;
-import org.jboss.ws.common.management.AbstractServerConfig;
import org.jboss.wsf.spi.deployment.ArchiveDeployment;
import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.deployment.HttpEndpoint;
-import org.jboss.wsf.spi.management.ServerConfig;
import org.jboss.wsf.spi.metadata.config.SOAPAddressRewriteMetadata;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainMetaData;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainsMetaData;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData;
-import org.jboss.wsf.spi.metadata.webservices.JBossWebservicesMetaData;
import org.jboss.wsf.spi.metadata.webservices.PortComponentMetaData;
import org.jboss.wsf.spi.metadata.webservices.WebserviceDescriptionMetaData;
import org.jboss.wsf.spi.metadata.webservices.WebservicesMetaData;
@@ -77,11 +73,7 @@
public DDBeans build(Deployment dep)
{
- //prepare the WSDL soap:address metadata and attach it to the deployment for later usage
- final SOAPAddressRewriteMetadata sarm = new SOAPAddressRewriteMetadata(getServerConfig(),
- dep.getAttachment(JBossWebservicesMetaData.class));
- dep.addAttachment(SOAPAddressRewriteMetadata.class, sarm);
-
+ final SOAPAddressRewriteMetadata sarm = dep.getAttachment(SOAPAddressRewriteMetadata.class);
Map<QName, String> serviceNameAddressMap = new HashMap<QName, String>();
Map<String, SOAPAddressWSDLParser> soapAddressWsdlParsers = new HashMap<String, SOAPAddressWSDLParser>();
DDBeans dd = new DDBeans();
@@ -331,13 +323,6 @@
}
}
- private static ServerConfig getServerConfig() {
- if(System.getSecurityManager() == null) {
- return AbstractServerConfig.getServerIntegrationServerConfig();
- }
- return AccessController.doPrivileged(AbstractServerConfig.GET_SERVER_INTEGRATION_SERVER_CONFIG);
- }
-
/**
* Extracts the typeNS given the package name
* Algorithm is based on the one specified in JAXWS v2.0 spec
10 years, 3 months
JBossWS SVN: r18941 - common/trunk/src/main/java/org/jboss/ws/common/deployment.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2014-09-22 11:47:53 -0400 (Mon, 22 Sep 2014)
New Revision: 18941
Modified:
common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointAddressDeploymentAspect.java
Log:
[JBWS-3805] Move metadata creation earlier in the DA chain and use it in EndpointAddressDA too
Modified: common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointAddressDeploymentAspect.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointAddressDeploymentAspect.java 2014-09-22 14:25:57 UTC (rev 18940)
+++ common/trunk/src/main/java/org/jboss/ws/common/deployment/EndpointAddressDeploymentAspect.java 2014-09-22 15:47:53 UTC (rev 18941)
@@ -39,12 +39,14 @@
import org.jboss.wsf.spi.deployment.HttpEndpoint;
import org.jboss.wsf.spi.deployment.Service;
import org.jboss.wsf.spi.management.ServerConfig;
+import org.jboss.wsf.spi.metadata.config.SOAPAddressRewriteMetadata;
import org.jboss.wsf.spi.metadata.j2ee.EJBArchiveMetaData;
import org.jboss.wsf.spi.metadata.j2ee.EJBMetaData;
import org.jboss.wsf.spi.metadata.j2ee.EJBSecurityMetaData;
import org.jboss.wsf.spi.metadata.j2ee.JSEArchiveMetaData;
import org.jboss.wsf.spi.metadata.j2ee.JSESecurityMetaData;
import org.jboss.wsf.spi.metadata.j2ee.JSESecurityMetaData.JSEResourceCollection;
+import org.jboss.wsf.spi.metadata.webservices.JBossWebservicesMetaData;
/**
* A deployer that assigns the endpoint address.
@@ -58,15 +60,19 @@
@Override
public void start(Deployment dep)
{
+ // prepare the WSDL soap:address metadata and attach it to the deployment for later usage
+ final SOAPAddressRewriteMetadata sarm = new SOAPAddressRewriteMetadata(getServerConfig(),
+ dep.getAttachment(JBossWebservicesMetaData.class));
+ dep.addAttachment(SOAPAddressRewriteMetadata.class, sarm);
+
final Service service = dep.getService();
String contextRoot = service.getContextRoot();
if (contextRoot == null)
throw Messages.MESSAGES.cannotObtainContextRoot(dep.getSimpleName());
PortValue port = new PortValue((Integer)service.getProperty("port"), null);
- ServerConfig serverConfig = getServerConfig();
- port.setServerConfig(serverConfig);
- String host = serverConfig.getWebServiceHost();
+ port.setSOAPAddressRewriteMetadata(sarm);
+ String host = sarm.getWebServiceHost();
Map<String, Endpoint> endpointsMap = new HashMap<String, Endpoint>();
List<Endpoint> deleteList = new LinkedList<Endpoint>();
for (Endpoint ep : service.getEndpoints())
@@ -175,7 +181,7 @@
}
private static class PortValue {
- private ServerConfig config;
+ private SOAPAddressRewriteMetadata sarm;
private Integer port;
private Integer securePort;
@@ -184,11 +190,11 @@
this.securePort = securePort;
}
- public void setServerConfig(ServerConfig config)
+ public void setSOAPAddressRewriteMetadata(SOAPAddressRewriteMetadata sarm)
{
this.port = null;
this.securePort = null;
- this.config = config;
+ this.sarm = sarm;
}
public Integer getValue(boolean confidential) {
@@ -197,18 +203,18 @@
public Integer getPortValue()
{
- if (this.port == null && this.config != null)
+ if (this.port == null && this.sarm != null)
{
- this.port = this.config.getWebServicePort();
+ this.port = this.sarm.getWebServicePort();
}
return this.port;
}
public Integer getSecurePortValue()
{
- if (this.securePort == null && this.config != null)
+ if (this.securePort == null && this.sarm != null)
{
- this.securePort = this.config.getWebServiceSecurePort();
+ this.securePort = this.sarm.getWebServiceSecurePort();
}
return this.securePort;
}
10 years, 3 months
JBossWS SVN: r18940 - in stack/cxf/trunk/modules: server/src/main/java/org/jboss/wsf/stack/cxf and 9 other directories.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2014-09-22 10:25:57 -0400 (Mon, 22 Sep 2014)
New Revision: 18940
Modified:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/Constants.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/RequestHandlerImpl.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/addressRewrite/SoapAddressRewriteHelper.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/NonSpringBusHolder.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/SpringBusHolder.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/EndpointImpl.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/interceptor/WSDLSoapAddressRewriteInterceptor.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/interceptor/util/WSDLSoapAddressRewriteUtils.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/metadata/MetadataBuilder.java
stack/cxf/trunk/modules/server/src/test/java/org/jboss/wsf/stack/cxf/configuration/BusHolderTest.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3098/BusHolderLifeCycleTestCase.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3805/WEB-INF/jboss-webservices.xml
Log:
[JBWS-3805] Allow overriding soap:address rewrite options in jboss-webservices.xml
Modified: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/Constants.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/Constants.java 2014-09-22 14:25:36 UTC (rev 18939)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/client/Constants.java 2014-09-22 14:25:57 UTC (rev 18940)
@@ -45,7 +45,6 @@
public static final String CXF_WS_DISCOVERY_ENABLED = "cxf.ws-discovery.enabled";
public static final String JBWS_CXF_DISABLE_HANDLER_AUTH_CHECKS = "org.jboss.ws.cxf.disableHandlerAuthChecks";
public static final String JBWS_CXF_NO_LOCAL_BC = "org.jboss.ws.cxf.noLocalBC";
- public static final String JBWS_CXF_WSDL_URI_SCHEME = "org.jboss.ws.cxf.wsdl.uriScheme";
public static final String JBWS_CXF_JAXWS_CLIENT_BUS_STRATEGY = "org.jboss.ws.cxf.jaxws-client.bus.strategy";
public static final String THREAD_BUS_STRATEGY = "THREAD_BUS";
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/RequestHandlerImpl.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/RequestHandlerImpl.java 2014-09-22 14:25:36 UTC (rev 18939)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/RequestHandlerImpl.java 2014-09-22 14:25:57 UTC (rev 18940)
@@ -49,11 +49,13 @@
import org.apache.cxf.transport.http.HTTPTransportFactory;
import org.jboss.util.NotImplementedException;
import org.jboss.ws.common.management.AbstractServerConfig;
+import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.invocation.InvocationContext;
import org.jboss.wsf.spi.invocation.RequestHandler;
import org.jboss.wsf.spi.management.EndpointMetrics;
import org.jboss.wsf.spi.management.ServerConfig;
+import org.jboss.wsf.spi.metadata.config.SOAPAddressRewriteMetadata;
import org.jboss.wsf.stack.cxf.addressRewrite.SoapAddressRewriteHelper;
import org.jboss.wsf.stack.cxf.configuration.BusHolder;
@@ -94,16 +96,16 @@
return;
}
final boolean statisticsEnabled = getServerConfig().isStatisticsEnabled();
- Long beginTime = statisticsEnabled == true ? initRequestMetrics(ep) : 0;
- Bus bus = ep.getService().getDeployment().getAttachment(BusHolder.class).getBus();
- AbstractHTTPDestination dest = findDestination(req, bus);
- HttpServletResponseWrapper response = new HttpServletResponseWrapper(res);
+ final Long beginTime = statisticsEnabled == true ? initRequestMetrics(ep) : 0;
+ final Deployment dep = ep.getService().getDeployment();
+ final AbstractHTTPDestination dest = findDestination(req, dep.getAttachment(BusHolder.class).getBus());
+ final HttpServletResponseWrapper response = new HttpServletResponseWrapper(res);
try
{
ServletConfig cfg = (ServletConfig)context.getAttribute(ServletConfig.class.getName());
if (isGetWithQueryString) {
final EndpointInfo endpointInfo = dest.getEndpointInfo();
- final boolean autoRewrite = SoapAddressRewriteHelper.isAutoRewriteOn(getServerConfig());
+ final boolean autoRewrite = SoapAddressRewriteHelper.isAutoRewriteOn(dep.getAttachment(SOAPAddressRewriteMetadata.class));
endpointInfo.setProperty(WSDLGetUtils.AUTO_REWRITE_ADDRESS, autoRewrite);
endpointInfo.setProperty(WSDLGetUtils.AUTO_REWRITE_ADDRESS_ALL, autoRewrite);
}
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/addressRewrite/SoapAddressRewriteHelper.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/addressRewrite/SoapAddressRewriteHelper.java 2014-09-22 14:25:36 UTC (rev 18939)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/addressRewrite/SoapAddressRewriteHelper.java 2014-09-22 14:25:57 UTC (rev 18940)
@@ -27,10 +27,9 @@
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
-import java.util.Map;
import org.jboss.wsf.spi.management.ServerConfig;
-import org.jboss.wsf.stack.cxf.client.Constants;
+import org.jboss.wsf.spi.metadata.config.SOAPAddressRewriteMetadata;
/**
* Helper for rewriting soap:address in published wsdl
@@ -49,18 +48,18 @@
*
* @param wsdlAddress The soap:address in the wsdl
* @param epAddress The address that has been computed for the endpoint
- * @param serverConfig The current ServerConfig
+ * @param sarm The deployment SOAPAddressRewriteMetadata
* @return The rewritten soap:address to be used in the wsdl
*/
- public static String getRewrittenPublishedEndpointUrl(String wsdlAddress, String epAddress, ServerConfig serverConfig, Map<String, String> props) {
+ public static String getRewrittenPublishedEndpointUrl(String wsdlAddress, String epAddress, SOAPAddressRewriteMetadata sarm) {
if (wsdlAddress == null) {
return null;
}
- if (isRewriteRequired(serverConfig, wsdlAddress))
+ if (isRewriteRequired(sarm, wsdlAddress))
{
final String origUriScheme = getUriScheme(wsdlAddress); //will be https if the user wants a https address in the wsdl
final String newUriScheme = getUriScheme(epAddress); //will be https if the user set confidential transport for the endpoint
- return rewriteSoapAddress(serverConfig, wsdlAddress, epAddress, rewriteUriScheme(origUriScheme, newUriScheme, serverConfig, props));
+ return rewriteSoapAddress(sarm, wsdlAddress, epAddress, rewriteUriScheme(sarm, origUriScheme, newUriScheme));
}
else
{
@@ -73,24 +72,24 @@
* This method is to be used for code-first endpoints, when no wsdl is provided by the user.
*
* @param address The container computed endpoint address
- * @param serverConfig The current ServerConfig
+ * @param sarm The deployment SOAPAddressRewriteMetadata
* @return
*/
- public static String getRewrittenPublishedEndpointUrl(String address, ServerConfig serverConfig, Map<String, String> props)
+ public static String getRewrittenPublishedEndpointUrl(String address, SOAPAddressRewriteMetadata sarm)
{
try
{
- if (isPathRewriteRequired(serverConfig) || isSchemeRewriteRequired(serverConfig, props)) {
+ if (isPathRewriteRequired(sarm) || isSchemeRewriteRequired(sarm)) {
final URL url = new URL(address);
- final String uriScheme = rewriteUriScheme(getUriScheme(address), null, serverConfig, props);
- final String port = getDotPortNumber(uriScheme, serverConfig);
+ final String uriScheme = rewriteUriScheme(sarm, getUriScheme(address), null);
+ final String port = getDotPortNumber(uriScheme, sarm);
final StringBuilder builder = new StringBuilder();
builder.append(uriScheme);
builder.append("://");
builder.append(url.getHost());
builder.append(port);
final String path = url.getPath();
- builder.append(isPathRewriteRequired(serverConfig) ? SEDProcessor.newInstance(serverConfig.getWebServicePathRewriteRule()).processLine(path) : path);
+ builder.append(isPathRewriteRequired(sarm) ? SEDProcessor.newInstance(sarm.getWebServicePathRewriteRule()).processLine(path) : path);
final String newUrl = builder.toString();
ADDRESS_REWRITE_LOGGER.addressRewritten(address, newUrl);
@@ -109,15 +108,15 @@
}
}
- public static boolean isAutoRewriteOn(ServerConfig serverConfig)
+ public static boolean isAutoRewriteOn(SOAPAddressRewriteMetadata sarm)
{
- return serverConfig.isModifySOAPAddress() && ServerConfig.UNDEFINED_HOSTNAME.equals(serverConfig.getWebServiceHost());
+ return sarm.isModifySOAPAddress() && ServerConfig.UNDEFINED_HOSTNAME.equals(sarm.getWebServiceHost());
}
- private static boolean isRewriteRequired(ServerConfig serverConfig, String address)
+ private static boolean isRewriteRequired(SOAPAddressRewriteMetadata sarm, String address)
{
//check config prop forcing address rewrite
- if (serverConfig.isModifySOAPAddress())
+ if (sarm.isModifySOAPAddress())
{
ADDRESS_REWRITE_LOGGER.addressRewriteRequiredBecauseOfServerConf(address);
return true;
@@ -158,27 +157,28 @@
* Rewrite the provided address according to the current server
* configuration and always using the specified uriScheme.
*
+ * @param sarm The deployment SOAPAddressRewriteMetadata
* @param origAddress The source address
* @param newAddress The new (candidate) address
* @param uriScheme The uriScheme to use for rewrite
* @return The obtained address
*/
- private static String rewriteSoapAddress(ServerConfig serverConfig, String origAddress, String newAddress, String uriScheme)
+ private static String rewriteSoapAddress(SOAPAddressRewriteMetadata sarm, String origAddress, String newAddress, String uriScheme)
{
try
{
URL url = new URL(newAddress);
String path = url.getPath();
- String host = serverConfig.getWebServiceHost();
- String port = getDotPortNumber(uriScheme, serverConfig);
+ String host = sarm.getWebServiceHost();
+ String port = getDotPortNumber(uriScheme, sarm);
StringBuilder sb = new StringBuilder(uriScheme);
sb.append("://");
sb.append(host);
sb.append(port);
- if (isPathRewriteRequired(serverConfig)) {
- sb.append(SEDProcessor.newInstance(serverConfig.getWebServicePathRewriteRule()).processLine(path));
+ if (isPathRewriteRequired(sarm)) {
+ sb.append(SEDProcessor.newInstance(sarm.getWebServicePathRewriteRule()).processLine(path));
}
else
{
@@ -196,11 +196,11 @@
}
}
- private static String getDotPortNumber(String uriScheme, ServerConfig serverConfig) {
+ private static String getDotPortNumber(String uriScheme, SOAPAddressRewriteMetadata sarm) {
String port = "";
if (HTTPS.equals(uriScheme))
{
- int portNo = serverConfig.getWebServiceSecurePort();
+ int portNo = sarm.getWebServiceSecurePort();
if (portNo != 443)
{
port = ":" + portNo;
@@ -208,7 +208,7 @@
}
else
{
- int portNo = serverConfig.getWebServicePort();
+ int portNo = sarm.getWebServicePort();
if (portNo != 80)
{
port = ":" + portNo;
@@ -232,34 +232,29 @@
}
- public static boolean isPathRewriteRequired(ServerConfig sc){
- if (!sc.isModifySOAPAddress()) {
+ public static boolean isPathRewriteRequired(SOAPAddressRewriteMetadata sarm){
+ if (!sarm.isModifySOAPAddress()) {
return false;
}
- final String pathRewriteRule = sc.getWebServicePathRewriteRule();
+ final String pathRewriteRule = sarm.getWebServicePathRewriteRule();
return pathRewriteRule != null && !pathRewriteRule.isEmpty();
}
- public static boolean isSchemeRewriteRequired(ServerConfig sc, Map<String, String> props) {
- if (!sc.isModifySOAPAddress()) {
+ public static boolean isSchemeRewriteRequired(SOAPAddressRewriteMetadata sarm) {
+ if (!sarm.isModifySOAPAddress()) {
return false;
- } //TODO also check modify soap address is enabled in wsmd
- return sc.getWebServiceUriScheme() != null || props.get(Constants.JBWS_CXF_WSDL_URI_SCHEME) != null;
+ }
+ return sarm.getWebServiceUriScheme() != null;
}
- private static String rewriteUriScheme(final String origUriScheme, final String newUriScheme, final ServerConfig serverConfig, final Map<String, String> props) {
+ private static String rewriteUriScheme(final SOAPAddressRewriteMetadata sarm, final String origUriScheme, final String newUriScheme) {
//1) if either of orig URI or new URI uses HTTPS, use HTTPS
String uriScheme = (HTTPS.equals(origUriScheme) || HTTPS.equals(newUriScheme)) ? HTTPS : HTTP;
- //2) server configuration override
- final String serverUriScheme = serverConfig.getWebServiceUriScheme();
+ //2) server / deployment configuration override
+ final String serverUriScheme = sarm.getWebServiceUriScheme();
if (serverUriScheme != null) {
uriScheme = serverUriScheme;
}
- //3) deployment configuration override
- final String mdUriScheme = props.get(Constants.JBWS_CXF_WSDL_URI_SCHEME);
- if (mdUriScheme != null) {
- uriScheme = mdUriScheme;
- }
return uriScheme;
}
}
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java 2014-09-22 14:25:36 UTC (rev 18939)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java 2014-09-22 14:25:57 UTC (rev 18940)
@@ -21,7 +21,6 @@
*/
package org.jboss.wsf.stack.cxf.configuration;
-import java.security.AccessController;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
@@ -56,7 +55,6 @@
import org.apache.cxf.wsdl11.WSDLManagerImpl;
import org.jboss.ws.api.annotation.PolicySets;
import org.jboss.ws.api.binding.BindingCustomization;
-import org.jboss.ws.common.management.AbstractServerConfig;
import org.jboss.wsf.spi.SPIProvider;
import org.jboss.wsf.spi.WSFException;
import org.jboss.wsf.spi.classloading.ClassLoaderProvider;
@@ -64,7 +62,7 @@
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;
+import org.jboss.wsf.spi.metadata.config.SOAPAddressRewriteMetadata;
import org.jboss.wsf.spi.metadata.webservices.JBossWebservicesMetaData;
import org.jboss.wsf.spi.security.JASPIAuthenticationProvider;
import org.jboss.wsf.stack.cxf.Loggers;
@@ -128,7 +126,7 @@
}
Map<String, String> props = getProperties(wsmd);
- setInterceptors(bus, props);
+ setInterceptors(bus, dep, props);
dep.addAttachment(Bus.class, bus);
try
@@ -203,7 +201,7 @@
public abstract Configurer createServerConfigurer(BindingCustomization customization,
WSDLFilePublisher wsdlPublisher, List<Endpoint> depEndpoints, UnifiedVirtualFile root, String epConfigName, String epConfigFile);
- protected void setInterceptors(Bus bus, Map<String, String> props)
+ protected void setInterceptors(Bus bus, Deployment dep, Map<String, String> props)
{
//Install the EndpointAssociationInterceptor for linking every message exchange
//with the proper spi Endpoint retrieved in CXFServletExt
@@ -216,9 +214,9 @@
bus.getInInterceptors().add(new HandlerAuthInterceptor());
}
- final ServerConfig sc = getServerConfig();
- if (SoapAddressRewriteHelper.isPathRewriteRequired(sc) || SoapAddressRewriteHelper.isSchemeRewriteRequired(sc, props)) {
- bus.getInInterceptors().add(new WSDLSoapAddressRewriteInterceptor(props));
+ final SOAPAddressRewriteMetadata sarm = dep.getAttachment(SOAPAddressRewriteMetadata.class);
+ if (SoapAddressRewriteHelper.isPathRewriteRequired(sarm) || SoapAddressRewriteHelper.isSchemeRewriteRequired(sarm)) {
+ bus.getInInterceptors().add(new WSDLSoapAddressRewriteInterceptor(sarm));
}
}
@@ -356,13 +354,6 @@
return prop != null ? Long.parseLong(prop) : defaultValue;
}
- protected ServerConfig getServerConfig() {
- if(System.getSecurityManager() == null) {
- return AbstractServerConfig.getServerIntegrationServerConfig();
- }
- return AccessController.doPrivileged(AbstractServerConfig.GET_SERVER_INTEGRATION_SERVER_CONFIG);
- }
-
/**
* Return the hold bus
*
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/NonSpringBusHolder.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/NonSpringBusHolder.java 2014-09-22 14:25:36 UTC (rev 18939)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/NonSpringBusHolder.java 2014-09-22 14:25:57 UTC (rev 18940)
@@ -40,6 +40,7 @@
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.metadata.config.SOAPAddressRewriteMetadata;
import org.jboss.wsf.spi.metadata.webservices.JBossWebservicesMetaData;
import org.jboss.wsf.stack.cxf.Messages;
import org.jboss.wsf.stack.cxf.client.configuration.JBossWSNonSpringBusFactory;
@@ -115,6 +116,7 @@
endpoint.getFeatures().add(addressingFeature);
}
endpoint.setPublishedEndpointUrl(dde.getPublishedEndpointUrl());
+ endpoint.setSOAPAddressRewriteMetadata(dep.getAttachment(SOAPAddressRewriteMetadata.class));
endpoint.publish();
endpoints.add(endpoint);
if (dde.isMtomEnabled())
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/SpringBusHolder.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/SpringBusHolder.java 2014-09-22 14:25:36 UTC (rev 18939)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/SpringBusHolder.java 2014-09-22 14:25:57 UTC (rev 18940)
@@ -133,6 +133,8 @@
}
super.configure(resolver, configurer, wsmd, dep);
+ bus.setProperty(Deployment.class.getName(), dep); // propagate Deployment into the Bus for usage during Endpoint creation
+
GenericApplicationContext jbosswsCxfContext = null;
//load stuff from provided jbossws-cxf.xml DD
if (jbosswsCxfLocation != null)
@@ -163,6 +165,7 @@
}
}
}
+ bus.setProperty(Deployment.class.getName(), null);
configured = true;
}
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/EndpointImpl.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/EndpointImpl.java 2014-09-22 14:25:36 UTC (rev 18939)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/EndpointImpl.java 2014-09-22 14:25:57 UTC (rev 18940)
@@ -22,9 +22,7 @@
package org.jboss.wsf.stack.cxf.deployment;
import java.io.IOException;
-import java.security.AccessController;
import java.util.Collection;
-import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -40,9 +38,10 @@
import org.apache.cxf.service.model.EndpointInfo;
import org.apache.cxf.service.model.ServiceInfo;
import org.jboss.ws.common.configuration.ConfigHelper;
-import org.jboss.ws.common.management.AbstractServerConfig;
+import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.management.ServerConfig;
import org.jboss.wsf.spi.metadata.config.CommonConfig;
+import org.jboss.wsf.spi.metadata.config.SOAPAddressRewriteMetadata;
import org.jboss.wsf.stack.cxf.Loggers;
import org.jboss.wsf.stack.cxf.addressRewrite.SoapAddressRewriteHelper;
@@ -59,6 +58,7 @@
{
private WSDLFilePublisher wsdlPublisher;
private CommonConfig config;
+ private SOAPAddressRewriteMetadata sarm;
public EndpointImpl(Object implementor)
{
@@ -183,14 +183,28 @@
{
this.wsdlPublisher = wsdlPublisher;
}
+
+ public void setSOAPAddressRewriteMetadata(SOAPAddressRewriteMetadata sarm)
+ {
+ this.sarm = sarm;
+ }
+
+ private SOAPAddressRewriteMetadata getSOAPAddressRewriteMetadata()
+ {
+ if (sarm == null) {
+ Deployment dep = (Deployment)getBus().getProperty(Deployment.class.getName());
+ sarm = dep.getAttachment(SOAPAddressRewriteMetadata.class);
+ }
+ return sarm;
+ }
/**
* For both code-first and wsdl-first scenarios, reset the endpoint address
* so that it is written to the generated wsdl file.
*/
private void updateSoapAddress() {
- ServerConfig servConfig = getServerConfig();
- if (servConfig.isModifySOAPAddress()) {
+ final SOAPAddressRewriteMetadata metadata = getSOAPAddressRewriteMetadata();
+ if (metadata.isModifySOAPAddress()) {
//- code-first handling
List<ServiceInfo> sevInfos = getServer().getEndpoint().getService().getServiceInfos();
for (ServiceInfo si: sevInfos){
@@ -201,9 +215,8 @@
ei.setAddress(publishedEndpointUrl);
} else {
//- wsdl-first handling
- if (ei.getAddress().contains(ServerConfig.UNDEFINED_HOSTNAME)){
- Map<String, String> props = Collections.emptyMap();
- String epurl = SoapAddressRewriteHelper.getRewrittenPublishedEndpointUrl(ei.getAddress(), servConfig, props); //TODO [JBWS-3805]
+ if (ei.getAddress().contains(ServerConfig.UNDEFINED_HOSTNAME)) {
+ String epurl = SoapAddressRewriteHelper.getRewrittenPublishedEndpointUrl(ei.getAddress(), metadata);
ei.setAddress(epurl);
}
}
@@ -211,12 +224,4 @@
}
}
}
-
- private static ServerConfig getServerConfig() {
- if(System.getSecurityManager() == null) {
- return AbstractServerConfig.getServerIntegrationServerConfig();
- }
- return AccessController.doPrivileged(AbstractServerConfig.GET_SERVER_INTEGRATION_SERVER_CONFIG);
- }
-
}
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/interceptor/WSDLSoapAddressRewriteInterceptor.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/interceptor/WSDLSoapAddressRewriteInterceptor.java 2014-09-22 14:25:36 UTC (rev 18939)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/interceptor/WSDLSoapAddressRewriteInterceptor.java 2014-09-22 14:25:57 UTC (rev 18940)
@@ -21,13 +21,12 @@
*/
package org.jboss.wsf.stack.cxf.interceptor;
-import java.util.Map;
-
import org.apache.cxf.frontend.WSDLGetUtils;
import org.apache.cxf.interceptor.Fault;
import org.apache.cxf.message.Message;
import org.apache.cxf.phase.AbstractPhaseInterceptor;
import org.apache.cxf.phase.Phase;
+import org.jboss.wsf.spi.metadata.config.SOAPAddressRewriteMetadata;
import org.jboss.wsf.stack.cxf.interceptor.util.WSDLSoapAddressRewriteUtils;
/**
@@ -41,10 +40,10 @@
public class WSDLSoapAddressRewriteInterceptor extends AbstractPhaseInterceptor<Message> {
private final WSDLGetUtils wsdlGetUtils;
- public WSDLSoapAddressRewriteInterceptor(Map<String, String> props) {
+ public WSDLSoapAddressRewriteInterceptor(SOAPAddressRewriteMetadata sarm) {
// this must run before WSDLGetInterceptor which is in Phase.READ
super(Phase.POST_STREAM);
- this.wsdlGetUtils = new WSDLSoapAddressRewriteUtils(props);
+ this.wsdlGetUtils = new WSDLSoapAddressRewriteUtils(sarm);
}
public void handleMessage(Message message) throws Fault {
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/interceptor/util/WSDLSoapAddressRewriteUtils.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/interceptor/util/WSDLSoapAddressRewriteUtils.java 2014-09-22 14:25:36 UTC (rev 18939)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/interceptor/util/WSDLSoapAddressRewriteUtils.java 2014-09-22 14:25:57 UTC (rev 18940)
@@ -21,15 +21,12 @@
*/
package org.jboss.wsf.stack.cxf.interceptor.util;
-import java.security.AccessController;
-import java.util.Map;
-
import javax.wsdl.Definition;
import org.apache.cxf.frontend.WSDLGetUtils;
import org.apache.cxf.service.model.EndpointInfo;
-import org.jboss.ws.common.management.AbstractServerConfig;
import org.jboss.wsf.spi.management.ServerConfig;
+import org.jboss.wsf.spi.metadata.config.SOAPAddressRewriteMetadata;
import org.jboss.wsf.stack.cxf.addressRewrite.SoapAddressRewriteHelper;
/**
@@ -43,11 +40,11 @@
*/
public class WSDLSoapAddressRewriteUtils extends WSDLGetUtils {
- private final Map<String, String> props;
+ private final SOAPAddressRewriteMetadata sarm;
- public WSDLSoapAddressRewriteUtils(Map<String, String> props) {
+ public WSDLSoapAddressRewriteUtils(SOAPAddressRewriteMetadata sarm) {
super();
- this.props = props;
+ this.sarm = sarm;
}
@Override
@@ -59,20 +56,12 @@
updatePublishedEndpointUrl(epurl, def, endpointInfo.getName());
} else {
// When using replacement path, must set replacement path in the active url.
- final ServerConfig sc = getServerConfig();
- if ((SoapAddressRewriteHelper.isPathRewriteRequired(sc) || SoapAddressRewriteHelper.isSchemeRewriteRequired(sc, props)) //TODO if we ended up here, the checks are perhaps not needed (otherwise this won't have been installed)
+ if ((SoapAddressRewriteHelper.isPathRewriteRequired(sarm) || SoapAddressRewriteHelper.isSchemeRewriteRequired(sarm)) //TODO if we ended up here, the checks are perhaps not needed (otherwise this won't have been installed)
&& endpointInfo.getAddress().contains(ServerConfig.UNDEFINED_HOSTNAME)) {
- epurl = SoapAddressRewriteHelper.getRewrittenPublishedEndpointUrl(epurl, sc, props);
+ epurl = SoapAddressRewriteHelper.getRewrittenPublishedEndpointUrl(epurl, sarm);
updatePublishedEndpointUrl(epurl, def, endpointInfo.getName());
}
}
return epurl;
}
-
- private static ServerConfig getServerConfig() {
- if(System.getSecurityManager() == null) {
- return AbstractServerConfig.getServerIntegrationServerConfig();
- }
- return AccessController.doPrivileged(AbstractServerConfig.GET_SERVER_INTEGRATION_SERVER_CONFIG);
- }
}
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/metadata/MetadataBuilder.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/metadata/MetadataBuilder.java 2014-09-22 14:25:36 UTC (rev 18939)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/metadata/MetadataBuilder.java 2014-09-22 14:25:57 UTC (rev 18940)
@@ -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.
*
@@ -26,7 +26,6 @@
import java.net.URL;
import java.security.AccessController;
-import java.util.Collections;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
@@ -49,6 +48,7 @@
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.deployment.HttpEndpoint;
import org.jboss.wsf.spi.management.ServerConfig;
+import org.jboss.wsf.spi.metadata.config.SOAPAddressRewriteMetadata;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainMetaData;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerChainsMetaData;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData;
@@ -77,6 +77,11 @@
public DDBeans build(Deployment dep)
{
+ //prepare the WSDL soap:address metadata and attach it to the deployment for later usage
+ final SOAPAddressRewriteMetadata sarm = new SOAPAddressRewriteMetadata(getServerConfig(),
+ dep.getAttachment(JBossWebservicesMetaData.class));
+ dep.addAttachment(SOAPAddressRewriteMetadata.class, sarm);
+
Map<QName, String> serviceNameAddressMap = new HashMap<QName, String>();
Map<String, SOAPAddressWSDLParser> soapAddressWsdlParsers = new HashMap<String, SOAPAddressWSDLParser>();
DDBeans dd = new DDBeans();
@@ -89,7 +94,7 @@
ddep.setInvoker(JBossWSInvoker.class.getName());
}
processWSDDContribution(ddep, (ArchiveDeployment)dep);
- processAddressRewrite(ddep, (ArchiveDeployment)dep, soapAddressWsdlParsers);
+ processAddressRewrite(ddep, (ArchiveDeployment)dep, sarm, soapAddressWsdlParsers);
METADATA_LOGGER.addingServiceEndpointMetadata(METADATA_LOGGER.isDebugEnabled() ? ddep.toStringExtended() : ddep.toString());
dd.addEndpoint(ddep);
@@ -282,14 +287,12 @@
return result;
}
- protected void processAddressRewrite(DDEndpoint ddep, ArchiveDeployment dep, Map<String, SOAPAddressWSDLParser> soapAddressWsdlParsers)
+ protected void processAddressRewrite(DDEndpoint ddep, ArchiveDeployment dep, SOAPAddressRewriteMetadata sarm, Map<String, SOAPAddressWSDLParser> soapAddressWsdlParsers)
{
String wsdlLocation = ddep.getWsdlLocation();
if (wsdlLocation == null) {
wsdlLocation = ddep.getAnnotationWsdlLocation();
}
- final ServerConfig sc = getServerConfig();
- final Map<String, String> props = getJBossWebServicesMetaDataProperties(dep);
if (wsdlLocation != null) {
URL wsdlUrl = dep.getResourceResolver().resolveFailSafe(wsdlLocation);
if (wsdlUrl != null) {
@@ -297,11 +300,11 @@
//do not try rewriting addresses for not-http binding
String wsdlAddress = parser.filterSoapAddress(ddep.getServiceName(), ddep.getPortName(), SOAPAddressWSDLParser.SOAP_HTTP_NS);
- String rewrittenWsdlAddress = SoapAddressRewriteHelper.getRewrittenPublishedEndpointUrl(wsdlAddress, ddep.getAddress(), sc, props);
+ String rewrittenWsdlAddress = SoapAddressRewriteHelper.getRewrittenPublishedEndpointUrl(wsdlAddress, ddep.getAddress(), sarm);
//If "auto rewrite", leave "publishedEndpointUrl" unset so that CXF does not force host/port values for
//wsdl imports and auto-rewrite them too; otherwise set the new address into "publishedEndpointUrl",
//which causes CXF to override any address in the published wsdl.
- if (!SoapAddressRewriteHelper.isAutoRewriteOn(sc)) {
+ if (!SoapAddressRewriteHelper.isAutoRewriteOn(sarm)) {
ddep.setPublishedEndpointUrl(rewrittenWsdlAddress);
}
} else {
@@ -309,24 +312,13 @@
}
} else {
//same comment as above regarding auto rewrite...
- if (!SoapAddressRewriteHelper.isAutoRewriteOn(sc)) {
+ if (!SoapAddressRewriteHelper.isAutoRewriteOn(sarm)) {
//force computed address for code first endpoints
- ddep.setPublishedEndpointUrl(SoapAddressRewriteHelper.getRewrittenPublishedEndpointUrl(ddep.getAddress(), sc, props));
+ ddep.setPublishedEndpointUrl(SoapAddressRewriteHelper.getRewrittenPublishedEndpointUrl(ddep.getAddress(), sarm));
}
}
}
- private static Map<String, String> getJBossWebServicesMetaDataProperties(Deployment dep) {
- JBossWebservicesMetaData wsmd = dep.getAttachment(JBossWebservicesMetaData.class);
- Map<String, String> props;
- if (wsmd != null) {
- props = wsmd.getProperties();
- } else {
- props = Collections.emptyMap();
- }
- return props;
- }
-
private SOAPAddressWSDLParser getCurrentSOAPAddressWSDLParser(URL wsdlUrl, Map<String, SOAPAddressWSDLParser> soapAddressWsdlParsers) {
final String key = wsdlUrl.toString();
SOAPAddressWSDLParser parser = soapAddressWsdlParsers.get(key);
Modified: stack/cxf/trunk/modules/server/src/test/java/org/jboss/wsf/stack/cxf/configuration/BusHolderTest.java
===================================================================
--- stack/cxf/trunk/modules/server/src/test/java/org/jboss/wsf/stack/cxf/configuration/BusHolderTest.java 2014-09-22 14:25:36 UTC (rev 18939)
+++ stack/cxf/trunk/modules/server/src/test/java/org/jboss/wsf/stack/cxf/configuration/BusHolderTest.java 2014-09-22 14:25:57 UTC (rev 18940)
@@ -32,7 +32,9 @@
import org.apache.cxf.ws.policy.selector.MaximalAlternativeSelector;
import org.jboss.ws.common.deployment.DefaultDeploymentModelFactory;
import org.jboss.ws.common.management.AbstractServerConfig;
+import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.management.ServerConfig;
+import org.jboss.wsf.spi.metadata.config.SOAPAddressRewriteMetadata;
import org.jboss.wsf.spi.metadata.webservices.JBossWebservicesMetaData;
import org.jboss.wsf.stack.cxf.client.Constants;
import org.jboss.wsf.stack.cxf.metadata.services.DDBeans;
@@ -70,37 +72,39 @@
props.put(Constants.CXF_POLICY_ALTERNATIVE_SELECTOR_PROP, alternative);
wsmd = new JBossWebservicesMetaData(null, null, null, null, props, null, null);
}
- BusHolder holder = new NonSpringBusHolder(new DDBeans()) {
- protected ServerConfig getServerConfig() {
- return new AbstractServerConfig()
- {
- @Override
- public File getServerTempDir()
- {
- // TODO Auto-generated method stub
- return null;
- }
- @Override
- public File getServerDataDir()
- {
- // TODO Auto-generated method stub
- return null;
- }
- @Override
- public File getHomeDir()
- {
- // TODO Auto-generated method stub
- return null;
- }
- };
- }
- };
+ BusHolder holder = new NonSpringBusHolder(new DDBeans());
try {
- holder.configure(null, null, wsmd, new DefaultDeploymentModelFactory().newDeployment("testDeployment", null, null));
+ Deployment dep = new DefaultDeploymentModelFactory().newDeployment("testDeployment", null, null);
+ dep.addAttachment(SOAPAddressRewriteMetadata.class, new SOAPAddressRewriteMetadata(getTestServerConfig(), null));
+ holder.configure(null, null, wsmd, dep);
return holder.getBus().getExtension(PolicyEngine.class).getAlternativeSelector().getClass().getName();
} finally {
holder.close();
}
}
+
+ private static ServerConfig getTestServerConfig() {
+ return new AbstractServerConfig()
+ {
+ @Override
+ public File getServerTempDir()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+ @Override
+ public File getServerDataDir()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+ @Override
+ public File getHomeDir()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+ };
+ }
}
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3098/BusHolderLifeCycleTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3098/BusHolderLifeCycleTestCase.java 2014-09-22 14:25:36 UTC (rev 18939)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3098/BusHolderLifeCycleTestCase.java 2014-09-22 14:25:57 UTC (rev 18940)
@@ -29,7 +29,9 @@
import org.apache.cxf.buslifecycle.BusLifeCycleManager;
import org.jboss.ws.common.deployment.DefaultDeploymentModelFactory;
import org.jboss.ws.common.management.AbstractServerConfig;
+import org.jboss.wsf.spi.deployment.Deployment;
import org.jboss.wsf.spi.management.ServerConfig;
+import org.jboss.wsf.spi.metadata.config.SOAPAddressRewriteMetadata;
import org.jboss.wsf.stack.cxf.client.util.SpringUtils;
import org.jboss.wsf.stack.cxf.configuration.BusHolder;
import org.jboss.wsf.stack.cxf.configuration.NonSpringBusHolder;
@@ -63,59 +65,11 @@
}
private static SpringBusHolder newSpringBusHolderInstance() {
- return new SpringBusHolder(null, null, new URL[]{}) {
- protected ServerConfig getServerConfig() {
- return new AbstractServerConfig()
- {
- @Override
- public File getServerTempDir()
- {
- // TODO Auto-generated method stub
- return null;
- }
- @Override
- public File getServerDataDir()
- {
- // TODO Auto-generated method stub
- return null;
- }
- @Override
- public File getHomeDir()
- {
- // TODO Auto-generated method stub
- return null;
- }
- };
- }
- };
+ return new SpringBusHolder(null, null, new URL[]{});
}
private static NonSpringBusHolder newNonSpringBusHolderInstance() {
- return new NonSpringBusHolder(new DDBeans()) {
- protected ServerConfig getServerConfig() {
- return new AbstractServerConfig()
- {
- @Override
- public File getServerTempDir()
- {
- // TODO Auto-generated method stub
- return null;
- }
- @Override
- public File getServerDataDir()
- {
- // TODO Auto-generated method stub
- return null;
- }
- @Override
- public File getHomeDir()
- {
- // TODO Auto-generated method stub
- return null;
- }
- };
- }
- };
+ return new NonSpringBusHolder(new DDBeans());
}
private static void simpleShutdownTest(BusHolder holder)
@@ -123,7 +77,9 @@
Bus bus = holder.getBus();
TestLifeCycleListener listener = new TestLifeCycleListener();
bus.getExtension(BusLifeCycleManager.class).registerLifeCycleListener(listener);
- holder.configure(null, null, null, new DefaultDeploymentModelFactory().newDeployment("testDeployment", null, null));
+ Deployment dep = new DefaultDeploymentModelFactory().newDeployment("testDeployment", null, null);
+ dep.addAttachment(SOAPAddressRewriteMetadata.class, new SOAPAddressRewriteMetadata(getTestServerConfig(), null));
+ holder.configure(null, null, null, dep);
holder.close();
assertEquals("preShutdown method on listener should be called exactly once; number of actual calls: "
+ listener.getCount(), 1, listener.getCount());
@@ -134,7 +90,9 @@
Bus bus = holder.getBus();
TestLifeCycleListener listener = new TestLifeCycleListener();
bus.getExtension(BusLifeCycleManager.class).registerLifeCycleListener(listener);
- holder.configure(null, null, null, new DefaultDeploymentModelFactory().newDeployment("testDeployment", null, null));
+ Deployment dep = new DefaultDeploymentModelFactory().newDeployment("testDeployment", null, null);
+ dep.addAttachment(SOAPAddressRewriteMetadata.class, new SOAPAddressRewriteMetadata(getTestServerConfig(), null));
+ holder.configure(null, null, null, dep);
bus.shutdown(true);
holder.close();
assertEquals("preShutdown method on listener should be called exactly once; number of actual calls: "
@@ -146,11 +104,37 @@
Bus bus = holder.getBus();
TestLifeCycleListener listener = new TestLifeCycleListener();
bus.getExtension(BusLifeCycleManager.class).registerLifeCycleListener(listener);
- holder.configure(null, null, null, new DefaultDeploymentModelFactory().newDeployment("testDeployment", null, null));
+ Deployment dep = new DefaultDeploymentModelFactory().newDeployment("testDeployment", null, null);
+ dep.addAttachment(SOAPAddressRewriteMetadata.class, new SOAPAddressRewriteMetadata(getTestServerConfig(), null));
+ holder.configure(null, null, null, dep);
assertEquals("preShutdown method on listener shouldn't be called before holder is closed: number of actual calls: "
+ listener.getCount(), 0, listener.getCount());
holder.close();
}
+
+ private static ServerConfig getTestServerConfig() {
+ return new AbstractServerConfig()
+ {
+ @Override
+ public File getServerTempDir()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+ @Override
+ public File getServerDataDir()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+ @Override
+ public File getHomeDir()
+ {
+ // TODO Auto-generated method stub
+ return null;
+ }
+ };
+ }
private static class TestLifeCycleListener implements BusLifeCycleListener
{
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3805/WEB-INF/jboss-webservices.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3805/WEB-INF/jboss-webservices.xml 2014-09-22 14:25:36 UTC (rev 18939)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/cxf/jbws3805/WEB-INF/jboss-webservices.xml 2014-09-22 14:25:57 UTC (rev 18940)
@@ -5,7 +5,7 @@
version="1.2"
xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee">
<property>
- <name>org.jboss.ws.cxf.wsdl.uriScheme</name>
+ <name>wsdl.soapAddress.rewrite.wsdl-uri-scheme</name>
<value>https</value>
</property>
10 years, 3 months
JBossWS SVN: r18939 - spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/config.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2014-09-22 10:25:36 -0400 (Mon, 22 Sep 2014)
New Revision: 18939
Added:
spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/config/SOAPAddressRewriteMetadata.java
Log:
[JBWS-3805] Add wsdl soap:address rewrite metadata
Added: spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/config/SOAPAddressRewriteMetadata.java
===================================================================
--- spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/config/SOAPAddressRewriteMetadata.java (rev 0)
+++ spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/config/SOAPAddressRewriteMetadata.java 2014-09-22 14:25:36 UTC (rev 18939)
@@ -0,0 +1,89 @@
+/*
+ * 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.wsf.spi.metadata.config;
+
+import java.util.Collections;
+import java.util.Map;
+
+import org.jboss.wsf.spi.management.ServerConfig;
+import org.jboss.wsf.spi.metadata.webservices.JBossWebservicesMetaData;
+
+
+/**
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 19-Sep-2014
+ */
+public class SOAPAddressRewriteMetadata
+{
+ public static final String WEBSERVICE_HOST = "wsdl.soapAddress.rewrite.wsdl-host";
+ public static final String WEBSERVICE_PORT = "wsdl.soapAddress.rewrite.wsdl-port";
+ public static final String WEBSERVICE_SECURE_PORT = "wsdl.soapAddress.rewrite.wsdl-secure-port";
+ public static final String WEBSERVICE_PATH_REWRITE_RULE = "wsdl.soapAddress.rewrite.wsdl-path-rewrite-rule";
+ public static final String WEBSERVICE_URI_SCHEME = "wsdl.soapAddress.rewrite.wsdl-uri-scheme";
+ public static final String MODIFY_SOAP_ADDRESS = "wsdl.soapAddress.rewrite.modify-wsdl-address";
+
+ private final ServerConfig serverConfig;
+ private final Map<String, String> props;
+
+ public SOAPAddressRewriteMetadata(ServerConfig serverConfig, JBossWebservicesMetaData jbwsmd) {
+ this.serverConfig = serverConfig;
+ Map<String, String> p = jbwsmd != null ? jbwsmd.getProperties() : null;
+ if (p != null) {
+ this.props = p;
+ } else {
+ this.props = Collections.emptyMap();
+ }
+ }
+
+
+ public String getWebServiceHost() {
+ String res = props.get(WEBSERVICE_HOST);
+ return res != null ? res : serverConfig.getWebServiceHost();
+ }
+
+ public int getWebServicePort() {
+ String res = props.get(WEBSERVICE_PORT);
+ return res != null ? Integer.parseInt(res) : serverConfig.getWebServicePort();
+ }
+
+ public int getWebServiceSecurePort() {
+ String res = props.get(WEBSERVICE_SECURE_PORT);
+ return res != null ? Integer.parseInt(res) : serverConfig.getWebServiceSecurePort();
+ }
+
+ public String getWebServicePathRewriteRule() {
+ String res = props.get(WEBSERVICE_PATH_REWRITE_RULE);
+ return res != null ? res : serverConfig.getWebServicePathRewriteRule();
+ }
+
+ public String getWebServiceUriScheme() {
+ String res = props.get(WEBSERVICE_URI_SCHEME);
+ return res != null ? res : serverConfig.getWebServiceUriScheme();
+ }
+
+ public boolean isModifySOAPAddress() {
+ String res = props.get(MODIFY_SOAP_ADDRESS);
+ return res != null ? Boolean.parseBoolean(res) : serverConfig.isModifySOAPAddress();
+ }
+
+}
Property changes on: spi/trunk/src/main/java/org/jboss/wsf/spi/metadata/config/SOAPAddressRewriteMetadata.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
10 years, 3 months
JBossWS SVN: r18938 - stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/asyncclient.
by jbossws-commits@lists.jboss.org
Author: jim.ma
Date: 2014-09-22 05:03:32 -0400 (Mon, 22 Sep 2014)
New Revision: 18938
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/asyncclient/AsyncEnabledInfoInterceptor.java
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/asyncclient/AsyncClientTestCase.java
Log:
[JBWS-3630]:Add test case to demonstrate enable asyncclient with UseAsyncPolicy
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/asyncclient/AsyncClientTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/asyncclient/AsyncClientTestCase.java 2014-09-17 15:26:53 UTC (rev 18937)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/asyncclient/AsyncClientTestCase.java 2014-09-22 09:03:32 UTC (rev 18938)
@@ -33,6 +33,8 @@
import junit.framework.Test;
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
import org.jboss.shrinkwrap.api.asset.StringAsset;
import org.jboss.wsf.test.JBossWSCXFTestSetup;
import org.jboss.wsf.test.JBossWSTest;
@@ -93,6 +95,27 @@
requestContext.put("use.async.http.conduit", Boolean.TRUE);
assertEquals("Echo:1000", proxy.echoAsync(1000).get());
}
+
+ public void testAysncClientWithPolicy () throws Exception
+ {
+ Bus bus = BusFactory.newInstance().createBus();
+ AsyncEnabledInfoInterceptor asyncInfo = new AsyncEnabledInfoInterceptor();
+ try
+ {
+ bus.setProperty("use.async.http.conduit", "ASYNC_ONLY");
+ bus.getOutInterceptors().add(asyncInfo);
+ BusFactory.setThreadDefaultBus(bus);
+ Endpoint proxy = initPort();
+ assertEquals("Echo:1000", proxy.echo(1000));
+ assertFalse("Async client is expected disabled", asyncInfo.isAsyncEnabled());
+ assertEquals("Echo:1000", proxy.echoAsync(1000).get());
+ assertTrue("Async client is expected enabled", asyncInfo.isAsyncEnabled());
+ }
+ finally
+ {
+ bus.shutdown(true);
+ }
+ }
private Endpoint initPort() throws Exception {
QName serviceName = new QName("http://org.jboss.ws/cxf/asyncclient", "EndpointImplService");
Added: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/asyncclient/AsyncEnabledInfoInterceptor.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/asyncclient/AsyncEnabledInfoInterceptor.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/asyncclient/AsyncEnabledInfoInterceptor.java 2014-09-22 09:03:32 UTC (rev 18938)
@@ -0,0 +1,64 @@
+/*
+ * 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.asyncclient;
+
+import java.util.logging.Logger;
+
+import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.interceptor.AbstractLoggingInterceptor;
+import org.apache.cxf.interceptor.Fault;
+import org.apache.cxf.interceptor.MessageSenderInterceptor;
+import org.apache.cxf.message.Message;
+import org.apache.cxf.phase.Phase;
+
+public class AsyncEnabledInfoInterceptor extends AbstractLoggingInterceptor
+{
+ private static final Logger LOG = LogUtils.getLogger(AsyncEnabledInfoInterceptor.class);
+ private static boolean asyncEnabled = false;
+
+ public AsyncEnabledInfoInterceptor () {
+ super(Phase.PREPARE_SEND_ENDING);
+ this.addAfter(MessageSenderInterceptor.class.getName());
+ this.addBefore(MessageSenderInterceptor.MessageSenderEndingInterceptor.class.getName());
+ }
+
+ public AsyncEnabledInfoInterceptor(String phase)
+ {
+ super(phase);
+ }
+ public void handleMessage(Message message) throws Fault
+ {
+ if (message.get("use.async.http.conduit") == null) {
+ asyncEnabled = false;
+ } else {
+ asyncEnabled = (Boolean)message.get("use.async.http.conduit");
+ }
+ }
+ protected Logger getLogger()
+ {
+ return LOG;
+ }
+
+ public boolean isAsyncEnabled() {
+ return asyncEnabled;
+ }
+}
Property changes on: stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/asyncclient/AsyncEnabledInfoInterceptor.java
___________________________________________________________________
Added: svn:keywords
+ Rev Date
Added: svn:eol-style
+ native
10 years, 3 months
JBossWS SVN: r18937 - hudson/trunk.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2014-09-17 11:26:53 -0400 (Wed, 17 Sep 2014)
New Revision: 18937
Modified:
hudson/trunk/ant.properties.example
Log:
Updating wfly version
Modified: hudson/trunk/ant.properties.example
===================================================================
--- hudson/trunk/ant.properties.example 2014-09-16 09:16:55 UTC (rev 18936)
+++ hudson/trunk/ant.properties.example 2014-09-17 15:26:53 UTC (rev 18937)
@@ -28,7 +28,7 @@
hudson.jboss810.rev=8.1.0.Final
hudson.jboss900.url=https://github.com/wildfly/wildfly
-hudson.jboss900.build=wildfly-9.0.0.Alpha1-SNAPSHOT
+hudson.jboss900.build=wildfly-9.0.0.Alpha2-SNAPSHOT
hudson.jboss900.rev=master
hudson.mail.recipients=
10 years, 3 months
JBossWS SVN: r18936 - common-tools/trunk/src/main/java/org/jboss/ws/tools/ant.
by jbossws-commits@lists.jboss.org
Author: asoldano
Date: 2014-09-16 05:16:55 -0400 (Tue, 16 Sep 2014)
New Revision: 18936
Modified:
common-tools/trunk/src/main/java/org/jboss/ws/tools/ant/WSProvideTask.java
Log:
[JBWS-3830] portSoapAddress -> address
Modified: common-tools/trunk/src/main/java/org/jboss/ws/tools/ant/WSProvideTask.java
===================================================================
--- common-tools/trunk/src/main/java/org/jboss/ws/tools/ant/WSProvideTask.java 2014-09-12 13:25:39 UTC (rev 18935)
+++ common-tools/trunk/src/main/java/org/jboss/ws/tools/ant/WSProvideTask.java 2014-09-16 09:16:55 UTC (rev 18936)
@@ -104,7 +104,7 @@
private boolean verbose;
private boolean fork;
private boolean debug;
- private String portSoapAddress;
+ private String address;
// Not actually used right now
public void setDebug(boolean debug)
@@ -185,9 +185,9 @@
this.genwsdl = genwsdl;
}
- public void setPortSoapAddress(String portSoapAddress)
+ public void setAddress(String address)
{
- this.portSoapAddress = portSoapAddress;
+ this.address = address;
}
private ClassLoader getClasspathLoader(ClassLoader parent)
@@ -238,7 +238,7 @@
gen.setGenerateSource(keep);
gen.setGenerateWsdl(genwsdl);
gen.setExtension(extension);
- gen.setPortSoapAddress(portSoapAddress);
+ gen.setPortSoapAddress(address);
if (destdir != null)
gen.setOutputDirectory(destdir);
@@ -301,9 +301,9 @@
if (genwsdl)
command.createArgument().setValue("-w");
- if (portSoapAddress != null) {
+ if (address != null) {
command.createArgument().setValue("-a");
- command.createArgument().setValue(portSoapAddress);
+ command.createArgument().setValue(address);
}
if (extension)
10 years, 3 months