JBossWS SVN: r17060 - stack/cxf/trunk.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2012-12-10 04:03:28 -0500 (Mon, 10 Dec 2012)
New Revision: 17060
Modified:
stack/cxf/trunk/pom.xml
Log:
[JBWS-3572] upgrade Apache CXF from 2.6.3 -> 2.6.4
Modified: stack/cxf/trunk/pom.xml
===================================================================
--- stack/cxf/trunk/pom.xml 2012-12-09 18:13:02 UTC (rev 17059)
+++ stack/cxf/trunk/pom.xml 2012-12-10 09:03:28 UTC (rev 17060)
@@ -73,7 +73,7 @@
<jboss713.version>7.1.3.Final</jboss713.version>
<jboss720.version>7.2.0.Alpha1-SNAPSHOT</jboss720.version>
<ejb.api.version>1.0.1.Final</ejb.api.version>
- <cxf.version>2.7.2-SNAPSHOT</cxf.version>
+ <cxf.version>2.6.4</cxf.version>
<cxf.asm.version>3.3.1</cxf.asm.version>
<cxf.xjcplugins.version>2.6.0</cxf.xjcplugins.version>
<jboss.common.core.version>2.2.17.GA</jboss.common.core.version>
@@ -105,7 +105,7 @@
<xerces.version>2.9.1</xerces.version>
<xmlsec.version>1.5.2</xmlsec.version>
<wss4j.version>1.6.8</wss4j.version>
- <wstx.version>4.1.1</wstx.version>
+ <wstx.version>4.1.4</wstx.version>
<spring.version>3.0.7.RELEASE</spring.version>
</properties>
12 years, 3 months
JBossWS SVN: r17059 - stack/cxf/trunk.
by jbossws-commits@lists.jboss.org
Author: richard.opalka(a)jboss.com
Date: 2012-12-09 13:13:02 -0500 (Sun, 09 Dec 2012)
New Revision: 17059
Modified:
stack/cxf/trunk/pom.xml
Log:
upgrade to latest CXF snapshot
Modified: stack/cxf/trunk/pom.xml
===================================================================
--- stack/cxf/trunk/pom.xml 2012-12-07 15:24:08 UTC (rev 17058)
+++ stack/cxf/trunk/pom.xml 2012-12-09 18:13:02 UTC (rev 17059)
@@ -73,7 +73,7 @@
<jboss713.version>7.1.3.Final</jboss713.version>
<jboss720.version>7.2.0.Alpha1-SNAPSHOT</jboss720.version>
<ejb.api.version>1.0.1.Final</ejb.api.version>
- <cxf.version>2.7.1-SNAPSHOT</cxf.version>
+ <cxf.version>2.7.2-SNAPSHOT</cxf.version>
<cxf.asm.version>3.3.1</cxf.asm.version>
<cxf.xjcplugins.version>2.6.0</cxf.xjcplugins.version>
<jboss.common.core.version>2.2.17.GA</jboss.common.core.version>
@@ -104,7 +104,7 @@
<velocity.version>1.7</velocity.version>
<xerces.version>2.9.1</xerces.version>
<xmlsec.version>1.5.2</xmlsec.version>
- <wss4j.version>1.6.8-SNAPSHOT</wss4j.version>
+ <wss4j.version>1.6.8</wss4j.version>
<wstx.version>4.1.1</wstx.version>
<spring.version>3.0.7.RELEASE</spring.version>
</properties>
12 years, 3 months
JBossWS SVN: r17058 - in thirdparty/cxf/branches/cxf-2.2.12/rt/ws/addr/src: test/java/org/apache/cxf/ws/addressing/soap and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: mmusaji
Date: 2012-12-07 10:24:08 -0500 (Fri, 07 Dec 2012)
New Revision: 17058
Modified:
thirdparty/cxf/branches/cxf-2.2.12/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/soap/MAPCodec.java
thirdparty/cxf/branches/cxf-2.2.12/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/soap/MAPCodecTest.java
Log:
[JBPAPP-10448] - Responder supports the inbound soap message with wsa MessageID and RelatesTo headers
Modified: thirdparty/cxf/branches/cxf-2.2.12/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/soap/MAPCodec.java
===================================================================
--- thirdparty/cxf/branches/cxf-2.2.12/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/soap/MAPCodec.java 2012-12-06 17:48:23 UTC (rev 17057)
+++ thirdparty/cxf/branches/cxf-2.2.12/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/soap/MAPCodec.java 2012-12-07 15:24:08 UTC (rev 17058)
@@ -802,7 +802,7 @@
synchronized (correlatedExchange) {
message.setExchange(correlatedExchange);
}
- } else {
+ } else if (ContextUtils.isRequestor(message) && !message.getExchange().isOneWay()) {
if (ContextUtils.retrieveDeferUncorrelatedMessageAbort(message)) {
LOG.fine("deferring uncorrelated message abort");
ContextUtils.storeDeferredUncorrelatedMessageAbort(message);
Modified: thirdparty/cxf/branches/cxf-2.2.12/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/soap/MAPCodecTest.java
===================================================================
--- thirdparty/cxf/branches/cxf-2.2.12/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/soap/MAPCodecTest.java 2012-12-06 17:48:23 UTC (rev 17057)
+++ thirdparty/cxf/branches/cxf-2.2.12/rt/ws/addr/src/test/java/org/apache/cxf/ws/addressing/soap/MAPCodecTest.java 2012-12-07 15:24:08 UTC (rev 17058)
@@ -190,6 +190,19 @@
}
@Test
+ public void testResponderInboundWithRelatesTo() throws Exception {
+ SoapMessage message = setUpMessage(false, false, false, false, Boolean.TRUE,
+ Names.WSA_NAMESPACE_NAME);
+ //empty the uncorrelatedExchanges in responder
+ for (String key : codec.uncorrelatedExchanges.keySet()) {
+ codec.uncorrelatedExchanges.remove(key);
+ }
+ codec.handleMessage(message);
+ control.verify();
+ verifyMessage(message, false, false, false);
+ }
+
+ @Test
public void testResponderInboundNonNative() throws Exception {
String uri = VersionTransformer.Names200408.WSA_NAMESPACE_NAME;
SoapMessage message = setUpMessage(false, false, false, false, uri);
@@ -281,9 +294,16 @@
private SoapMessage setUpMessage(boolean requestor, boolean outbound, boolean invalidMAP,
boolean preExistingSOAPAction, String exposeAs) throws Exception {
+ return setUpMessage(requestor, outbound, invalidMAP, preExistingSOAPAction, null, exposeAs);
+ }
+
+ private SoapMessage setUpMessage(boolean requestor, boolean outbound, boolean invalidMAP,
+ boolean preExistingSOAPAction, Boolean generateRelatesTo,
+ String exposeAs) throws Exception {
SoapMessage message = new SoapMessage(new MessageImpl());
setUpOutbound(message, outbound);
- expectRelatesTo = (requestor && !outbound) || (!requestor && outbound);
+ expectRelatesTo = generateRelatesTo != null ? generateRelatesTo
+ : (requestor && !outbound) || (!requestor && outbound);
message.put(REQUESTOR_ROLE, Boolean.valueOf(requestor));
String mapProperty = getMAPProperty(requestor, outbound);
AddressingPropertiesImpl maps = getMAPs(requestor, outbound, exposeAs);
12 years, 3 months
JBossWS SVN: r17057 - in stack/cxf/trunk/modules: server/src/main/java/org/jboss/wsf/stack/cxf/metadata and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2012-12-06 12:48:23 -0500 (Thu, 06 Dec 2012)
New Revision: 17057
Modified:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/Loggers.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/metadata/MetadataBuilder.java
Log:
[JBWS-3570] Fixing regression
Modified: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/Loggers.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/Loggers.java 2012-12-06 09:38:51 UTC (rev 17056)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/Loggers.java 2012-12-06 17:48:23 UTC (rev 17057)
@@ -196,4 +196,8 @@
@LogMessage(level = TRACE)
@Message(id = 24089, value = "Unable to load additional configuration from %s")
void unableToLoadAdditionalConfigurationFrom(URL url, @Cause Throwable cause);
+
+ @LogMessage(level = DEBUG)
+ @Message(id = 24091, value = "Could not get WSDL from %s, aborting soap:address rewrite.")
+ void abortSoapAddressRewrite(String wsdlLocation, @Cause Throwable cause);
}
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 2012-12-06 09:38:51 UTC (rev 17056)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/metadata/MetadataBuilder.java 2012-12-06 17:48:23 UTC (rev 17057)
@@ -312,7 +312,7 @@
ddep.setPublishedEndpointUrl(rewrittenWsdlAddress);
}
} catch (IOException e) {
- throw new RuntimeException(e);
+ METADATA_LOGGER.abortSoapAddressRewrite(wsdlLocation, e);
}
}
}
12 years, 3 months
JBossWS SVN: r17056 - in stack/cxf/branches/jbossws-cxf-bp-test/modules/testsuite/bp12-tests: src/test/java/org/jboss/test/ws/jaxws/bp12/wsa and 5 other directories.
by jbossws-commits@lists.jboss.org
Author: jim.ma
Date: 2012-12-06 04:38:51 -0500 (Thu, 06 Dec 2012)
New Revision: 17056
Added:
stack/cxf/branches/jbossws-cxf-bp-test/modules/testsuite/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/wsa/test1198/
stack/cxf/branches/jbossws-cxf-bp-test/modules/testsuite/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/wsa/test1198/ObjectFactory.java
stack/cxf/branches/jbossws-cxf-bp-test/modules/testsuite/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/wsa/test1198/SignatureHeaderFaultContractRpc.java
stack/cxf/branches/jbossws-cxf-bp-test/modules/testsuite/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/wsa/test1198/SignatureRpcLiteral.java
stack/cxf/branches/jbossws-cxf-bp-test/modules/testsuite/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/wsa/test1198/SignatureRpcLiteralImpl.java
stack/cxf/branches/jbossws-cxf-bp-test/modules/testsuite/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/wsa/test1198/SignatureRpcLiteralSign2SignatureHeaderRpcFaultFaultMessage.java
stack/cxf/branches/jbossws-cxf-bp-test/modules/testsuite/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/wsa/test1198/Test1198TestCase.java
stack/cxf/branches/jbossws-cxf-bp-test/modules/testsuite/bp12-tests/src/test/resources/jaxws/bp12/wsa/test1198/
stack/cxf/branches/jbossws-cxf-bp-test/modules/testsuite/bp12-tests/src/test/resources/jaxws/bp12/wsa/test1198/WEB-INF/
stack/cxf/branches/jbossws-cxf-bp-test/modules/testsuite/bp12-tests/src/test/resources/jaxws/bp12/wsa/test1198/WEB-INF/web.xml
stack/cxf/branches/jbossws-cxf-bp-test/modules/testsuite/bp12-tests/src/test/resources/jaxws/bp12/wsa/test1198/WEB-INF/wsdl/
stack/cxf/branches/jbossws-cxf-bp-test/modules/testsuite/bp12-tests/src/test/resources/jaxws/bp12/wsa/test1198/WEB-INF/wsdl/SignatureRpcLit.wsdl
stack/cxf/branches/jbossws-cxf-bp-test/modules/testsuite/bp12-tests/src/test/resources/jaxws/bp12/wsa/test1198/WEB-INF/wsdl/SignatureRpcLit0.wsdl
stack/cxf/branches/jbossws-cxf-bp-test/modules/testsuite/bp12-tests/src/test/resources/jaxws/bp12/wsa/test1198/WEB-INF/wsdl/SignatureRpcLit1.wsdl
stack/cxf/branches/jbossws-cxf-bp-test/modules/testsuite/bp12-tests/src/test/resources/jaxws/bp12/wsa/test1198/WEB-INF/wsdl/SignatureRpcLit1.xsd
Modified:
stack/cxf/branches/jbossws-cxf-bp-test/modules/testsuite/bp12-tests/scripts/cxf-jars-jaxws.xml
Log:
Add WS-I BP Test1198
Modified: stack/cxf/branches/jbossws-cxf-bp-test/modules/testsuite/bp12-tests/scripts/cxf-jars-jaxws.xml
===================================================================
--- stack/cxf/branches/jbossws-cxf-bp-test/modules/testsuite/bp12-tests/scripts/cxf-jars-jaxws.xml 2012-12-05 18:24:38 UTC (rev 17055)
+++ stack/cxf/branches/jbossws-cxf-bp-test/modules/testsuite/bp12-tests/scripts/cxf-jars-jaxws.xml 2012-12-06 09:38:51 UTC (rev 17056)
@@ -148,7 +148,17 @@
<include name="wsdl/*" />
</webinf>
</war>
-
-
+
+ <!-- jaxws-bp12test1198 -->
+ <war warfile="${tests.output.dir}/test-libs/jaxws-bp12test1198.war" webxml="${tests.output.dir}/test-resources/jaxws/bp12/wsa/test1198/WEB-INF/web.xml">
+ <classes dir="${tests.output.dir}/test-classes">
+ <include name="org/jboss/test/ws/jaxws/bp12/wsa/test1198/*.class"/>
+ <exclude name="org/jboss/test/ws/jaxws/bp12/wsa/test1198/*TestCase.class"/>
+ </classes>
+ <webinf dir="${tests.output.dir}/test-resources/jaxws/bp12/wsa/test1198/WEB-INF">
+ <include name="wsdl/*" />
+ </webinf>
+ </war>
+
</target>
</project>
Added: stack/cxf/branches/jbossws-cxf-bp-test/modules/testsuite/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/wsa/test1198/ObjectFactory.java
===================================================================
--- stack/cxf/branches/jbossws-cxf-bp-test/modules/testsuite/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/wsa/test1198/ObjectFactory.java (rev 0)
+++ stack/cxf/branches/jbossws-cxf-bp-test/modules/testsuite/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/wsa/test1198/ObjectFactory.java 2012-12-06 09:38:51 UTC (rev 17056)
@@ -0,0 +1,87 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.bp12.wsa.test1198;
+
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.annotation.XmlElementDecl;
+import javax.xml.bind.annotation.XmlRegistry;
+import javax.xml.namespace.QName;
+
+/**
+ * This object contains factory methods for each
+ * Java content interface and Java element interface
+ * generated in the org.jboss.test.ws.jaxws.bp12.wsa.test1198 package.
+ * <p>An ObjectFactory allows you to programatically
+ * construct new instances of the Java representation
+ * for XML content. The Java representation of XML
+ * content can consist of schema derived interfaces
+ * and classes representing the binding of schema
+ * type definitions, element declarations and model
+ * groups. Factory methods for each of these are
+ * provided in this class.
+ *
+ */
+@XmlRegistry
+public class ObjectFactory
+{
+
+ private final static QName _SignatureHeaderFaultContractRpc_QNAME = new QName("http://example.org/signature", "SignatureHeaderFaultContractRpc");
+ private final static QName _SignatureHeaderFaultContractRpcFaultAdditionalTextRpc_QNAME = new QName("http://example.org/signature", "FaultAdditionalTextRpc");
+
+ /**
+ * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.jboss.test.ws.jaxws.bp12.wsa.test1198
+ *
+ */
+ public ObjectFactory()
+ {
+ }
+
+ /**
+ * Create an instance of {@link SignatureHeaderFaultContractRpc }
+ *
+ */
+ public SignatureHeaderFaultContractRpc createSignatureHeaderFaultContractRpc()
+ {
+ return new SignatureHeaderFaultContractRpc();
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link SignatureHeaderFaultContractRpc }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "http://example.org/signature", name = "SignatureHeaderFaultContractRpc")
+ public JAXBElement<SignatureHeaderFaultContractRpc> createSignatureHeaderFaultContractRpc(SignatureHeaderFaultContractRpc value)
+ {
+ return new JAXBElement<SignatureHeaderFaultContractRpc>(_SignatureHeaderFaultContractRpc_QNAME, SignatureHeaderFaultContractRpc.class, null, value);
+ }
+
+ /**
+ * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
+ *
+ */
+ @XmlElementDecl(namespace = "http://example.org/signature", name = "FaultAdditionalTextRpc", scope = SignatureHeaderFaultContractRpc.class)
+ public JAXBElement<String> createSignatureHeaderFaultContractRpcFaultAdditionalTextRpc(String value)
+ {
+ return new JAXBElement<String>(_SignatureHeaderFaultContractRpcFaultAdditionalTextRpc_QNAME, String.class, SignatureHeaderFaultContractRpc.class, value);
+ }
+
+}
Added: stack/cxf/branches/jbossws-cxf-bp-test/modules/testsuite/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/wsa/test1198/SignatureHeaderFaultContractRpc.java
===================================================================
--- stack/cxf/branches/jbossws-cxf-bp-test/modules/testsuite/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/wsa/test1198/SignatureHeaderFaultContractRpc.java (rev 0)
+++ stack/cxf/branches/jbossws-cxf-bp-test/modules/testsuite/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/wsa/test1198/SignatureHeaderFaultContractRpc.java 2012-12-06 09:38:51 UTC (rev 17056)
@@ -0,0 +1,83 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.bp12.wsa.test1198;
+
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElementRef;
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ * <p>Java class for SignatureHeaderFaultContractRpc complex type.
+ *
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="SignatureHeaderFaultContractRpc">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="FaultAdditionalTextRpc" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ * </sequence>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+(a)XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "SignatureHeaderFaultContractRpc", propOrder = { "faultAdditionalTextRpc" })
+public class SignatureHeaderFaultContractRpc
+{
+
+ @XmlElementRef(name = "FaultAdditionalTextRpc", namespace = "http://example.org/signature", type = JAXBElement.class)
+ protected JAXBElement<String> faultAdditionalTextRpc;
+
+ /**
+ * Gets the value of the faultAdditionalTextRpc property.
+ *
+ * @return
+ * possible object is
+ * {@link JAXBElement }{@code <}{@link String }{@code >}
+ *
+ */
+ public JAXBElement<String> getFaultAdditionalTextRpc()
+ {
+ return faultAdditionalTextRpc;
+ }
+
+ /**
+ * Sets the value of the faultAdditionalTextRpc property.
+ *
+ * @param value
+ * allowed object is
+ * {@link JAXBElement }{@code <}{@link String }{@code >}
+ *
+ */
+ public void setFaultAdditionalTextRpc(JAXBElement<String> value)
+ {
+ this.faultAdditionalTextRpc = value;
+ }
+
+}
Added: stack/cxf/branches/jbossws-cxf-bp-test/modules/testsuite/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/wsa/test1198/SignatureRpcLiteral.java
===================================================================
--- stack/cxf/branches/jbossws-cxf-bp-test/modules/testsuite/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/wsa/test1198/SignatureRpcLiteral.java (rev 0)
+++ stack/cxf/branches/jbossws-cxf-bp-test/modules/testsuite/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/wsa/test1198/SignatureRpcLiteral.java 2012-12-06 09:38:51 UTC (rev 17056)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.bp12.wsa.test1198;
+
+import javax.jws.WebMethod;
+import javax.jws.WebParam;
+import javax.jws.WebResult;
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+import javax.xml.bind.annotation.XmlSeeAlso;
+import javax.xml.ws.Action;
+import javax.xml.ws.FaultAction;
+
+@WebService(targetNamespace = "http://example.org/signature", name = "SignatureRpcLiteral")
+@XmlSeeAlso({ ObjectFactory.class })
+@SOAPBinding(style = SOAPBinding.Style.RPC)
+public interface SignatureRpcLiteral
+{
+
+ @WebResult(name = "Sign1Result", targetNamespace = "http://example.org/signature", partName = "Sign1Result")
+ @Action(input = "http://example.org/action/SignatureRpcInEmpty", output = "http://example.org/action/SignatureRpcOutEmpty")
+ @WebMethod(operationName = "Sign1", action = "http://example.org/action/SignatureRpcInEmpty")
+ public String sign1();
+
+ @WebResult(name = "Sign2Result", targetNamespace = "http://example.org/signature", partName = "Sign2Result")
+ @Action(input = "http://example.org/action/SignatureHeaderRpcIn", output = "http://example.org/action/SignatureHeaderRpcReply", fault = { @FaultAction(className = SignatureRpcLiteralSign2SignatureHeaderRpcFaultFaultMessage.class, value = "http://example.org/action/SignatureHeaderFaultRpc") })
+ @WebMethod(operationName = "Sign2", action = "http://example.org/action/SignatureHeaderRpcIn")
+ public String sign2(@WebParam(partName = "parameter1", name = "parameter1")
+ String parameter1,
+ @WebParam(partName = "parameter2", name = "parameter2")
+ String parameter2) throws SignatureRpcLiteralSign2SignatureHeaderRpcFaultFaultMessage;
+}
Added: stack/cxf/branches/jbossws-cxf-bp-test/modules/testsuite/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/wsa/test1198/SignatureRpcLiteralImpl.java
===================================================================
--- stack/cxf/branches/jbossws-cxf-bp-test/modules/testsuite/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/wsa/test1198/SignatureRpcLiteralImpl.java (rev 0)
+++ stack/cxf/branches/jbossws-cxf-bp-test/modules/testsuite/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/wsa/test1198/SignatureRpcLiteralImpl.java 2012-12-06 09:38:51 UTC (rev 17056)
@@ -0,0 +1,49 @@
+/*
+* JBoss, Home of Professional Open Source.
+* Copyright 2012, Red Hat Middleware LLC, and individual contributors
+* as indicated by the @author tags. See the copyright.txt file in the
+* distribution for a full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+
+package org.jboss.test.ws.jaxws.bp12.wsa.test1198;
+
+import javax.jws.WebService;
+
+@WebService(serviceName = "WSAddressingCR",
+ portName = "CustomBinding_SignatureRpcLiteral",
+ targetNamespace = "http://tempuri.org/",
+ wsdlLocation = "WEB-INF/wsdl/SignatureRpcLit.wsdl",
+ endpointInterface = "org.jboss.test.ws.jaxws.bp12.wsa.test1198.SignatureRpcLiteral")
+public class SignatureRpcLiteralImpl implements SignatureRpcLiteral
+{
+
+ public String sign1()
+ {
+ return "Sign1";
+ }
+
+ public String sign2(String parameter1, String parameter2) throws SignatureRpcLiteralSign2SignatureHeaderRpcFaultFaultMessage
+ {
+ if (parameter1.equals("Fault"))
+ {
+ new SignatureRpcLiteralSign2SignatureHeaderRpcFaultFaultMessage("Fault : " + parameter1 + "," + parameter2);
+ }
+ return "Sign2, Parameter=" + parameter1 + ",Parameter=" + parameter2;
+ }
+
+}
Added: stack/cxf/branches/jbossws-cxf-bp-test/modules/testsuite/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/wsa/test1198/SignatureRpcLiteralSign2SignatureHeaderRpcFaultFaultMessage.java
===================================================================
--- stack/cxf/branches/jbossws-cxf-bp-test/modules/testsuite/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/wsa/test1198/SignatureRpcLiteralSign2SignatureHeaderRpcFaultFaultMessage.java (rev 0)
+++ stack/cxf/branches/jbossws-cxf-bp-test/modules/testsuite/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/wsa/test1198/SignatureRpcLiteralSign2SignatureHeaderRpcFaultFaultMessage.java 2012-12-06 09:38:51 UTC (rev 17056)
@@ -0,0 +1,64 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.bp12.wsa.test1198;
+
+import javax.xml.ws.WebFault;
+
+@WebFault(name = "SignatureHeaderFaultContractRpc", targetNamespace = "http://example.org/signature")
+public class SignatureRpcLiteralSign2SignatureHeaderRpcFaultFaultMessage extends Exception
+{
+ private org.jboss.test.ws.jaxws.bp12.wsa.test1198.SignatureHeaderFaultContractRpc signatureHeaderFaultContractRpc;
+
+ public SignatureRpcLiteralSign2SignatureHeaderRpcFaultFaultMessage()
+ {
+ super();
+ }
+
+ public SignatureRpcLiteralSign2SignatureHeaderRpcFaultFaultMessage(String message)
+ {
+ super(message);
+ }
+
+ public SignatureRpcLiteralSign2SignatureHeaderRpcFaultFaultMessage(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
+
+ public SignatureRpcLiteralSign2SignatureHeaderRpcFaultFaultMessage(String message,
+ org.jboss.test.ws.jaxws.bp12.wsa.test1198.SignatureHeaderFaultContractRpc signatureHeaderFaultContractRpc)
+ {
+ super(message);
+ this.signatureHeaderFaultContractRpc = signatureHeaderFaultContractRpc;
+ }
+
+ public SignatureRpcLiteralSign2SignatureHeaderRpcFaultFaultMessage(String message,
+ org.jboss.test.ws.jaxws.bp12.wsa.test1198.SignatureHeaderFaultContractRpc signatureHeaderFaultContractRpc, Throwable cause)
+ {
+ super(message, cause);
+ this.signatureHeaderFaultContractRpc = signatureHeaderFaultContractRpc;
+ }
+
+ public org.jboss.test.ws.jaxws.bp12.wsa.test1198.SignatureHeaderFaultContractRpc getFaultInfo()
+ {
+ return this.signatureHeaderFaultContractRpc;
+ }
+}
Added: stack/cxf/branches/jbossws-cxf-bp-test/modules/testsuite/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/wsa/test1198/Test1198TestCase.java
===================================================================
--- stack/cxf/branches/jbossws-cxf-bp-test/modules/testsuite/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/wsa/test1198/Test1198TestCase.java (rev 0)
+++ stack/cxf/branches/jbossws-cxf-bp-test/modules/testsuite/bp12-tests/src/test/java/org/jboss/test/ws/jaxws/bp12/wsa/test1198/Test1198TestCase.java 2012-12-06 09:38:51 UTC (rev 17056)
@@ -0,0 +1,82 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.bp12.wsa.test1198;
+
+import java.net.URL;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Service;
+
+import junit.framework.Test;
+
+import org.jboss.wsf.test.JBossWSCXFTestSetup;
+import org.jboss.wsf.test.JBossWSTest;
+
+public class Test1198TestCase extends JBossWSTest
+{
+ private final String serviceURL = "http://" + getServerHost() + ":8080/jaxws-bp12test1198/Test1198";
+
+ public static Test suite()
+ {
+ return new JBossWSCXFTestSetup(Test1198TestCase.class, "jaxws-bp12test1198.war");
+ }
+
+ public void testSignature() throws Exception
+ {
+ // construct proxy
+ QName serviceName = new QName("http://tempuri.org/", "WSAddressingCR");
+ URL wsdlURL = new URL(serviceURL + "?wsdl");
+ Service service = Service.create(wsdlURL, serviceName);
+ SignatureRpcLiteral port = (SignatureRpcLiteral) service.getPort(SignatureRpcLiteral.class);
+ // invoke method
+ ((BindingProvider) port).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
+ "http://" + getServerHost() + ":9090/jaxws-bp12test1198/Test1198");
+
+
+ //request 1
+ System.out.println("Invoking sign1...");
+ String response = port.sign1();
+ System.out.println(response);
+
+
+ //request 2
+ System.out.println("Invoking sign2...");
+ response = port.sign2("Hello", "World");
+ System.out.println(response);
+
+
+ //request 3
+ System.out.println("Invoking sign2 and exception is expected...");
+ try
+ {
+ response = port.sign2("Fault","World");
+ }
+ catch (Exception e)
+ {
+ System.out.println("sign2 exception message : " + e.getMessage());
+ }
+
+ }
+
+
+}
\ No newline at end of file
Added: stack/cxf/branches/jbossws-cxf-bp-test/modules/testsuite/bp12-tests/src/test/resources/jaxws/bp12/wsa/test1198/WEB-INF/web.xml
===================================================================
(Binary files differ)
Property changes on: stack/cxf/branches/jbossws-cxf-bp-test/modules/testsuite/bp12-tests/src/test/resources/jaxws/bp12/wsa/test1198/WEB-INF/web.xml
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: stack/cxf/branches/jbossws-cxf-bp-test/modules/testsuite/bp12-tests/src/test/resources/jaxws/bp12/wsa/test1198/WEB-INF/wsdl/SignatureRpcLit.wsdl
===================================================================
(Binary files differ)
Property changes on: stack/cxf/branches/jbossws-cxf-bp-test/modules/testsuite/bp12-tests/src/test/resources/jaxws/bp12/wsa/test1198/WEB-INF/wsdl/SignatureRpcLit.wsdl
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: stack/cxf/branches/jbossws-cxf-bp-test/modules/testsuite/bp12-tests/src/test/resources/jaxws/bp12/wsa/test1198/WEB-INF/wsdl/SignatureRpcLit0.wsdl
===================================================================
(Binary files differ)
Property changes on: stack/cxf/branches/jbossws-cxf-bp-test/modules/testsuite/bp12-tests/src/test/resources/jaxws/bp12/wsa/test1198/WEB-INF/wsdl/SignatureRpcLit0.wsdl
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: stack/cxf/branches/jbossws-cxf-bp-test/modules/testsuite/bp12-tests/src/test/resources/jaxws/bp12/wsa/test1198/WEB-INF/wsdl/SignatureRpcLit1.wsdl
===================================================================
(Binary files differ)
Property changes on: stack/cxf/branches/jbossws-cxf-bp-test/modules/testsuite/bp12-tests/src/test/resources/jaxws/bp12/wsa/test1198/WEB-INF/wsdl/SignatureRpcLit1.wsdl
___________________________________________________________________
Added: svn:mime-type
+ application/xml
Added: stack/cxf/branches/jbossws-cxf-bp-test/modules/testsuite/bp12-tests/src/test/resources/jaxws/bp12/wsa/test1198/WEB-INF/wsdl/SignatureRpcLit1.xsd
===================================================================
(Binary files differ)
Property changes on: stack/cxf/branches/jbossws-cxf-bp-test/modules/testsuite/bp12-tests/src/test/resources/jaxws/bp12/wsa/test1198/WEB-INF/wsdl/SignatureRpcLit1.xsd
___________________________________________________________________
Added: svn:mime-type
+ application/xml
12 years, 3 months
JBossWS SVN: r17055 - stack/cxf/branches/jbossws-cxf-4.0.x/modules/server/src/main/java/org/jboss/wsf/stack/cxf.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2012-12-05 13:24:38 -0500 (Wed, 05 Dec 2012)
New Revision: 17055
Modified:
stack/cxf/branches/jbossws-cxf-4.0.x/modules/server/src/main/java/org/jboss/wsf/stack/cxf/RequestHandlerImpl.java
Log:
[JBPAPP6-1694] Set autoRewriteSoapAddressForAllServices option too
Modified: stack/cxf/branches/jbossws-cxf-4.0.x/modules/server/src/main/java/org/jboss/wsf/stack/cxf/RequestHandlerImpl.java
===================================================================
--- stack/cxf/branches/jbossws-cxf-4.0.x/modules/server/src/main/java/org/jboss/wsf/stack/cxf/RequestHandlerImpl.java 2012-12-05 17:57:04 UTC (rev 17054)
+++ stack/cxf/branches/jbossws-cxf-4.0.x/modules/server/src/main/java/org/jboss/wsf/stack/cxf/RequestHandlerImpl.java 2012-12-05 18:24:38 UTC (rev 17055)
@@ -200,8 +200,9 @@
String ctxUri = req.getRequestURI();
String baseUri = req.getRequestURL().toString() + "?" + req.getQueryString();
EndpointInfo endpointInfo = dest.getEndpointInfo();
- endpointInfo.setProperty(WSDLGetInterceptor.AUTO_REWRITE_ADDRESS,
- ServerConfig.UNDEFINED_HOSTNAME.equals(serverConfig.getWebServiceHost()));
+ boolean autoRewrite = ServerConfig.UNDEFINED_HOSTNAME.equals(serverConfig.getWebServiceHost());
+ endpointInfo.setProperty("autoRewriteSoapAddressForAllServices", autoRewrite);
+ endpointInfo.setProperty(WSDLGetInterceptor.AUTO_REWRITE_ADDRESS, autoRewrite);
for (QueryHandler queryHandler : bus.getExtension(QueryHandlerRegistry.class).getHandlers())
{
12 years, 3 months
JBossWS SVN: r17054 - stack/cxf/branches/jbossws-cxf-4.0.x.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2012-12-05 12:57:04 -0500 (Wed, 05 Dec 2012)
New Revision: 17054
Modified:
stack/cxf/branches/jbossws-cxf-4.0.x/pom.xml
Log:
Moving to cxf 2.4.10.jbossorg-1-SNAPSHOT
Modified: stack/cxf/branches/jbossws-cxf-4.0.x/pom.xml
===================================================================
--- stack/cxf/branches/jbossws-cxf-4.0.x/pom.xml 2012-12-05 17:53:30 UTC (rev 17053)
+++ stack/cxf/branches/jbossws-cxf-4.0.x/pom.xml 2012-12-05 17:57:04 UTC (rev 17054)
@@ -66,7 +66,7 @@
<jbossws.shared.testsuite.version>4.0.8-SNAPSHOT</jbossws.shared.testsuite.version>
<jboss712.version>7.1.3.Final-SNAPSHOT</jboss712.version>
<ejb.api.version>1.0.1.Final</ejb.api.version>
- <cxf.version>2.4.9.jbossorg-1</cxf.version>
+ <cxf.version>2.4.10.jbossorg-1-SNAPSHOT</cxf.version>
<cxf.asm.version>3.3.1</cxf.asm.version>
<cxf.xjcplugins.version>2.4.0</cxf.xjcplugins.version>
<fastinfoset.api.version>1.2.7</fastinfoset.api.version>
12 years, 3 months
JBossWS SVN: r17053 - thirdparty/cxf/branches/cxf-2.4.10/rt/frontend/simple/src/main/java/org/apache/cxf/frontend.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2012-12-05 12:53:30 -0500 (Wed, 05 Dec 2012)
New Revision: 17053
Modified:
thirdparty/cxf/branches/cxf-2.4.10/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/WSDLGetInterceptor.java
Log:
[JBPAPP6-1694] Adding autoRewriteSoapAddressForAllServices option (CXF-4677)
Modified: thirdparty/cxf/branches/cxf-2.4.10/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/WSDLGetInterceptor.java
===================================================================
--- thirdparty/cxf/branches/cxf-2.4.10/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/WSDLGetInterceptor.java 2012-12-05 14:46:09 UTC (rev 17052)
+++ thirdparty/cxf/branches/cxf-2.4.10/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/WSDLGetInterceptor.java 2012-12-05 17:53:30 UTC (rev 17053)
@@ -82,6 +82,7 @@
public static final WSDLGetInterceptor INSTANCE = new WSDLGetInterceptor();
public static final String AUTO_REWRITE_ADDRESS = "autoRewriteSoapAddress";
+ public static final String AUTO_REWRITE_ADDRESS_ALL = "autoRewriteSoapAddressForAllServices";
public static final String PUBLISHED_ENDPOINT_URL = "publishedEndpointUrl";
private static final String WSDLS_KEY = WSDLGetInterceptor.class.getName() + ".WSDLs";
@@ -302,7 +303,6 @@
Map<String, SchemaReference> smp,
Message message) {
List<Element> elementList = null;
- Object rewriteSoapAddress = message.getContextualProperty(AUTO_REWRITE_ADDRESS);
try {
elementList = DOMUtils.findAllElementsByTagNameNS(doc.getDocumentElement(),
@@ -348,7 +348,18 @@
base), e);
}
- if (rewriteSoapAddress == null || MessageUtils.isTrue(rewriteSoapAddress)) {
+ boolean rewriteAllSoapAddress = MessageUtils.isTrue(message.getContextualProperty(AUTO_REWRITE_ADDRESS_ALL));
+ if (rewriteAllSoapAddress) {
+ List<Element> portList = DOMUtils.findAllElementsByTagNameNS(doc.getDocumentElement(),
+ "http://schemas.xmlsoap.org/wsdl/",
+ "port");
+ for (Element el : portList) {
+ rewriteAddressProtocolHostPort(base, el, "http://schemas.xmlsoap.org/wsdl/soap/");
+ rewriteAddressProtocolHostPort(base, el, "http://schemas.xmlsoap.org/wsdl/soap12/");
+ }
+ }
+ Object rewriteSoapAddress = message.getContextualProperty(AUTO_REWRITE_ADDRESS);
+ if (rewriteSoapAddress == null || MessageUtils.isTrue(rewriteSoapAddress) || rewriteAllSoapAddress) {
List<Element> serviceList = DOMUtils.findAllElementsByTagNameNS(doc.getDocumentElement(),
"http://schemas.xmlsoap.org/wsdl/",
"service");
@@ -385,6 +396,25 @@
soapAddress.setAttribute("location", base);
}
}
+
+ protected void rewriteAddressProtocolHostPort(String base, Element el, String soapNS) {
+ List<Element> sadEls = DOMUtils.findAllElementsByTagNameNS(el,
+ soapNS,
+ "address");
+ for (Element soapAddress : sadEls) {
+ try {
+ String location = soapAddress.getAttribute("location").trim();
+ URL locUrl = new URL(location);
+ URL baseUrl = new URL(base);
+ StringBuilder sb = new StringBuilder(baseUrl.getProtocol());
+ sb.append("://").append(baseUrl.getHost()).append(":").append(baseUrl.getPort())
+ .append(locUrl.getPath());
+ soapAddress.setAttribute("location", sb.toString());
+ } catch (Exception e) {
+ //ignore
+ }
+ }
+ }
static String resolveWithCatalogs(OASISCatalogManager catalogs, String start, String base) {
try {
12 years, 3 months
JBossWS SVN: r17052 - stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3098.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2012-12-05 09:46:09 -0500 (Wed, 05 Dec 2012)
New Revision: 17052
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3098/BusHolderLifeCycleTestCase.java
Log:
[JBWS-3570] Fixing testcase regression
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 2012-12-05 14:45:10 UTC (rev 17051)
+++ stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jbws3098/BusHolderLifeCycleTestCase.java 2012-12-05 14:46:09 UTC (rev 17052)
@@ -63,7 +63,7 @@
Bus bus = holder.getBus();
TestLifeCycleListener listener = new TestLifeCycleListener();
bus.getExtension(BusLifeCycleManager.class).registerLifeCycleListener(listener);
- holder.configure(null, null, null, null);
+ holder.configure(null, null, null);
holder.close();
assertEquals("preShutdown method on listener should be called exactly once; number of actual calls: "
+ listener.getCount(), 1, listener.getCount());
@@ -74,7 +74,7 @@
Bus bus = holder.getBus();
TestLifeCycleListener listener = new TestLifeCycleListener();
bus.getExtension(BusLifeCycleManager.class).registerLifeCycleListener(listener);
- holder.configure(null, null, null, null);
+ holder.configure(null, null, null);
bus.shutdown(true);
holder.close();
assertEquals("preShutdown method on listener should be called exactly once; number of actual calls: "
@@ -86,7 +86,7 @@
Bus bus = holder.getBus();
TestLifeCycleListener listener = new TestLifeCycleListener();
bus.getExtension(BusLifeCycleManager.class).registerLifeCycleListener(listener);
- holder.configure(null, null, null, null);
+ holder.configure(null, null, null);
assertEquals("preShutdown method on listener shouldn't be called before holder is closed: number of actual calls: "
+ listener.getCount(), 0, listener.getCount());
holder.close();
12 years, 3 months
JBossWS SVN: r17051 - in stack/cxf/trunk/modules: server/src/main/java/org/jboss/wsf/stack/cxf and 7 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2012-12-05 09:45:10 -0500 (Wed, 05 Dec 2012)
New Revision: 17051
Added:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/addressRewrite/
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/addressRewrite/SoapAddressRewriteHelper.java
Removed:
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/AddressRewritingEndpointInfo.java
stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/SoapTransportFactoryExt.java
Modified:
stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/Loggers.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/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/aspect/BusDeploymentAspect.java
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/services/DDEndpoint.java
stack/cxf/trunk/modules/server/src/test/java/org/jboss/wsf/stack/cxf/configuration/BusHolderTest.java
Log:
[JBWS-3570] Replacing SoapTransportFactoryExt/AddressRewritingEndpointInfo integration hack with usage of Apache CXF 'publishedEndpointUrl' endpoint configuration option + fixing a couple of related bugs. This requires changes in JBWS-3571 and CXF-4674.
Modified: stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/Loggers.java
===================================================================
--- stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/Loggers.java 2012-12-05 14:38:28 UTC (rev 17050)
+++ stack/cxf/trunk/modules/client/src/main/java/org/jboss/wsf/stack/cxf/Loggers.java 2012-12-05 14:45:10 UTC (rev 17051)
@@ -90,8 +90,8 @@
void addressRewritten(String previousAddress, String address);
@LogMessage(level = DEBUG)
- @Message(id = 24038, value = "Invalid url provided, using it without rewriting: %s")
- void invalidAddressProvidedUseItWithoutRewriting(String address);
+ @Message(id = 24038, value = "Invalid url '%s' provided, using original one without rewriting: %s")
+ void invalidAddressProvidedUseItWithoutRewriting(String newAddress, String origAddress);
@LogMessage(level = TRACE)
@Message(id = 24039, value = "Spring namespace handler resolution: unable to resolve JBossWS specific handler for namespace '%s'; trying default namespace resolution...")
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 2012-12-05 14:38:28 UTC (rev 17050)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/RequestHandlerImpl.java 2012-12-05 14:45:10 UTC (rev 17051)
@@ -197,8 +197,10 @@
String ctxUri = req.getRequestURI();
String baseUri = req.getRequestURL().toString() + "?" + req.getQueryString();
EndpointInfo endpointInfo = dest.getEndpointInfo();
- endpointInfo.setProperty(WSDLGetUtils.AUTO_REWRITE_ADDRESS,
- ServerConfig.UNDEFINED_HOSTNAME.equals(serverConfig.getWebServiceHost()));
+ if (serverConfig.isModifySOAPAddress()) {
+ endpointInfo.setProperty(WSDLGetUtils.AUTO_REWRITE_ADDRESS_ALL,
+ ServerConfig.UNDEFINED_HOSTNAME.equals(serverConfig.getWebServiceHost()));
+ }
for (QueryHandler queryHandler : bus.getExtension(QueryHandlerRegistry.class).getHandlers())
{
Added: 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 (rev 0)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/addressRewrite/SoapAddressRewriteHelper.java 2012-12-05 14:45:10 UTC (rev 17051)
@@ -0,0 +1,169 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.wsf.stack.cxf.addressRewrite;
+
+import static org.jboss.wsf.stack.cxf.Loggers.ADDRESS_REWRITE_LOGGER;
+
+import java.net.URI;
+import java.net.URL;
+
+import org.jboss.wsf.spi.management.ServerConfig;
+
+/**
+ * Helper for rewriting soap:address in published wsdl
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 30-Nov-2012
+ */
+public class SoapAddressRewriteHelper
+{
+ private static final String HTTP = "http";
+ private static final String HTTPS = "https";
+
+ /**
+ * Rewrite and get address to be used for CXF published endpoint url prop (rewritten wsdl address)
+ *
+ * @param wsdlAddress The soap:address in the wsdl
+ * @param epAddress The address that has been computed for the endpoint
+ * @param serverConfig The current ServerConfig
+ * @return The rewritten soap:address to be used in the wsdl
+ */
+ public static String getRewrittenPublishedEndpointUrl(String wsdlAddress, String epAddress, ServerConfig serverConfig) {
+ if (wsdlAddress == null) {
+ return null;
+ }
+ if (isRewriteRequired(serverConfig, 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
+ final String uriScheme = (origUriScheme.equals(HTTPS) || newUriScheme.equals(HTTPS)) ? HTTPS : HTTP;
+ return rewriteSoapAddress(serverConfig, wsdlAddress, epAddress, uriScheme);
+ }
+ else
+ {
+ return wsdlAddress;
+ }
+ }
+
+ public static boolean isAutoRewriteOn(ServerConfig serverConfig)
+ {
+ return serverConfig.isModifySOAPAddress() && ServerConfig.UNDEFINED_HOSTNAME.equals(serverConfig.getWebServiceHost());
+ }
+
+ private static boolean isRewriteRequired(ServerConfig serverConfig, String address)
+ {
+ //check config prop forcing address rewrite
+ if (serverConfig.isModifySOAPAddress())
+ {
+ ADDRESS_REWRITE_LOGGER.addressRewriteRequiredBecauseOfServerConf(address);
+ return true;
+ }
+ //check if the previous address is not valid
+ if (isInvalidAddress(address))
+ {
+ ADDRESS_REWRITE_LOGGER.addressRewriteRequiredBecauseOfInvalidAddress(address);
+ return true;
+ }
+ ADDRESS_REWRITE_LOGGER.rewriteNotRequired(address);
+ return false;
+ }
+
+ private static boolean isInvalidAddress(String address)
+ {
+ if (address == null)
+ {
+ return true;
+ }
+ String s = address.trim();
+ if (s.length() == 0 || s.contains("REPLACE_WITH_ACTUAL_URL"))
+ {
+ return true;
+ }
+ try
+ {
+ new URL(s);
+ }
+ catch (Exception e)
+ {
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Rewrite the provided address according to the current server
+ * configuration and always using the specified uriScheme.
+ *
+ * @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)
+ {
+ try
+ {
+ URL url = new URL(newAddress);
+ String path = url.getPath();
+ String host = serverConfig.getWebServiceHost();
+ String port = "";
+ if (HTTPS.equals(uriScheme))
+ {
+ int portNo = serverConfig.getWebServiceSecurePort();
+ if (portNo != 443)
+ {
+ port = ":" + portNo;
+ }
+ }
+ else
+ {
+ int portNo = serverConfig.getWebServicePort();
+ if (portNo != 80)
+ {
+ port = ":" + portNo;
+ }
+ }
+ String urlStr = uriScheme + "://" + host + port + path;
+ ADDRESS_REWRITE_LOGGER.addressRewritten(origAddress, urlStr);
+ return urlStr;
+ }
+ catch (Exception e)
+ {
+ ADDRESS_REWRITE_LOGGER.invalidAddressProvidedUseItWithoutRewriting(newAddress, origAddress);
+ return origAddress;
+ }
+ }
+
+ private static String getUriScheme(String address)
+ {
+ try
+ {
+ URI addrURI = new URI(address);
+ String scheme = addrURI.getScheme();
+ return scheme != null ? scheme : HTTP;
+ }
+ catch (Exception e)
+ {
+ return HTTP;
+ }
+ }
+}
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 2012-12-05 14:38:28 UTC (rev 17050)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/BusHolder.java 2012-12-05 14:45:10 UTC (rev 17051)
@@ -26,7 +26,6 @@
import java.util.Map;
import org.apache.cxf.Bus;
-import org.apache.cxf.binding.soap.SoapTransportFactory;
import org.apache.cxf.buslifecycle.BusLifeCycleListener;
import org.apache.cxf.buslifecycle.BusLifeCycleManager;
import org.apache.cxf.configuration.Configurer;
@@ -37,7 +36,6 @@
import org.apache.cxf.management.interceptor.ResponseTimeMessageOutInterceptor;
import org.apache.cxf.resource.ResourceManager;
import org.apache.cxf.resource.ResourceResolver;
-import org.apache.cxf.transport.DestinationFactoryManager;
import org.apache.cxf.workqueue.AutomaticWorkQueue;
import org.apache.cxf.workqueue.AutomaticWorkQueueImpl;
import org.apache.cxf.workqueue.WorkQueueManager;
@@ -82,12 +80,11 @@
* Update the Bus held by the this instance using the provided parameters.
* This basically prepares the bus for being used with JBossWS.
*
- * @param soapTransportFactory The SoapTransportFactory to configure, if any
* @param resolver The ResourceResolver to configure, if any
* @param configurer The JBossWSCXFConfigurer to install in the bus, if any
* @param wsmd The current JBossWebservicesMetaData, if any
*/
- public void configure(SoapTransportFactory soapTransportFactory, ResourceResolver resolver, Configurer configurer, JBossWebservicesMetaData wsmd)
+ public void configure(ResourceResolver resolver, Configurer configurer, JBossWebservicesMetaData wsmd)
{
bus.setProperty(org.jboss.wsf.stack.cxf.client.Constants.DEPLOYMENT_BUS, true);
busHolderListener = new BusHolderLifeCycleListener();
@@ -98,7 +95,6 @@
bus.setExtension(configurer, Configurer.class);
}
setInterceptors(bus);
- setSoapTransportFactory(bus, soapTransportFactory);
setResourceResolver(bus, resolver);
Map<String, String> props = (wsmd == null) ? null : wsmd.getProperties();
@@ -157,17 +153,6 @@
}
}
- protected static void setSoapTransportFactory(Bus bus, SoapTransportFactory factory)
- {
- if (factory != null)
- {
- DestinationFactoryManager dfm = bus.getExtension(DestinationFactoryManager.class);
- factory.setBus(bus);
- dfm.registerDestinationFactory(org.jboss.ws.common.Constants.NS_SOAP11, factory);
- dfm.registerDestinationFactory(org.jboss.ws.common.Constants.NS_SOAP12, factory);
- }
- }
-
/**
* Adds work queues parsing simple values of properties in jboss-webservices.xml:
* cxf.queue.<queue-name>.<parameter> = value
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 2012-12-05 14:38:28 UTC (rev 17050)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/NonSpringBusHolder.java 2012-12-05 14:45:10 UTC (rev 17051)
@@ -29,7 +29,6 @@
import javax.xml.ws.handler.Handler;
import javax.xml.ws.soap.SOAPBinding;
-import org.apache.cxf.binding.soap.SoapTransportFactory;
import org.apache.cxf.configuration.Configurer;
import org.apache.cxf.resource.ResourceResolver;
import org.apache.cxf.service.invoker.Invoker;
@@ -77,19 +76,18 @@
* Update the Bus held by the this instance using the provided parameters.
* This basically prepares the bus for being used with JBossWS.
*
- * @param soapTransportFactory The SoapTransportFactory to configure, if any
* @param resolver The ResourceResolver to configure, if any
* @param configurer The JBossWSCXFConfigurer to install in the bus, if any
* @param wsmd The current JBossWebservicesMetaData, if any
*/
@Override
- public void configure(SoapTransportFactory soapTransportFactory, ResourceResolver resolver, Configurer configurer, JBossWebservicesMetaData wsmd)
+ public void configure(ResourceResolver resolver, Configurer configurer, JBossWebservicesMetaData wsmd)
{
if (configured)
{
throw Messages.MESSAGES.busAlreadyConfigured(bus);
}
- super.configure(soapTransportFactory, resolver, configurer, wsmd);
+ super.configure(resolver, configurer, wsmd);
for (DDEndpoint dde : metadata.getEndpoints())
{
@@ -114,6 +112,7 @@
addressingFeature.setResponses(dde.getAddressingResponses());
endpoint.getFeatures().add(addressingFeature);
}
+ endpoint.setPublishedEndpointUrl(dde.getPublishedEndpointUrl());
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 2012-12-05 14:38:28 UTC (rev 17050)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/configuration/SpringBusHolder.java 2012-12-05 14:45:10 UTC (rev 17051)
@@ -32,7 +32,6 @@
import java.util.List;
import org.apache.cxf.Bus;
-import org.apache.cxf.binding.soap.SoapTransportFactory;
import org.apache.cxf.bus.spring.BusApplicationContext;
import org.apache.cxf.configuration.ConfiguredBeanLocator;
import org.apache.cxf.configuration.Configurer;
@@ -115,20 +114,19 @@
* Update the Bus held by the this instance using the provided parameters.
* This basically prepares the bus for being used with JBossWS.
*
- * @param soapTransportFactory The SoapTransportFactory to configure, if any
* @param resolver The ResourceResolver to configure, if any
* @param configurer The JBossWSCXFConfigurer to install in the bus, if any
* @param dep The current JBossWS-SPI Deployment
* @param wsmd The current JBossWebservicesMetaData, if any
*/
@Override
- public void configure(SoapTransportFactory soapTransportFactory, ResourceResolver resolver, Configurer configurer, JBossWebservicesMetaData wsmd)
+ public void configure(ResourceResolver resolver, Configurer configurer, JBossWebservicesMetaData wsmd)
{
if (configured)
{
throw MESSAGES.busAlreadyConfigured(ctx);
}
- super.configure(soapTransportFactory, resolver, configurer, wsmd);
+ super.configure(resolver, configurer, wsmd);
if (additionalLocations != null)
{
for (URL jbossCxfXml : additionalLocations)
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/BusDeploymentAspect.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/BusDeploymentAspect.java 2012-12-05 14:38:28 UTC (rev 17050)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/deployment/aspect/BusDeploymentAspect.java 2012-12-05 14:45:10 UTC (rev 17051)
@@ -45,7 +45,6 @@
import org.jboss.wsf.stack.cxf.deployment.WSDLFilePublisher;
import org.jboss.wsf.stack.cxf.metadata.services.DDBeans;
import org.jboss.wsf.stack.cxf.resolver.JBossWSResourceResolver;
-import org.jboss.wsf.stack.cxf.transport.SoapTransportFactoryExt;
/**
* A deployment aspect that creates the CXF Bus early and attaches it to the endpoints (wrapped in a BusHolder)
@@ -126,7 +125,7 @@
Configurer configurer = holder.createServerConfigurer(dep.getAttachment(BindingCustomization.class),
new WSDLFilePublisher(aDep), dep.getService().getEndpoints(), aDep.getRootFile(), epConfigName, epConfigFile);
- holder.configure(new SoapTransportFactoryExt(), resolver, configurer, wsmd);
+ holder.configure(resolver, configurer, wsmd);
dep.addAttachment(BusHolder.class, holder);
}
finally
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 2012-12-05 14:38:28 UTC (rev 17050)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/metadata/MetadataBuilder.java 2012-12-05 14:45:10 UTC (rev 17051)
@@ -24,6 +24,8 @@
import static org.jboss.wsf.stack.cxf.Loggers.METADATA_LOGGER;
import static org.jboss.wsf.stack.cxf.Messages.MESSAGES;
+import java.io.IOException;
+import java.net.URL;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
@@ -39,10 +41,15 @@
import javax.xml.ws.soap.SOAPBinding;
import org.jboss.ws.common.JavaUtils;
+import org.jboss.ws.common.deployment.SOAPAddressWSDLParser;
+import org.jboss.wsf.spi.SPIProvider;
+import org.jboss.wsf.spi.SPIProviderResolver;
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.management.ServerConfigFactory;
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;
@@ -50,6 +57,7 @@
import org.jboss.wsf.spi.metadata.webservices.WebserviceDescriptionMetaData;
import org.jboss.wsf.spi.metadata.webservices.WebservicesMetaData;
import org.jboss.wsf.stack.cxf.JBossWSInvoker;
+import org.jboss.wsf.stack.cxf.addressRewrite.SoapAddressRewriteHelper;
import org.jboss.wsf.stack.cxf.metadata.services.DDBeans;
import org.jboss.wsf.stack.cxf.metadata.services.DDEndpoint;
@@ -62,6 +70,8 @@
*/
public class MetadataBuilder
{
+ private static ServerConfig serverConfig;
+
public MetadataBuilder()
{
@@ -69,6 +79,7 @@
public DDBeans build(Deployment dep)
{
+ Map<String, SOAPAddressWSDLParser> soapAddressWsdlParsers = new HashMap<String, SOAPAddressWSDLParser>();
DDBeans dd = new DDBeans();
for (Endpoint ep : dep.getService().getEndpoints())
{
@@ -79,8 +90,9 @@
ddep.setInvoker(JBossWSInvoker.class.getName());
}
processWSDDContribution(ddep, (ArchiveDeployment)dep);
+ processAddressRewrite(ddep, (ArchiveDeployment)dep, soapAddressWsdlParsers);
- METADATA_LOGGER.addingServiceEndpointMetadata(ddep);
+ METADATA_LOGGER.addingServiceEndpointMetadata(METADATA_LOGGER.isDebugEnabled() ? ddep.toStringExtended() : ddep.toString());
dd.addEndpoint(ddep);
}
return dd;
@@ -209,22 +221,27 @@
Class<?> seiClass = null;
String seiName;
+ boolean missingServicePortAttr = false;
String name = (anWebService != null) ? anWebService.name() : "";
if (name.length() == 0)
name = JavaUtils.getJustClassName(sepClass);
String serviceName = (anWebService != null) ? anWebService.serviceName() : anWebServiceProvider.serviceName();
- if (serviceName.length() == 0)
+ if (serviceName.length() == 0) {
+ missingServicePortAttr = true;
serviceName = JavaUtils.getJustClassName(sepClass) + "Service";
+ }
String serviceNS = (anWebService != null) ? anWebService.targetNamespace() : anWebServiceProvider.targetNamespace();
if (serviceNS.length() == 0)
serviceNS = getTypeNamespace(JavaUtils.getPackageName(sepClass));
String portName = (anWebService != null) ? anWebService.portName() : anWebServiceProvider.portName();
- if (portName.length() == 0)
+ if (portName.length() == 0) {
+ missingServicePortAttr = true;
portName = name + "Port";
+ }
if (anWebService != null && anWebService.endpointInterface().length() > 0)
{
@@ -250,6 +267,7 @@
throw MESSAGES.webserviceAnnotationSEIAttributes(seiName);
}
+ final String annWsdlLocation = (anWebService != null) ? anWebService.wsdlLocation() : anWebServiceProvider.wsdlLocation();
DDEndpoint result = new DDEndpoint();
@@ -265,9 +283,52 @@
props.put(k, ep.getProperty(k));
}
result.setProperties(props);
+ if (!missingServicePortAttr && annWsdlLocation.length() > 0) {
+ result.setAnnotationWsdlLocation(annWsdlLocation);
+ }
return result;
}
+ protected void processAddressRewrite(DDEndpoint ddep, ArchiveDeployment dep, Map<String, SOAPAddressWSDLParser> soapAddressWsdlParsers)
+ {
+ String wsdlLocation = ddep.getWsdlLocation();
+ if (wsdlLocation == null) {
+ wsdlLocation = ddep.getAnnotationWsdlLocation();
+ }
+ if (wsdlLocation != null) {
+ try {
+ URL wsdlUrl = dep.getResourceResolver().resolve(wsdlLocation);
+
+ SOAPAddressWSDLParser parser = getCurrentSOAPAddressWSDLParser(wsdlUrl, soapAddressWsdlParsers);
+ //do not try rewriting addresses for not-http binding
+ String wsdlAddress = parser.filterSoapAddress(ddep.getServiceName(), ddep.getPortName(), SOAPAddressWSDLParser.SOAP_HTTP_NS);
+
+ final ServerConfig sc = getServerConfig();
+ String rewrittenWsdlAddress = SoapAddressRewriteHelper.getRewrittenPublishedEndpointUrl(wsdlAddress, ddep.getAddress(), sc);
+ //If "auto rewrite", leave "publishedEndpointUrl" unset so that CXF do 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)) {
+ ddep.setPublishedEndpointUrl(rewrittenWsdlAddress);
+ }
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ }
+
+ private SOAPAddressWSDLParser getCurrentSOAPAddressWSDLParser(URL wsdlUrl, Map<String, SOAPAddressWSDLParser> soapAddressWsdlParsers) {
+ final String key = wsdlUrl.toString();
+ SOAPAddressWSDLParser parser = soapAddressWsdlParsers.get(key);
+ if (parser != null) {
+ return parser;
+ } else {
+ parser = new SOAPAddressWSDLParser(wsdlUrl);
+ soapAddressWsdlParsers.put(key, parser);
+ return parser;
+ }
+ }
+
/**
* Extracts the typeNS given the package name
* Algorithm is based on the one specified in JAXWS v2.0 spec
@@ -300,4 +361,14 @@
return sb.toString();
}
+ private static synchronized ServerConfig getServerConfig()
+ {
+ if (serverConfig == null)
+ {
+ SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
+ serverConfig = spiProvider.getSPI(ServerConfigFactory.class).getServerConfig();
+ }
+ return serverConfig;
+ }
+
}
Modified: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/metadata/services/DDEndpoint.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/metadata/services/DDEndpoint.java 2012-12-05 14:38:28 UTC (rev 17050)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/metadata/services/DDEndpoint.java 2012-12-05 14:45:10 UTC (rev 17051)
@@ -42,6 +42,8 @@
private String id;
private String address;
+
+ private String publishedEndpointUrl;
private String implementor;
@@ -72,6 +74,8 @@
//additional fields
private Class<?> epClass;
+ private String annotationWsdlLocation;
+
private int counter = 0;
public QName getPortName()
@@ -114,6 +118,16 @@
this.address = address;
}
+ public String getPublishedEndpointUrl()
+ {
+ return publishedEndpointUrl;
+ }
+
+ public void setPublishedEndpointUrl(String publishedEndpointUrl)
+ {
+ this.publishedEndpointUrl = publishedEndpointUrl;
+ }
+
public String getImplementor()
{
return implementor;
@@ -134,6 +148,16 @@
this.wsdlLocation = wsdlLocation;
}
+ public String getAnnotationWsdlLocation()
+ {
+ return annotationWsdlLocation;
+ }
+
+ public void setAnnotationWsdlLocation(String annotationWsdlLocation)
+ {
+ this.annotationWsdlLocation = annotationWsdlLocation;
+ }
+
public Class<?> getEpClass()
{
return epClass;
@@ -231,6 +255,10 @@
{
writer.write("<jaxws:endpoint id='" + this.id + "'");
writer.write(" address='" + this.address + "'");
+ if (this.publishedEndpointUrl != null)
+ {
+ writer.write(" publishedEndpointUrl='" + this.publishedEndpointUrl + "'");
+ }
writer.write(" implementor='" + this.implementor + "'");
if (this.serviceName != null)
{
@@ -242,7 +270,7 @@
}
if (this.wsdlLocation != null)
{
- writer.write(" wsdlLocationOverride='" + this.wsdlLocation + "'");
+ writer.write(" wsdlLocation='" + this.wsdlLocation + "'");
}
writer.write(">");
@@ -316,17 +344,17 @@
writer.write(" " + elementName + "='" + prefix + ":" + qname.getLocalPart() + "'");
writer.write(" xmlns:" + prefix + "='" + qname.getNamespaceURI() + "'");
}
-
- public String toString()
+
+ private StringBuilder basicToString()
{
StringBuilder str = new StringBuilder();
str.append("id=" + this.id);
str.append("\n address=" + this.address);
str.append("\n implementor=" + this.implementor);
- str.append("\n invoker=" + this.invoker);
str.append("\n serviceName=" + this.serviceName);
str.append("\n portName=" + this.portName);
- str.append("\n wsdlLocation=" + this.wsdlLocation);
+ str.append("\n annotationWsdlLocation=" + this.annotationWsdlLocation);
+ str.append("\n wsdlLocationOverride=" + this.wsdlLocation);
str.append("\n mtomEnabled=" + this.mtomEnabled);
if (this.handlers != null && !this.handlers.isEmpty()) {
str.append("\n handlers=[");
@@ -335,6 +363,19 @@
str.append(it.hasNext() ? "," : "]");
}
}
+ return str;
+ }
+
+ public String toString()
+ {
+ return basicToString().toString();
+ }
+
+ public String toStringExtended()
+ {
+ StringBuilder str = basicToString();
+ str.append("\n publishedEndpointUrl=" + this.publishedEndpointUrl);
+ str.append("\n invoker=" + this.invoker);
if (this.properties != null && !this.properties.isEmpty())
{
str.append("\n properties=[");
Deleted: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/AddressRewritingEndpointInfo.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/AddressRewritingEndpointInfo.java 2012-12-05 14:38:28 UTC (rev 17050)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/AddressRewritingEndpointInfo.java 2012-12-05 14:45:10 UTC (rev 17051)
@@ -1,216 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.wsf.stack.cxf.transport;
-
-import static org.jboss.wsf.stack.cxf.Loggers.ADDRESS_REWRITE_LOGGER;
-
-import java.net.URI;
-import java.net.URL;
-
-import org.apache.cxf.service.model.EndpointInfo;
-import org.apache.cxf.service.model.ServiceInfo;
-import org.apache.cxf.binding.soap.wsdl.extensions.SoapAddress;
-import org.jboss.wsf.spi.management.ServerConfig;
-
-/**
- * A custom EndpointInfo that updates the SoapAddress extension
- * coming from the wsdl definition according to the JBossWS
- * soap address rewrite rules.
- *
- * @see org.apache.cxf.binding.soap.SoapTransportFactory.SoapEndpointInfo
- *
- * @author alessio.soldano(a)jboss.com
- * @since 03-Aug-2009
- *
- */
-public class AddressRewritingEndpointInfo extends EndpointInfo
-{
- private ServerConfig serverConfig;
- SoapAddress saddress;
-
- AddressRewritingEndpointInfo(ServiceInfo serv, String trans, ServerConfig serverConfig)
- {
- super(serv, trans);
- this.serverConfig = serverConfig;
- }
-
- /**
- * This is the method responsible for both setting the EndpointInfo address and
- * setting the soap:address in the wsdl.
- * While the former action is straightforward, the latter is performed according
- * to the JBossWS configuration: every time CXF updates the EndpointInfo address
- * (which usually happens twice) this makes sure a proper address is updated in
- * the wsdl.
- *
- * {@inheritDoc}
- */
- public void setAddress(String s)
- {
- String previousAddress = super.getAddress();
- super.setAddress(s);
- boolean setNewAddress = false;
- if (previousAddress == null)
- {
- setNewAddress = true;
- }
- else if (isRewriteAllowed(s) && isRewriteRequired(s, previousAddress))
- {
- String uriScheme = getUriScheme(s);
- //we set https if the transport guarantee is CONFIDENTIAL or the previous address already used https
- //(if the original wsdl soap:address uses https we can't overwrite it with http)
- if ("https".equalsIgnoreCase(getUriScheme(previousAddress)))
- {
- uriScheme = "https";
- }
- if (uriScheme == null)
- {
- uriScheme = "http";
- }
- //rewrite the candidate new address
- s = rewriteSoapAddress(s, uriScheme);
- setNewAddress = true;
- }
- if (setNewAddress && saddress != null)
- {
- ADDRESS_REWRITE_LOGGER.settingNewServiceEndpointAddressInWsdl(s);
- saddress.setLocationURI(s);
- }
- }
-
- public void addExtensor(Object el)
- {
- super.addExtensor(el);
- if (el instanceof SoapAddress)
- {
- saddress = (SoapAddress)el;
- }
- }
-
- protected boolean isRewriteAllowed(String address)
- {
- //exclude non http addresses
- return (address != null && address.trim().toLowerCase().startsWith("http"));
- }
-
-
- protected boolean isRewriteRequired(String address, String previousAddress)
- {
- //JBWS-3297:rewrite is only needed when previousAddress(from wsdl) is different with the published wsdl
- if (address.equals(previousAddress)) {
- return false;
- }
- //check config prop forcing address rewrite
- if (serverConfig.isModifySOAPAddress())
- {
- ADDRESS_REWRITE_LOGGER.addressRewriteRequiredBecauseOfServerConf(previousAddress);
- return true;
- }
- //check if the previous address is not valid
- if (isInvalidAddress(previousAddress))
- {
- ADDRESS_REWRITE_LOGGER.addressRewriteRequiredBecauseOfInvalidAddress(previousAddress);
- return true;
- }
- ADDRESS_REWRITE_LOGGER.rewriteNotRequired(previousAddress);
- return false;
- }
-
- protected boolean isInvalidAddress(String address)
- {
- if (address == null)
- {
- return true;
- }
- String s = address.trim();
- if (s.length() == 0 || s.contains("REPLACE_WITH_ACTUAL_URL"))
- {
- return true;
- }
- try
- {
- new URL(s);
- }
- catch (Exception e)
- {
- return true;
- }
- return false;
- }
-
- /**
- * Rewrite the provided address according to the current server
- * configuration and always using the specified uriScheme.
- *
- * @param s The source address
- * @param uriScheme The uriScheme to use for rewrite
- * @return The obtained address
- */
- protected String rewriteSoapAddress(String s, String uriScheme)
- {
- try
- {
- URL url = new URL(s);
- String path = url.getPath();
- String host = serverConfig.getWebServiceHost();
- String port = "";
- if ("https".equals(uriScheme))
- {
- int portNo = serverConfig.getWebServiceSecurePort();
- if (portNo != 443)
- {
- port = ":" + portNo;
- }
- }
- else
- {
- int portNo = serverConfig.getWebServicePort();
- if (portNo != 80)
- {
- port = ":" + portNo;
- }
- }
- String urlStr = uriScheme + "://" + host + port + path;
-
- ADDRESS_REWRITE_LOGGER.addressRewritten(s, urlStr);
- return urlStr;
- }
- catch (Exception e)
- {
- ADDRESS_REWRITE_LOGGER.invalidAddressProvidedUseItWithoutRewriting(s);
- return s;
- }
- }
-
- private static String getUriScheme(String address)
- {
- try
- {
- URI addrURI = new URI(address);
- String scheme = addrURI.getScheme();
- return scheme;
- }
- catch (Exception e)
- {
- return null;
- }
- }
-}
Deleted: stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/SoapTransportFactoryExt.java
===================================================================
--- stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/SoapTransportFactoryExt.java 2012-12-05 14:38:28 UTC (rev 17050)
+++ stack/cxf/trunk/modules/server/src/main/java/org/jboss/wsf/stack/cxf/transport/SoapTransportFactoryExt.java 2012-12-05 14:45:10 UTC (rev 17051)
@@ -1,106 +0,0 @@
-/*
- * 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.wsf.stack.cxf.transport;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.apache.cxf.binding.soap.SoapTransportFactory;
-import org.apache.cxf.binding.soap.jms.interceptor.SoapJMSConstants;
-import org.apache.cxf.binding.soap.model.SoapBindingInfo;
-import org.apache.cxf.service.model.BindingInfo;
-import org.apache.cxf.service.model.EndpointInfo;
-import org.apache.cxf.service.model.ServiceInfo;
-import org.apache.cxf.binding.soap.wsdl.extensions.SoapAddress;
-import org.apache.cxf.binding.soap.SOAPBindingUtil;
-import org.jboss.wsf.spi.SPIProvider;
-import org.jboss.wsf.spi.SPIProviderResolver;
-import org.jboss.wsf.spi.management.ServerConfig;
-import org.jboss.wsf.spi.management.ServerConfigFactory;
-
-/**
- * A SoapTransportFactory extending @see org.apache.cxf.binding.soap.SoapTransportFactory.
- * It overrides the EndpointInfo creation method to allow for the soap:address extension
- * of the wsdl to be overwritten according to the JBossWS configuration.
- *
- * @author alessio.soldano(a)jboss.com
- * @since 31-Jul-2009
- *
- */
-public class SoapTransportFactoryExt extends SoapTransportFactory
-{
- private ServerConfig serverConfig;
-
- @Override
- public EndpointInfo createEndpointInfo(ServiceInfo serviceInfo, BindingInfo b, List<?> ees)
- {
- String transportURI = "http://schemas.xmlsoap.org/wsdl/soap/";
- if (b instanceof SoapBindingInfo)
- {
- SoapBindingInfo sbi = (SoapBindingInfo) b;
- transportURI = sbi.getTransportURI();
- }
- ServerConfig config = getServerConfig();
- EndpointInfo info = new AddressRewritingEndpointInfo(serviceInfo, transportURI, config);
-
- if (ees != null)
- {
- for (@SuppressWarnings("rawtypes")Iterator itr = ees.iterator(); itr.hasNext();)
- {
- Object extensor = itr.next();
-
- if (SOAPBindingUtil.isSOAPAddress(extensor))
- {
- final SoapAddress sa = SOAPBindingUtil.getSoapAddress(extensor);
-
- info.addExtensor(sa);
- info.setAddress(sa.getLocationURI());
- if (isJMSSpecAddress(sa.getLocationURI()))
- {
- info.setTransportId(SoapJMSConstants.SOAP_JMS_SPECIFICIATION_TRANSPORTID);
- }
- }
- else
- {
- info.addExtensor(extensor);
- }
- }
- }
-
- return info;
- }
-
- private boolean isJMSSpecAddress(String address)
- {
- return address != null && address.startsWith("jms:") && !"jms://".equals(address);
- }
-
- private ServerConfig getServerConfig()
- {
- if (serverConfig == null)
- {
- SPIProvider spiProvider = SPIProviderResolver.getInstance().getProvider();
- serverConfig = spiProvider.getSPI(ServerConfigFactory.class).getServerConfig();
- }
- return serverConfig;
- }
-}
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 2012-12-05 14:38:28 UTC (rev 17050)
+++ stack/cxf/trunk/modules/server/src/test/java/org/jboss/wsf/stack/cxf/configuration/BusHolderTest.java 2012-12-05 14:45:10 UTC (rev 17051)
@@ -64,7 +64,7 @@
}
BusHolder holder = new NonSpringBusHolder(new DDBeans());
try {
- holder.configure(null, null, null, wsmd);
+ holder.configure(null, null, wsmd);
return holder.getBus().getExtension(PolicyEngine.class).getAlternativeSelector().getClass().getName();
} finally {
holder.close();
12 years, 3 months