JBossWS SVN: r16166 - in stack/native/branches/jbossws-native-4.0.x: modules/testsuite/native-tests/src/test/resources/jaxrpc/jbws1792/WEB-INF and 2 other directories.
by jbossws-commits@lists.jboss.org
Author: ropalka
Date: 2012-04-16 09:57:51 -0400 (Mon, 16 Apr 2012)
New Revision: 16166
Modified:
stack/native/branches/jbossws-native-4.0.x/
stack/native/branches/jbossws-native-4.0.x/modules/testsuite/native-tests/src/test/resources/jaxrpc/jbws1792/WEB-INF/web.xml
stack/native/branches/jbossws-native-4.0.x/modules/testsuite/native-tests/src/test/resources/jaxrpc/marshall-rpclit/WEB-INF/web.xml
stack/native/branches/jbossws-native-4.0.x/modules/testsuite/native-tests/src/test/resources/jaxrpc/outparam/WEB-INF/web.xml
Log:
[JBPAPP-8667] Merged revisions 16165 via svnmerge from
https://svn.jboss.org/repos/jbossws/stack/native/trunk
.......
r16165 | ropalka | 2012-04-16 15:52:43 +0200 (Mon, 16 Apr 2012) | 1 line
[JBWS-3481] removing useless configuration parameters
.......
Property changes on: stack/native/branches/jbossws-native-4.0.x
___________________________________________________________________
Modified: svnmerge-integrated
- https://svn.jboss.org/repos/jbossws/stack/native/trunk:1-15651,15653-1567...
+ https://svn.jboss.org/repos/jbossws/stack/native/trunk:1-15651,15653-1567...
Modified: svn:mergeinfo
- /stack/native/branches/asoldano:14057,14069
/stack/native/branches/ropalka:13836-13879
/stack/native/trunk:15653,15670-15677,15686,15696,15707,15714,15726-15731,15739-15740,15749-15759,15761,15775-15777,15779,15787-15791,15793,15795,15797-15804,15810,15812-15818,15821,15823-15827,15829,15831,15836-15840,15858,15861,15871,15873,15880-15883,15887,15890-15891,15904-15931,15944,15974,15988,15991,15995,15997,15999,16003,16013,16015,16021,16050-16052,16063-16065,16073-16078,16081-16085,16091-16095,16103-16105
+ /stack/native/branches/asoldano:14057,14069
/stack/native/branches/ropalka:13836-13879
/stack/native/trunk:15653,15670-15677,15686,15696,15707,15714,15726-15731,15739-15740,15749-15759,15761,15775-15777,15779,15787-15791,15793,15795,15797-15804,15810,15812-15818,15821,15823-15827,15829,15831,15836-15840,15858,15861,15871,15873,15880-15883,15887,15890-15891,15904-15931,15944,15974,15988,15991,15995,15997,15999,16003,16013,16015,16021,16050-16052,16063-16065,16073-16078,16081-16085,16091-16095,16103-16105,16165
Modified: stack/native/branches/jbossws-native-4.0.x/modules/testsuite/native-tests/src/test/resources/jaxrpc/jbws1792/WEB-INF/web.xml
===================================================================
--- stack/native/branches/jbossws-native-4.0.x/modules/testsuite/native-tests/src/test/resources/jaxrpc/jbws1792/WEB-INF/web.xml 2012-04-16 13:52:43 UTC (rev 16165)
+++ stack/native/branches/jbossws-native-4.0.x/modules/testsuite/native-tests/src/test/resources/jaxrpc/jbws1792/WEB-INF/web.xml 2012-04-16 13:57:51 UTC (rev 16166)
@@ -5,15 +5,6 @@
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
- <context-param>
- <param-name>jbossws-config-name</param-name>
- <param-value>Custom Endpoint Config</param-value>
- </context-param>
- <context-param>
- <param-name>jbossws-config-file</param-name>
- <param-value>WEB-INF/custom-endpoint-config.xml</param-value>
- </context-param>
-
<servlet>
<servlet-name>TestEndpoint</servlet-name>
<servlet-class>org.jboss.test.ws.jaxrpc.jbws1792.TestEndpointImpl</servlet-class>
Modified: stack/native/branches/jbossws-native-4.0.x/modules/testsuite/native-tests/src/test/resources/jaxrpc/marshall-rpclit/WEB-INF/web.xml
===================================================================
--- stack/native/branches/jbossws-native-4.0.x/modules/testsuite/native-tests/src/test/resources/jaxrpc/marshall-rpclit/WEB-INF/web.xml 2012-04-16 13:52:43 UTC (rev 16165)
+++ stack/native/branches/jbossws-native-4.0.x/modules/testsuite/native-tests/src/test/resources/jaxrpc/marshall-rpclit/WEB-INF/web.xml 2012-04-16 13:57:51 UTC (rev 16166)
@@ -5,12 +5,7 @@
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
- <context-param>
- <param-name>jbossws-config-name</param-name>
- <param-value>Standard Endpoint</param-value>
- </context-param>
-
- <servlet>
+ <servlet>
<servlet-name>StandardTypes</servlet-name>
<servlet-class>org.jboss.test.ws.jaxrpc.marshall.StandardTypesBean</servlet-class>
</servlet>
Modified: stack/native/branches/jbossws-native-4.0.x/modules/testsuite/native-tests/src/test/resources/jaxrpc/outparam/WEB-INF/web.xml
===================================================================
--- stack/native/branches/jbossws-native-4.0.x/modules/testsuite/native-tests/src/test/resources/jaxrpc/outparam/WEB-INF/web.xml 2012-04-16 13:52:43 UTC (rev 16165)
+++ stack/native/branches/jbossws-native-4.0.x/modules/testsuite/native-tests/src/test/resources/jaxrpc/outparam/WEB-INF/web.xml 2012-04-16 13:57:51 UTC (rev 16166)
@@ -5,11 +5,6 @@
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
- <context-param>
- <param-name>jbossws-config-name</param-name>
- <param-value>Standard Endpoint</param-value>
- </context-param>
-
<servlet>
<servlet-name>OutParamTestService</servlet-name>
<servlet-class>org.jboss.test.ws.jaxrpc.outparam.OutParamTestServiceBean</servlet-class>
12 years, 8 months
JBossWS SVN: r16165 - in stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxrpc: marshall-rpclit/WEB-INF and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: ropalka
Date: 2012-04-16 09:52:43 -0400 (Mon, 16 Apr 2012)
New Revision: 16165
Modified:
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxrpc/jbws1792/WEB-INF/web.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxrpc/marshall-rpclit/WEB-INF/web.xml
stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxrpc/outparam/WEB-INF/web.xml
Log:
[JBWS-3481] removing useless configuration parameters
Modified: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxrpc/jbws1792/WEB-INF/web.xml
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxrpc/jbws1792/WEB-INF/web.xml 2012-04-16 08:35:02 UTC (rev 16164)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxrpc/jbws1792/WEB-INF/web.xml 2012-04-16 13:52:43 UTC (rev 16165)
@@ -5,15 +5,6 @@
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
- <context-param>
- <param-name>jbossws-config-name</param-name>
- <param-value>Custom Endpoint Config</param-value>
- </context-param>
- <context-param>
- <param-name>jbossws-config-file</param-name>
- <param-value>WEB-INF/custom-endpoint-config.xml</param-value>
- </context-param>
-
<servlet>
<servlet-name>TestEndpoint</servlet-name>
<servlet-class>org.jboss.test.ws.jaxrpc.jbws1792.TestEndpointImpl</servlet-class>
Modified: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxrpc/marshall-rpclit/WEB-INF/web.xml
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxrpc/marshall-rpclit/WEB-INF/web.xml 2012-04-16 08:35:02 UTC (rev 16164)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxrpc/marshall-rpclit/WEB-INF/web.xml 2012-04-16 13:52:43 UTC (rev 16165)
@@ -5,12 +5,7 @@
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
- <context-param>
- <param-name>jbossws-config-name</param-name>
- <param-value>Standard Endpoint</param-value>
- </context-param>
-
- <servlet>
+ <servlet>
<servlet-name>StandardTypes</servlet-name>
<servlet-class>org.jboss.test.ws.jaxrpc.marshall.StandardTypesBean</servlet-class>
</servlet>
Modified: stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxrpc/outparam/WEB-INF/web.xml
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxrpc/outparam/WEB-INF/web.xml 2012-04-16 08:35:02 UTC (rev 16164)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/resources/jaxrpc/outparam/WEB-INF/web.xml 2012-04-16 13:52:43 UTC (rev 16165)
@@ -5,11 +5,6 @@
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
- <context-param>
- <param-name>jbossws-config-name</param-name>
- <param-value>Standard Endpoint</param-value>
- </context-param>
-
<servlet>
<servlet-name>OutParamTestService</servlet-name>
<servlet-class>org.jboss.test.ws.jaxrpc.outparam.OutParamTestServiceBean</servlet-class>
12 years, 8 months
JBossWS SVN: r16164 - stack/cxf/trunk.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2012-04-16 04:35:02 -0400 (Mon, 16 Apr 2012)
New Revision: 16164
Modified:
stack/cxf/trunk/pom.xml
Log:
[JBWS-3448] Upgrade to Apache CXF 2.5.3
Modified: stack/cxf/trunk/pom.xml
===================================================================
--- stack/cxf/trunk/pom.xml 2012-04-16 08:18:41 UTC (rev 16163)
+++ stack/cxf/trunk/pom.xml 2012-04-16 08:35:02 UTC (rev 16164)
@@ -72,7 +72,7 @@
<jboss711.version>7.1.1.Final</jboss711.version>
<jboss712.version>7.1.2.Final-SNAPSHOT</jboss712.version>
<ejb.api.version>1.0.1.Final</ejb.api.version>
- <cxf.version>2.5.3-SNAPSHOT</cxf.version>
+ <cxf.version>2.5.3</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, 8 months
JBossWS SVN: r16163 - in container/jboss71/branches: jbossws-jboss711/src/main/java/org/jboss/as/webservices/tests and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2012-04-16 04:18:41 -0400 (Mon, 16 Apr 2012)
New Revision: 16163
Modified:
container/jboss71/branches/jbossws-jboss710/src/main/java/org/jboss/as/webservices/tests/RemoteDeployer.java
container/jboss71/branches/jbossws-jboss711/src/main/java/org/jboss/as/webservices/tests/RemoteDeployer.java
Log:
[JBWS-3482] Prevent RemoteDeployer from messing up tests result by failing to undeploy archives which previously failed to deploy
Modified: container/jboss71/branches/jbossws-jboss710/src/main/java/org/jboss/as/webservices/tests/RemoteDeployer.java
===================================================================
--- container/jboss71/branches/jbossws-jboss710/src/main/java/org/jboss/as/webservices/tests/RemoteDeployer.java 2012-04-16 08:16:12 UTC (rev 16162)
+++ container/jboss71/branches/jbossws-jboss710/src/main/java/org/jboss/as/webservices/tests/RemoteDeployer.java 2012-04-16 08:18:41 UTC (rev 16163)
@@ -123,12 +123,17 @@
public void undeploy(final URL archiveURL) throws Exception {
synchronized (archiveCounters) {
String k = archiveURL.toString();
- int count = archiveCounters.get(k);
- if (count > 1) {
- archiveCounters.put(k, (count - 1));
+ if (archiveCounters.containsKey(k)) {
+ int count = archiveCounters.get(k);
+ if (count > 1) {
+ archiveCounters.put(k, (count - 1));
+ return;
+ } else {
+ archiveCounters.remove(k);
+ }
+ } else {
+ LOGGER.warn("Trying to undeploy archive " + archiveURL + " which is not currently deployed!");
return;
- } else {
- archiveCounters.remove(k);
}
final DeploymentPlanBuilder builder = deploymentManager.newDeploymentPlan();
Modified: container/jboss71/branches/jbossws-jboss711/src/main/java/org/jboss/as/webservices/tests/RemoteDeployer.java
===================================================================
--- container/jboss71/branches/jbossws-jboss711/src/main/java/org/jboss/as/webservices/tests/RemoteDeployer.java 2012-04-16 08:16:12 UTC (rev 16162)
+++ container/jboss71/branches/jbossws-jboss711/src/main/java/org/jboss/as/webservices/tests/RemoteDeployer.java 2012-04-16 08:18:41 UTC (rev 16163)
@@ -137,12 +137,17 @@
public void undeploy(final URL archiveURL) throws Exception {
synchronized (archiveCounters) {
String k = archiveURL.toString();
- int count = archiveCounters.get(k);
- if (count > 1) {
- archiveCounters.put(k, (count - 1));
+ if (archiveCounters.containsKey(k)) {
+ int count = archiveCounters.get(k);
+ if (count > 1) {
+ archiveCounters.put(k, (count - 1));
+ return;
+ } else {
+ archiveCounters.remove(k);
+ }
+ } else {
+ LOGGER.warn("Trying to undeploy archive " + archiveURL + " which is not currently deployed!");
return;
- } else {
- archiveCounters.remove(k);
}
final DeploymentPlanBuilder builder = deploymentManager.newDeploymentPlan();
12 years, 8 months
JBossWS SVN: r16162 - container/jboss70/branches/jbossws-jboss702/src/main/java/org/jboss/as/webservices/tests.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2012-04-16 04:16:12 -0400 (Mon, 16 Apr 2012)
New Revision: 16162
Modified:
container/jboss70/branches/jbossws-jboss702/src/main/java/org/jboss/as/webservices/tests/RemoteDeployer.java
Log:
[JBWS-3482] Prevent RemoteDeployer from messing up tests result by failing to undeploy archives which previously failed to deploy
Modified: container/jboss70/branches/jbossws-jboss702/src/main/java/org/jboss/as/webservices/tests/RemoteDeployer.java
===================================================================
--- container/jboss70/branches/jbossws-jboss702/src/main/java/org/jboss/as/webservices/tests/RemoteDeployer.java 2012-04-13 13:17:26 UTC (rev 16161)
+++ container/jboss70/branches/jbossws-jboss702/src/main/java/org/jboss/as/webservices/tests/RemoteDeployer.java 2012-04-16 08:16:12 UTC (rev 16162)
@@ -95,12 +95,17 @@
public void undeploy(final URL archiveURL) throws Exception {
synchronized (archiveCounters) {
String k = archiveURL.toString();
- int count = archiveCounters.get(k);
- if (count > 1) {
- archiveCounters.put(k, (count - 1));
+ if (archiveCounters.containsKey(k)) {
+ int count = archiveCounters.get(k);
+ if (count > 1) {
+ archiveCounters.put(k, (count - 1));
+ return;
+ } else {
+ archiveCounters.remove(k);
+ }
+ } else {
+ LOGGER.warn("Trying to undeploy archive " + archiveURL + " which is not currently deployed!");
return;
- } else {
- archiveCounters.remove(k);
}
final DeploymentPlanBuilder builder = deploymentManager.newDeploymentPlan();
12 years, 8 months
JBossWS SVN: r16161 - in stack/cxf/trunk/modules/resources/src/main/resources/modules/jboss700/org: apache/ws/security/main and 2 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2012-04-13 09:17:26 -0400 (Fri, 13 Apr 2012)
New Revision: 16161
Added:
stack/cxf/trunk/modules/resources/src/main/resources/modules/jboss700/org/opensaml/
stack/cxf/trunk/modules/resources/src/main/resources/modules/jboss700/org/opensaml/main/
stack/cxf/trunk/modules/resources/src/main/resources/modules/jboss700/org/opensaml/main/module.xml
Modified:
stack/cxf/trunk/modules/resources/src/main/resources/modules/jboss700/org/apache/ws/security/main/module.xml
Log:
[JBWS-3448][JBWS-3434] Adding opensaml module for jboss 7.0.x too as CXF-4212 is making opensaml a mandatory dependency in CXF 2.5.3
Modified: stack/cxf/trunk/modules/resources/src/main/resources/modules/jboss700/org/apache/ws/security/main/module.xml
===================================================================
--- stack/cxf/trunk/modules/resources/src/main/resources/modules/jboss700/org/apache/ws/security/main/module.xml 2012-04-13 11:54:57 UTC (rev 16160)
+++ stack/cxf/trunk/modules/resources/src/main/resources/modules/jboss700/org/apache/ws/security/main/module.xml 2012-04-13 13:17:26 UTC (rev 16161)
@@ -34,5 +34,10 @@
<module name="org.apache.commons.logging" />
<module name="org.apache.santuario.xmlsec" />
<module name="org.apache.xalan" />
+ <!--
+ Optional dependency on OpenSAML which is used by Apache WSS4J for providing WS-Trust / SAML functionalities;
+ the export="true" flag can be replaced by having additional org.opensaml dependency in org.apache.cxf module.
+ -->
+ <module name="org.opensaml" optional="true" export="true" />
</dependencies>
</module>
\ No newline at end of file
Added: stack/cxf/trunk/modules/resources/src/main/resources/modules/jboss700/org/opensaml/main/module.xml
===================================================================
--- stack/cxf/trunk/modules/resources/src/main/resources/modules/jboss700/org/opensaml/main/module.xml (rev 0)
+++ stack/cxf/trunk/modules/resources/src/main/resources/modules/jboss700/org/opensaml/main/module.xml 2012-04-13 13:17:26 UTC (rev 16161)
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ ~ JBoss, Home of Professional Open Source.
+ ~ Copyright 2012, Red Hat, Inc., 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.
+ -->
+
+<module xmlns="urn:jboss:module:1.0" name="org.opensaml">
+
+ <resources>
+ <!-- Insert resources here -->
+ </resources>
+
+ <dependencies>
+ <module name="javax.api"/>
+ <module name="org.slf4j"/>
+ <module name="org.apache.santuario.xmlsec"/>
+ </dependencies>
+</module>
12 years, 8 months
JBossWS SVN: r16160 - in stack/native/trunk/modules: core/src/main/java/org/jboss/ws/core/binding and 13 other directories.
by jbossws-commits@lists.jboss.org
Author: ropalka
Date: 2012-04-13 07:54:57 -0400 (Fri, 13 Apr 2012)
New Revision: 16160
Added:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/utils/XMLFragment.java
Removed:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/UnboundHeader.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/XMLFragment.java
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/MessageTrace.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/binding/AbstractDeserializerFactory.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/binding/AbstractSerializerFactory.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/binding/DeserializerSupport.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/binding/SerializerSupport.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/EncodedTypeMapping.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/LiteralTypeMapping.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/SOAPFaultHelperJAXRPC.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/TypeMappingRegistryImpl.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPArraySerializer.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/SimpleSerializer.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/JBossXBMarshallerImpl.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/client/ServiceFactoryImpl.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/DOMContent.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/EnvelopeBuilderDOM.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/Message.properties
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/ObjectContent.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPContentAccess.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPContentElement.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/XMLContent.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/utils/Message.properties
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/utils/SOAPUtils.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/utils/SAAJUtils.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/OperationMetaData.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/DOMTypes.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSElementDeclaration.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSModel.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSModelGroup.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSParticle.java
stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/WSDLFilePublisher.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/common/binding/SOAPBindingTestCase.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/common/soap/SOAPContentElementTestCase.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/common/soap/XMLFragmentTestCase.java
Log:
[JBWS-3486] slim down native SAAJ impl. dependencies (WIP)
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java 2012-04-13 10:58:22 UTC (rev 16159)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java 2012-04-13 11:54:57 UTC (rev 16160)
@@ -52,7 +52,6 @@
import org.jboss.ws.common.JavaUtils;
import org.jboss.ws.core.binding.BindingException;
import org.jboss.ws.core.jaxrpc.ParameterWrapping;
-import org.jboss.ws.core.soap.NameImpl;
import org.jboss.ws.core.soap.SOAPBodyElementDoc;
import org.jboss.ws.core.soap.SOAPBodyElementRpc;
import org.jboss.ws.core.soap.SOAPBodyImpl;
@@ -92,7 +91,6 @@
/** A constant representing the identity of the SOAP 1.2 over HTTP binding. */
public static final String SOAP12HTTP_BINDING = "http://www.w3.org/2003/05/soap/bindings/HTTP/";
/** The SOAP encoded Array name */
- private static final Name SOAP_ARRAY_NAME = new NameImpl("Array", Constants.PREFIX_SOAP11_ENC, Constants.URI_SOAP11_ENC);
public CommonSOAPBinding()
{
@@ -141,7 +139,7 @@
if (style == Style.RPC)
{
QName opQName = opMetaData.getQName();
- Name opName = new NameImpl(namespaceRegistry.registerQName(opQName));
+ Name opName = SOAPUtils.newName(namespaceRegistry.registerQName(opQName), soapEnvelope);
if (debugEnabled)
log.debug("Create RPC body element: " + opName);
@@ -172,7 +170,7 @@
else
{
SOAPElement soapElement = paramMetaData.isInHeader() ? (SOAPElement)soapHeader : soapBodyElement;
- addParameterToMessage(paramMetaData, value, soapElement);
+ addParameterToMessage(paramMetaData, value, soapElement, soapEnvelope);
}
}
@@ -264,7 +262,7 @@
if (!isHeader)
numParameters++;
- SOAPContentElement value = getParameterFromMessage(paramMetaData, element, false);
+ SOAPContentElement value = getParameterFromMessage(paramMetaData, element, false, soapEnvelope);
epInv.setRequestParamValue(xmlName, value);
}
}
@@ -339,8 +337,7 @@
if (style == Style.RPC)
{
QName opQName = opMetaData.getResponseName();
-
- Name opName = new NameImpl(namespaceRegistry.registerQName(opQName));
+ Name opName = SOAPUtils.newName(namespaceRegistry.registerQName(opQName), soapEnvelope);
soapBodyElement = new SOAPBodyElementRpc(opName);
soapBodyElement = (SOAPBodyElement)soapBody.addChildElement(soapBodyElement);
@@ -371,7 +368,7 @@
}
else
{
- SOAPContentElement soapElement = addParameterToMessage(retMetaData, value, soapBodyElement);
+ SOAPContentElement soapElement = addParameterToMessage(retMetaData, value, soapBodyElement, soapEnvelope);
epInv.setReturnValue(soapElement);
soapElement.setObjectValue(value);
}
@@ -391,11 +388,11 @@
{
if (paramMetaData.isInHeader())
{
- addParameterToMessage(paramMetaData, value, soapHeader);
+ addParameterToMessage(paramMetaData, value, soapHeader, soapEnvelope);
}
else
{
- addParameterToMessage(paramMetaData, value, soapBodyElement);
+ addParameterToMessage(paramMetaData, value, soapBodyElement, soapEnvelope);
}
}
}
@@ -468,7 +465,7 @@
}
else
{
- SOAPContentElement value = getParameterFromMessage(retMetaData, soapElement, false);
+ SOAPContentElement value = getParameterFromMessage(retMetaData, soapElement, false, soapEnvelope);
epInv.setReturnValue(value);
}
}
@@ -484,7 +481,7 @@
else
{
SOAPElement element = paramMetaData.isInHeader() ? soapHeader : soapElement;
- SOAPContentElement value = getParameterFromMessage(paramMetaData, element, false);
+ SOAPContentElement value = getParameterFromMessage(paramMetaData, element, false, soapEnvelope);
epInv.setResponseParamValue(xmlName, value);
}
}
@@ -594,7 +591,7 @@
}
/** Marshall the given parameter and add it to the SOAPMessage */
- private SOAPContentElement addParameterToMessage(ParameterMetaData paramMetaData, Object value, SOAPElement soapElement) throws SOAPException, BindingException
+ private SOAPContentElement addParameterToMessage(ParameterMetaData paramMetaData, Object value, SOAPElement soapElement, SOAPEnvelope soapEnvelope) throws SOAPException, BindingException
{
QName xmlName = paramMetaData.getXmlName();
Class javaType = paramMetaData.getJavaType();
@@ -614,7 +611,7 @@
xmlName = namespaceRegistry.registerQName(xmlName);
}
- Name soapName = new NameImpl(xmlName.getLocalPart(), xmlName.getPrefix(), xmlName.getNamespaceURI());
+ Name soapName = SOAPUtils.newName(xmlName, soapEnvelope);
SOAPContentElement contentElement;
if (soapElement instanceof SOAPHeader)
@@ -651,9 +648,11 @@
}
/** Unmarshall a message element and add it to the parameter list */
- private SOAPContentElement getParameterFromMessage(ParameterMetaData paramMetaData, SOAPElement soapElement, boolean optional) throws BindingException
+ private SOAPContentElement getParameterFromMessage(ParameterMetaData paramMetaData, SOAPElement soapElement, boolean optional, SOAPEnvelope soapEnvelope) throws BindingException, SOAPException
{
- Name xmlName = new NameImpl(paramMetaData.getXmlName());
+ QName soapArrayQName = new QName(Constants.URI_SOAP11_ENC, "Array", Constants.PREFIX_SOAP11_ENC);
+ Name SOAP_ARRAY_NAME = SOAPUtils.newName(soapArrayQName, soapEnvelope);
+ Name xmlName = SOAPUtils.newName(paramMetaData.getXmlName(), soapEnvelope);
SOAPContentElement soapContentElement = null;
Iterator childElements = soapElement.getChildElements();
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/MessageTrace.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/MessageTrace.java 2012-04-13 10:58:22 UTC (rev 16159)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/MessageTrace.java 2012-04-13 11:54:57 UTC (rev 16160)
@@ -32,8 +32,8 @@
import org.jboss.logging.Logger;
import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.DOMWriter;
-import org.jboss.ws.core.soap.XMLFragment;
import org.jboss.ws.core.soap.utils.SOAPElementWriter;
+import org.jboss.ws.core.soap.utils.XMLFragment;
import org.w3c.dom.Element;
/**
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/binding/AbstractDeserializerFactory.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/binding/AbstractDeserializerFactory.java 2012-04-13 10:58:22 UTC (rev 16159)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/binding/AbstractDeserializerFactory.java 2012-04-13 11:54:57 UTC (rev 16160)
@@ -26,8 +26,6 @@
import javax.xml.rpc.encoding.Deserializer;
import javax.xml.rpc.encoding.DeserializerFactory;
-import org.jboss.util.NotImplementedException;
-
/**
* @author Thomas.Diesler(a)jboss.org
* @since 04-Dec-2004
@@ -38,11 +36,11 @@
public Deserializer getDeserializerAs(String mechanismType)
{
- throw new NotImplementedException();
+ throw new UnsupportedOperationException();
}
public Iterator getSupportedMechanismTypes()
{
- throw new NotImplementedException();
+ throw new UnsupportedOperationException();
}
}
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/binding/AbstractSerializerFactory.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/binding/AbstractSerializerFactory.java 2012-04-13 10:58:22 UTC (rev 16159)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/binding/AbstractSerializerFactory.java 2012-04-13 11:54:57 UTC (rev 16160)
@@ -26,8 +26,6 @@
import javax.xml.rpc.encoding.Serializer;
import javax.xml.rpc.encoding.SerializerFactory;
-import org.jboss.util.NotImplementedException;
-
/**
* @author Thomas.Diesler(a)jboss.org
* @since 04-Dec-2004
@@ -38,11 +36,11 @@
public Serializer getSerializerAs(String mechanismType)
{
- throw new NotImplementedException();
+ throw new UnsupportedOperationException();
}
public Iterator getSupportedMechanismTypes()
{
- throw new NotImplementedException();
+ throw new UnsupportedOperationException();
}
}
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/binding/DeserializerSupport.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/binding/DeserializerSupport.java 2012-04-13 10:58:22 UTC (rev 16159)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/binding/DeserializerSupport.java 2012-04-13 11:54:57 UTC (rev 16160)
@@ -29,7 +29,6 @@
import javax.xml.transform.dom.DOMSource;
import org.jboss.logging.Logger;
-import org.jboss.util.NotImplementedException;
import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.DOMUtils;
import org.jboss.ws.common.DOMWriter;
@@ -118,6 +117,6 @@
public String getMechanismType()
{
- throw new NotImplementedException();
+ throw new UnsupportedOperationException();
}
}
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/binding/SerializerSupport.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/binding/SerializerSupport.java 2012-04-13 10:58:22 UTC (rev 16159)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/binding/SerializerSupport.java 2012-04-13 11:54:57 UTC (rev 16160)
@@ -29,7 +29,6 @@
import javax.xml.rpc.encoding.Serializer;
import javax.xml.transform.Result;
-import org.jboss.util.NotImplementedException;
import org.jboss.ws.common.Constants;
import org.jboss.ws.common.Normalizer;
import org.jboss.ws.core.soap.SOAPContentElement;
@@ -150,7 +149,7 @@
public String getMechanismType()
{
- throw new NotImplementedException();
+ throw new UnsupportedOperationException();
}
}
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/EncodedTypeMapping.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/EncodedTypeMapping.java 2012-04-13 10:58:22 UTC (rev 16159)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/EncodedTypeMapping.java 2012-04-13 11:54:57 UTC (rev 16160)
@@ -30,7 +30,6 @@
import javax.xml.namespace.QName;
import javax.xml.soap.SOAPElement;
-import org.jboss.util.NotImplementedException;
import org.jboss.ws.common.Constants;
import org.jboss.ws.core.binding.TypeMappingImpl;
import org.jboss.ws.core.jaxrpc.binding.Base64DeserializerFactory;
@@ -180,6 +179,6 @@
*/
public void setSupportedEncodings(String[] encodingStyleURIs)
{
- throw new NotImplementedException();
+ throw new UnsupportedOperationException();
}
}
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/LiteralTypeMapping.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/LiteralTypeMapping.java 2012-04-13 10:58:22 UTC (rev 16159)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/LiteralTypeMapping.java 2012-04-13 11:54:57 UTC (rev 16160)
@@ -21,12 +21,10 @@
*/
package org.jboss.ws.core.jaxrpc;
-
import javax.activation.DataHandler;
import javax.mail.internet.MimeMultipart;
import javax.xml.soap.SOAPElement;
-import org.jboss.util.NotImplementedException;
import org.jboss.ws.common.Constants;
import org.jboss.ws.core.binding.TypeMappingImpl;
import org.jboss.ws.core.jaxrpc.binding.ElementDeserializerFactory;
@@ -93,6 +91,6 @@
*/
public void setSupportedEncodings(String[] encodingStyleURIs)
{
- throw new NotImplementedException();
+ throw new UnsupportedOperationException();
}
}
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/SOAPFaultHelperJAXRPC.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/SOAPFaultHelperJAXRPC.java 2012-04-13 10:58:22 UTC (rev 16159)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/SOAPFaultHelperJAXRPC.java 2012-04-13 11:54:57 UTC (rev 16160)
@@ -58,10 +58,9 @@
import org.jboss.ws.core.binding.DeserializerSupport;
import org.jboss.ws.core.binding.SerializationContext;
import org.jboss.ws.core.binding.SerializerSupport;
-import org.jboss.ws.core.soap.NameImpl;
-import org.jboss.ws.core.soap.XMLFragment;
import org.jboss.ws.core.soap.utils.MessageContextAssociation;
import org.jboss.ws.core.soap.utils.SOAPUtils;
+import org.jboss.ws.core.soap.utils.XMLFragment;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.metadata.umdm.FaultMetaData;
import org.jboss.ws.metadata.umdm.OperationMetaData;
@@ -101,7 +100,8 @@
/** Factory method for FaultException for a given SOAPFault */
public static SOAPFaultException getSOAPFaultException(SOAPFault soapFault)
{
- QName faultCode = ((NameImpl)soapFault.getFaultCodeAsName()).toQName();
+ Name faultCodeName = soapFault.getFaultCodeAsName();
+ QName faultCode = new QName(faultCodeName.getURI(), faultCodeName.getLocalName(), faultCodeName.getPrefix());
String faultString = soapFault.getFaultString();
String faultActor = soapFault.getFaultActor();
Detail detail = soapFault.getDetail();
@@ -248,7 +248,8 @@
faultCode = nsRegistry.registerQName(faultCode);
String faultString = getValidFaultString(faultEx);
- SOAPFault soapFault = soapBody.addFault(new NameImpl(faultCode), faultString);
+ Name faultCodeName = SOAPUtils.newName(faultCode, soapEnvelope);
+ SOAPFault soapFault = soapBody.addFault(faultCodeName, faultString);
String faultActor = faultEx.getFaultActor();
if (faultActor != null)
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/TypeMappingRegistryImpl.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/TypeMappingRegistryImpl.java 2012-04-13 10:58:22 UTC (rev 16159)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/TypeMappingRegistryImpl.java 2012-04-13 11:54:57 UTC (rev 16160)
@@ -29,7 +29,6 @@
import javax.xml.rpc.encoding.TypeMapping;
import javax.xml.rpc.encoding.TypeMappingRegistry;
-import org.jboss.util.NotImplementedException;
import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.Constants;
import org.jboss.ws.core.binding.TypeMappingImpl;
@@ -83,7 +82,7 @@
*/
public void registerDefault(TypeMapping mapping)
{
- throw new NotImplementedException();
+ throw new UnsupportedOperationException();
}
/**
@@ -92,7 +91,7 @@
*/
public TypeMapping createTypeMapping()
{
- throw new NotImplementedException();
+ throw new UnsupportedOperationException();
}
/**
@@ -128,7 +127,7 @@
*/
public TypeMapping register(String encodingStyleURI, TypeMapping mapping)
{
- throw new NotImplementedException();
+ throw new UnsupportedOperationException();
}
/**
@@ -139,7 +138,7 @@
*/
public TypeMapping unregisterTypeMapping(String encodingStyleURI)
{
- throw new NotImplementedException();
+ throw new UnsupportedOperationException();
}
/**
@@ -154,7 +153,7 @@
*/
public boolean removeTypeMapping(TypeMapping mapping)
{
- throw new NotImplementedException();
+ throw new UnsupportedOperationException();
}
/** Assert the literal encoding style */
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPArraySerializer.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPArraySerializer.java 2012-04-13 10:58:22 UTC (rev 16159)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPArraySerializer.java 2012-04-13 11:54:57 UTC (rev 16160)
@@ -36,9 +36,8 @@
import org.jboss.ws.core.binding.SerializationContext;
import org.jboss.ws.core.binding.SerializerSupport;
import org.jboss.ws.core.binding.TypeMappingImpl;
-import org.jboss.ws.core.soap.NameImpl;
import org.jboss.ws.core.soap.SOAPContentElement;
-import org.jboss.ws.core.soap.XMLFragment;
+import org.jboss.ws.core.soap.utils.XMLFragment;
import org.jboss.ws.metadata.umdm.ParameterMetaData;
import org.jboss.ws.util.xml.BufferedStreamResult;
import org.w3c.dom.NamedNodeMap;
@@ -124,7 +123,7 @@
if (JavaUtils.isPrimitive(value.getClass()))
value = JavaUtils.getWrapperValueArray(value);
- String nodeName = new NameImpl(compXmlName).getQualifiedName();
+ String nodeName = getQualifiedName(compXmlName);
buffer = new StringBuilder("<" + nodeName + " xmlns:" + Constants.PREFIX_SOAP11_ENC + "='" + Constants.URI_SOAP11_ENC + "' ");
@@ -171,6 +170,15 @@
}
}
+ private String getQualifiedName(QName qname)
+ {
+ String prefix = qname.getPrefix();
+ if (prefix.length() > 0)
+ return prefix + ":" + qname.getLocalPart();
+ else
+ return qname.getLocalPart();
+ }
+
private void serializeArrayComponents(QName xmlName, QName xmlType, SerializationContext serContext, Object[] objArr) throws BindingException
{
for (Object compValue : objArr)
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/SimpleSerializer.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/SimpleSerializer.java 2012-04-13 10:58:22 UTC (rev 16159)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/SimpleSerializer.java 2012-04-13 11:54:57 UTC (rev 16160)
@@ -25,7 +25,6 @@
import javax.xml.transform.Result;
import org.jboss.logging.Logger;
-import org.jboss.util.NotImplementedException;
import org.jboss.ws.core.binding.BindingException;
import org.jboss.ws.core.binding.SerializationContext;
import org.jboss.ws.core.binding.SerializerSupport;
@@ -61,7 +60,7 @@
if ("base64Binary".equals(typeName))
{
- throw new NotImplementedException();
+ throw new UnsupportedOperationException();
}
else
{
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/JBossXBMarshallerImpl.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/JBossXBMarshallerImpl.java 2012-04-13 10:58:22 UTC (rev 16159)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/JBossXBMarshallerImpl.java 2012-04-13 11:54:57 UTC (rev 16160)
@@ -30,7 +30,6 @@
import javax.xml.namespace.QName;
import org.jboss.logging.Logger;
-import org.jboss.util.NotImplementedException;
import org.jboss.ws.WSException;
import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.JavaUtils;
@@ -159,7 +158,7 @@
*/
public void marshal(Object obj, ContentHandler handler)
{
- throw new NotImplementedException();
+ throw new UnsupportedOperationException();
}
/**
@@ -167,7 +166,7 @@
*/
public void marshal(Object obj, Node node)
{
- throw new NotImplementedException();
+ throw new UnsupportedOperationException();
}
/**
@@ -208,7 +207,7 @@
*/
public Node getNode(Object contentTree)
{
- throw new NotImplementedException();
+ throw new UnsupportedOperationException();
}
/**
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/client/ServiceFactoryImpl.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/client/ServiceFactoryImpl.java 2012-04-13 10:58:22 UTC (rev 16159)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/client/ServiceFactoryImpl.java 2012-04-13 11:54:57 UTC (rev 16160)
@@ -30,7 +30,6 @@
import javax.xml.rpc.ServiceFactory;
import org.jboss.logging.Logger;
-import org.jboss.util.NotImplementedException;
/**
* Service class acts as a factory for:
@@ -58,7 +57,7 @@
*/
public Service loadService(Class serviceInterface) throws ServiceException
{
- throw new NotImplementedException();
+ throw new UnsupportedOperationException();
}
/**
@@ -75,7 +74,7 @@
*/
public Service loadService(URL wsdlDocumentLocation, Class serviceInterface, Properties props) throws ServiceException
{
- throw new NotImplementedException();
+ throw new UnsupportedOperationException();
}
/**
@@ -92,7 +91,7 @@
*/
public Service loadService(URL wsdlDocumentLocation, QName serviceName, Properties props) throws ServiceException
{
- throw new NotImplementedException();
+ throw new UnsupportedOperationException();
}
/**
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/DOMContent.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/DOMContent.java 2012-04-13 10:58:22 UTC (rev 16159)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/DOMContent.java 2012-04-13 11:54:57 UTC (rev 16160)
@@ -23,11 +23,11 @@
import java.util.ResourceBundle;
-import javax.xml.transform.Source;
import javax.xml.transform.dom.DOMSource;
import org.jboss.logging.Logger;
import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.core.soap.utils.XMLFragment;
/**
* Represents the DOM_VALID state of an {@link SOAPContentElement}.<br>
@@ -40,8 +40,6 @@
private static final ResourceBundle bundle = BundleUtils.getBundle(DOMContent.class);
private static Logger log = Logger.getLogger(DOMContent.class);
- private Source payload;
-
protected DOMContent(SOAPContentElement container)
{
super(container);
@@ -91,19 +89,6 @@
return next;
}
- public Source getPayload()
- {
- return new DOMSource(container);
- }
-
- public void setPayload(Source source)
- {
- if (!(source instanceof DOMSource))
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "DOMSOURCE_EXPECTED", source));
-
- this.payload = source;
- }
-
public XMLFragment getXMLFragment()
{
throw new IllegalStateException(BundleUtils.getMessage(bundle, "XMLFRAGMENT_NOT_AVAILABLE"));
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/EnvelopeBuilderDOM.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/EnvelopeBuilderDOM.java 2012-04-13 10:58:22 UTC (rev 16159)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/EnvelopeBuilderDOM.java 2012-04-13 11:54:57 UTC (rev 16160)
@@ -45,6 +45,7 @@
import org.jboss.ws.common.DOMUtils;
import org.jboss.ws.core.CommonSOAPFaultException;
import org.jboss.ws.core.soap.utils.Style;
+import org.jboss.ws.core.soap.utils.XMLFragment;
import org.w3c.dom.Comment;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/Message.properties
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/Message.properties 2012-04-13 10:58:22 UTC (rev 16159)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/Message.properties 2012-04-13 11:54:57 UTC (rev 16160)
@@ -71,11 +71,6 @@
NO_HTTP_RESONSE_CODE=No HTTP resonse code, assuming: SC_OK
INVALID_HTTP_SERVER_RESPONSE=Invalid HTTP server response [{0}] - {1}
CANNOT_UNMARSHALL_SOAPMESSAGE=Cannot unmarshall SOAPMessage
-UNSUPPORTED_RESULT_TYPE=Unsupported result type: {0}
-STREAMSOURCE_ALREADY_EXHAUSTED=StreamSource already exhausted
-CANNOT_FIND_END_INSTRUCTION=Cannot find end of XML processing instruction
-UNSUPPORTED_SOURCE_TYPE=Unsupported source type: {0}
-STREAMSOURCE_WAS_PREVIOUSLY_ACCESSED=StreamSource was previously accessed from
FAULTCODE_MUST_BE_NS_QUALIFIED=Fault code '{0}' must be namespace qualified
NOT_SUPPORT_SUBCODE=SOAP 1.1 Fault does not support the concept of Subcode
SUBCODE_MUST_BE_NAMESPACE_QUALIFIED=subcode must be namespace qualified: {0}
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/ObjectContent.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/ObjectContent.java 2012-04-13 10:58:22 UTC (rev 16159)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/ObjectContent.java 2012-04-13 11:54:57 UTC (rev 16160)
@@ -26,7 +26,6 @@
import javax.xml.namespace.QName;
import javax.xml.transform.Result;
-import javax.xml.transform.Source;
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
@@ -40,6 +39,7 @@
import org.jboss.ws.core.binding.TypeMappingImpl;
import org.jboss.ws.core.jaxrpc.binding.NullValueSerializer;
import org.jboss.ws.core.soap.utils.MessageContextAssociation;
+import org.jboss.ws.core.soap.utils.XMLFragment;
import org.jboss.ws.metadata.umdm.OperationMetaData;
import org.jboss.ws.metadata.umdm.ParameterMetaData;
@@ -101,16 +101,6 @@
return next;
}
- public Source getPayload()
- {
- throw new IllegalStateException(BundleUtils.getMessage(bundle, "PAYLOAD_NOT_AVAILABLE"));
- }
-
- public void setPayload(Source source)
- {
- throw new IllegalStateException(BundleUtils.getMessage(bundle, "PAYLOAD_CANNOT_BE_SET_ON_OBJECT_CONTENT"));
- }
-
public XMLFragment getXMLFragment()
{
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPContentAccess.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPContentAccess.java 2012-04-13 10:58:22 UTC (rev 16159)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPContentAccess.java 2012-04-13 11:54:57 UTC (rev 16160)
@@ -21,7 +21,7 @@
*/
package org.jboss.ws.core.soap;
-import javax.xml.transform.Source;
+import org.jboss.ws.core.soap.utils.XMLFragment;
/**
* @author Heiko.Braun(a)jboss.org
@@ -29,8 +29,6 @@
*/
public interface SOAPContentAccess
{
- Source getPayload();
-
XMLFragment getXMLFragment();
void setXMLFragment(XMLFragment xmlFragment);
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPContentElement.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPContentElement.java 2012-04-13 10:58:22 UTC (rev 16159)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPContentElement.java 2012-04-13 11:54:57 UTC (rev 16160)
@@ -30,7 +30,6 @@
import javax.xml.soap.Name;
import javax.xml.soap.SOAPElement;
import javax.xml.soap.SOAPException;
-import javax.xml.transform.Source;
import org.jboss.logging.Logger;
import org.jboss.ws.api.util.BundleUtils;
@@ -39,6 +38,7 @@
import org.jboss.ws.core.CommonMessageContext;
import org.jboss.ws.core.soap.SOAPContent.State;
import org.jboss.ws.core.soap.utils.MessageContextAssociation;
+import org.jboss.ws.core.soap.utils.XMLFragment;
import org.jboss.ws.metadata.umdm.ParameterMetaData;
import org.w3c.dom.Attr;
import org.w3c.dom.DOMException;
@@ -151,14 +151,6 @@
/** Get the payload as source.
*/
- public Source getPayload()
- {
- if (soapContent.getState() == State.OBJECT_VALID)
- transitionTo(State.DOM_VALID);
-
- return soapContent.getPayload();
- }
-
public XMLFragment getXMLFragment()
{
transitionTo(State.XML_VALID);
Deleted: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/UnboundHeader.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/UnboundHeader.java 2012-04-13 10:58:22 UTC (rev 16159)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/UnboundHeader.java 2012-04-13 11:54:57 UTC (rev 16160)
@@ -1,98 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.core.soap;
-
-import javax.xml.namespace.QName;
-import javax.xml.rpc.ParameterMode;
-
-import org.jboss.ws.metadata.umdm.OperationMetaData;
-import org.jboss.ws.metadata.umdm.ParameterMetaData;
-
-/**
- * Represents an unbound SOAPHeaderElement
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 04-Jan-2005
- */
-public class UnboundHeader
-{
- private QName xmlName;
- private QName xmlType;
- private Class javaType;
- private ParameterMode mode;
- private Object headerValue;
-
- public UnboundHeader(QName xmlName, QName xmlType, Class javaType, ParameterMode mode)
- {
- this.xmlName = xmlName;
- this.xmlType = xmlType;
- this.javaType = javaType;
- this.mode = mode;
- }
-
- public QName getXmlName()
- {
- return xmlName;
- }
-
- public QName getXmlType()
- {
- return xmlType;
- }
-
- public Class getJavaType()
- {
- return javaType;
- }
-
- public ParameterMode getMode()
- {
- return mode;
- }
-
- public Object getHeaderValue()
- {
- return headerValue;
- }
-
- public void setHeaderValue(Object headerValue)
- {
- this.headerValue = headerValue;
- }
-
- public ParameterMetaData toParameterMetaData(OperationMetaData opMetaData)
- {
- ParameterMetaData paramMetaData = new ParameterMetaData(opMetaData, xmlName, xmlType, javaType.getName());
- paramMetaData.setInHeader(true);
- return paramMetaData;
- }
-
- public String toString()
- {
- StringBuilder buffer = new StringBuilder("\nUnboundHeader:");
- buffer.append("\n xmlName=" + getXmlName());
- buffer.append("\n xmlType=" + getXmlType());
- buffer.append("\n javaType=" + getJavaType().getName());
- buffer.append("\n mode=" + getMode());
- return buffer.toString();
- }
-}
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/XMLContent.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/XMLContent.java 2012-04-13 10:58:22 UTC (rev 16159)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/XMLContent.java 2012-04-13 11:54:57 UTC (rev 16160)
@@ -28,7 +28,6 @@
import javax.xml.namespace.QName;
import javax.xml.soap.SOAPElement;
import javax.xml.soap.SOAPException;
-import javax.xml.transform.Source;
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
@@ -42,6 +41,7 @@
import org.jboss.ws.core.binding.SerializationContext;
import org.jboss.ws.core.binding.TypeMappingImpl;
import org.jboss.ws.core.soap.utils.MessageContextAssociation;
+import org.jboss.ws.core.soap.utils.XMLFragment;
import org.jboss.ws.metadata.umdm.OperationMetaData;
import org.jboss.ws.metadata.umdm.ParameterMetaData;
import org.w3c.dom.Comment;
@@ -111,16 +111,6 @@
return next;
}
- public Source getPayload()
- {
- return xmlFragment.getSource();
- }
-
- public void setPayload(Source source)
- {
- xmlFragment = new XMLFragment(source);
- }
-
public XMLFragment getXMLFragment()
{
return xmlFragment;
Deleted: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/XMLFragment.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/XMLFragment.java 2012-04-13 10:58:22 UTC (rev 16159)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/XMLFragment.java 2012-04-13 11:54:57 UTC (rev 16160)
@@ -1,288 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.core.soap;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.OutputStream;
-import java.io.PrintWriter;
-import java.io.Reader;
-import java.io.StringWriter;
-import java.io.Writer;
-import java.util.ResourceBundle;
-
-import javax.xml.transform.Result;
-import javax.xml.transform.Source;
-import javax.xml.transform.dom.DOMResult;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.sax.SAXSource;
-import javax.xml.transform.stream.StreamSource;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.WSException;
-import org.jboss.ws.api.util.BundleUtils;
-import org.jboss.ws.common.DOMUtils;
-import org.jboss.ws.common.DOMWriter;
-import org.jboss.ws.util.xml.BufferedStreamResult;
-import org.jboss.ws.util.xml.BufferedStreamSource;
-import org.w3c.dom.Element;
-
-/**
- * A XMLFragment represent an XML {@link Source}.
- *
- * The basic idea is that any {@link SOAPContentElement} XML_VALID state
- * (either before unmarshalling or after marshalling) is represented through a single interface.<br>
- *
- * @see SOAPContentElement
- * @see XMLContent
- *
- * @author Heiko.Braun(a)jboss.org
- * @author Thomas.Diesler(a)jboss.org
- * @since 05-Feb-2007
- */
-public class XMLFragment
-{
- private static final ResourceBundle bundle = BundleUtils.getBundle(XMLFragment.class);
- // provide logging
- private static Logger log = Logger.getLogger(XMLFragment.class);
-
- private Source source;
-
- private final static String XML_PROC = "<?xml";
-
- // An exception that is created when a client
- // accesses a StreamSource that can only be read once
- private RuntimeException streamSourceAccessMarker;
-
- public XMLFragment(Source source)
- {
- this.source = source;
- }
-
- public XMLFragment(String xmlString)
- {
- source = new BufferedStreamSource(xmlString.getBytes());
- }
-
- public XMLFragment(Result result)
- {
- if (result instanceof DOMResult)
- {
- DOMResult domResult = (DOMResult)result;
- source = new DOMSource(domResult.getNode());
- }
- else if (result instanceof BufferedStreamResult)
- {
- BufferedStreamResult br = (BufferedStreamResult)result;
- ByteArrayOutputStream baos = (ByteArrayOutputStream)br.getOutputStream();
- source = new BufferedStreamSource(baos.toByteArray());
- }
- else
- {
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "UNSUPPORTED_RESULT_TYPE", result));
- }
- }
-
- public Source getSource()
- {
- source = beginSourceAccess(source);
- endSourceAccess();
- return source;
- }
-
- /** Transform the Source to an XML string
- */
- public String toXMLString()
- {
- try
- {
- StringWriter strWriter = new StringWriter(1024);
- writeSourceInternal(strWriter);
- return strWriter.toString();
- }
- catch (IOException ex)
- {
- throw new WSException(ex);
- }
- }
-
- /** Transform the Source to an Element
- */
- public Element toElement()
- {
- Element retElement = null;
- try
- {
- source = beginSourceAccess(source);
- retElement = DOMUtils.sourceToElement(source);
- endSourceAccess();
- }
- catch (IOException ex)
- {
- handleSourceAccessException(ex);
- }
- return retElement;
- }
-
- public void writeTo(Writer writer) throws IOException
- {
- writeSourceInternal(writer);
- }
-
- public void writeTo(OutputStream out) throws IOException
- {
- PrintWriter printWriter = new PrintWriter(out);
- writeSourceInternal(printWriter);
- printWriter.flush();
- printWriter.close();
- }
-
- /**
- * Should only be called with <code>jbossws.SOAPMessage==TRACE</code>
- */
- private void writeSourceInternal(Writer writer) throws IOException
- {
- try
- {
- source = beginSourceAccess(source);
-
- if (source instanceof DOMSource)
- {
- DOMSource domSource = (DOMSource)source;
- new DOMWriter(writer).print(domSource.getNode());
- }
- else if (source instanceof StreamSource || source instanceof SAXSource)
- {
- StreamSource streamSource = (StreamSource)source;
- boolean newReader = false;
-
- Reader reader = streamSource.getReader();
- InputStream is = streamSource.getInputStream();
- {
- if (reader == null)
- {
- if (is != null)
- {
- reader = new InputStreamReader(is, "UTF-8");
- newReader = true;
- }
- else return;
- }
- }
-
- char[] cbuf = new char[1024];
- int len = reader.read(cbuf);
- int off = 0;
-
- if (len == -1)
- throw new IOException(BundleUtils.getMessage(bundle, "STREAMSOURCE_ALREADY_EXHAUSTED"));
-
- // Remove XML processing instruction
- String xmlProc = new String(cbuf, 0, XML_PROC.length());
- if (XML_PROC.equals(xmlProc))
- {
- off = XML_PROC.length();
- while (cbuf[off] != '>' && off < len)
- off++;
-
- if (cbuf[off] != '>')
- throw new IllegalStateException(BundleUtils.getMessage(bundle, "CANNOT_FIND_END_INSTRUCTION"));
-
- off++;
- len -= off;
- }
-
- while (len > 0)
- {
- writer.write(cbuf, off, len);
- len = reader.read(cbuf);
- off = 0;
- }
-
- if (newReader)
- reader.close();
- }
- else
- {
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "UNSUPPORTED_SOURCE_TYPE", source));
- }
-
- endSourceAccess();
- }
- catch (IOException ex)
- {
- handleSourceAccessException(ex);
- }
- }
-
- private Source beginSourceAccess(Source source)
- {
- // no need to buffer those
- if (source instanceof BufferedStreamSource || source instanceof DOMSource)
- return source;
-
- // Buffer the source content
- if (source instanceof StreamSource)
- {
- source = new BufferedStreamSource((StreamSource)source);
- }
- else
- {
- try
- {
- Element element = DOMUtils.sourceToElement(source);
- source = element != null ? new DOMSource(element) : new DOMSource();
- }
- catch (IOException ex)
- {
- WSException.rethrow(ex);
- }
- }
-
- return source;
- }
-
- private void endSourceAccess()
- {
- // Create the marker exception
- if (source instanceof StreamSource)
- {
- streamSourceAccessMarker = new RuntimeException();
- }
- }
-
- private void handleSourceAccessException(IOException ex)
- {
- if (source instanceof StreamSource && streamSourceAccessMarker != null)
- {
- log.error(BundleUtils.getMessage(bundle, "STREAMSOURCE_WAS_PREVIOUSLY_ACCESSED"), streamSourceAccessMarker);
- }
- WSException.rethrow(ex);
- }
-
- public String toString()
- {
- return "[source=" + source + "]";
- }
-}
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/utils/Message.properties
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/utils/Message.properties 2012-04-13 10:58:22 UTC (rev 16159)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/utils/Message.properties 2012-04-13 11:54:57 UTC (rev 16160)
@@ -1,2 +1,7 @@
UNSUPPORTED_ENCODING_STYLE=Unsupported encoding style: {0}
UNSUPPORTED_STYLE=Unsupported style: {0}
+UNSUPPORTED_RESULT_TYPE=Unsupported result type: {0}
+STREAMSOURCE_ALREADY_EXHAUSTED=StreamSource already exhausted
+CANNOT_FIND_END_INSTRUCTION=Cannot find end of XML processing instruction
+UNSUPPORTED_SOURCE_TYPE=Unsupported source type: {0}
+STREAMSOURCE_WAS_PREVIOUSLY_ACCESSED=StreamSource was previously accessed from
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/utils/SOAPUtils.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/utils/SOAPUtils.java 2012-04-13 10:58:22 UTC (rev 16159)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/utils/SOAPUtils.java 2012-04-13 11:54:57 UTC (rev 16160)
@@ -21,7 +21,10 @@
*/
package org.jboss.ws.core.soap.utils;
+import javax.xml.namespace.QName;
+import javax.xml.soap.Name;
import javax.xml.soap.SOAPConstants;
+import javax.xml.soap.SOAPEnvelope;
import javax.xml.soap.SOAPException;
import javax.xml.soap.MessageFactory;
import javax.xml.soap.SOAPFactory;
@@ -84,4 +87,7 @@
return false;
}
+ public static Name newName(final QName faultCode, final SOAPEnvelope soapEnvelope) throws SOAPException {
+ return soapEnvelope.createName(faultCode.getLocalPart(), faultCode.getPrefix(), faultCode.getNamespaceURI());
+ }
}
Added: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/utils/XMLFragment.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/utils/XMLFragment.java (rev 0)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/utils/XMLFragment.java 2012-04-13 11:54:57 UTC (rev 16160)
@@ -0,0 +1,288 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.core.soap.utils;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.io.PrintWriter;
+import java.io.Reader;
+import java.io.StringWriter;
+import java.io.Writer;
+import java.util.ResourceBundle;
+
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+import javax.xml.transform.dom.DOMResult;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.sax.SAXSource;
+import javax.xml.transform.stream.StreamSource;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.WSException;
+import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.common.DOMUtils;
+import org.jboss.ws.common.DOMWriter;
+import org.jboss.ws.util.xml.BufferedStreamResult;
+import org.jboss.ws.util.xml.BufferedStreamSource;
+import org.w3c.dom.Element;
+
+/**
+ * A XMLFragment represent an XML {@link Source}.
+ *
+ * The basic idea is that any {@link SOAPContentElement} XML_VALID state
+ * (either before unmarshalling or after marshalling) is represented through a single interface.<br>
+ *
+ * @see SOAPContentElement
+ * @see XMLContent
+ *
+ * @author Heiko.Braun(a)jboss.org
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 05-Feb-2007
+ */
+public class XMLFragment
+{
+ private static final ResourceBundle bundle = BundleUtils.getBundle(XMLFragment.class);
+ // provide logging
+ private static Logger log = Logger.getLogger(XMLFragment.class);
+
+ private Source source;
+
+ private final static String XML_PROC = "<?xml";
+
+ // An exception that is created when a client
+ // accesses a StreamSource that can only be read once
+ private RuntimeException streamSourceAccessMarker;
+
+ public XMLFragment(Source source)
+ {
+ this.source = source;
+ }
+
+ public XMLFragment(String xmlString)
+ {
+ source = new BufferedStreamSource(xmlString.getBytes());
+ }
+
+ public XMLFragment(Result result)
+ {
+ if (result instanceof DOMResult)
+ {
+ DOMResult domResult = (DOMResult)result;
+ source = new DOMSource(domResult.getNode());
+ }
+ else if (result instanceof BufferedStreamResult)
+ {
+ BufferedStreamResult br = (BufferedStreamResult)result;
+ ByteArrayOutputStream baos = (ByteArrayOutputStream)br.getOutputStream();
+ source = new BufferedStreamSource(baos.toByteArray());
+ }
+ else
+ {
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "UNSUPPORTED_RESULT_TYPE", result));
+ }
+ }
+
+ public Source getSource()
+ {
+ source = beginSourceAccess(source);
+ endSourceAccess();
+ return source;
+ }
+
+ /** Transform the Source to an XML string
+ */
+ public String toXMLString()
+ {
+ try
+ {
+ StringWriter strWriter = new StringWriter(1024);
+ writeSourceInternal(strWriter);
+ return strWriter.toString();
+ }
+ catch (IOException ex)
+ {
+ throw new WSException(ex);
+ }
+ }
+
+ /** Transform the Source to an Element
+ */
+ public Element toElement()
+ {
+ Element retElement = null;
+ try
+ {
+ source = beginSourceAccess(source);
+ retElement = DOMUtils.sourceToElement(source);
+ endSourceAccess();
+ }
+ catch (IOException ex)
+ {
+ handleSourceAccessException(ex);
+ }
+ return retElement;
+ }
+
+ public void writeTo(Writer writer) throws IOException
+ {
+ writeSourceInternal(writer);
+ }
+
+ public void writeTo(OutputStream out) throws IOException
+ {
+ PrintWriter printWriter = new PrintWriter(out);
+ writeSourceInternal(printWriter);
+ printWriter.flush();
+ printWriter.close();
+ }
+
+ /**
+ * Should only be called with <code>jbossws.SOAPMessage==TRACE</code>
+ */
+ private void writeSourceInternal(Writer writer) throws IOException
+ {
+ try
+ {
+ source = beginSourceAccess(source);
+
+ if (source instanceof DOMSource)
+ {
+ DOMSource domSource = (DOMSource)source;
+ new DOMWriter(writer).print(domSource.getNode());
+ }
+ else if (source instanceof StreamSource || source instanceof SAXSource)
+ {
+ StreamSource streamSource = (StreamSource)source;
+ boolean newReader = false;
+
+ Reader reader = streamSource.getReader();
+ InputStream is = streamSource.getInputStream();
+ {
+ if (reader == null)
+ {
+ if (is != null)
+ {
+ reader = new InputStreamReader(is, "UTF-8");
+ newReader = true;
+ }
+ else return;
+ }
+ }
+
+ char[] cbuf = new char[1024];
+ int len = reader.read(cbuf);
+ int off = 0;
+
+ if (len == -1)
+ throw new IOException(BundleUtils.getMessage(bundle, "STREAMSOURCE_ALREADY_EXHAUSTED"));
+
+ // Remove XML processing instruction
+ String xmlProc = new String(cbuf, 0, XML_PROC.length());
+ if (XML_PROC.equals(xmlProc))
+ {
+ off = XML_PROC.length();
+ while (cbuf[off] != '>' && off < len)
+ off++;
+
+ if (cbuf[off] != '>')
+ throw new IllegalStateException(BundleUtils.getMessage(bundle, "CANNOT_FIND_END_INSTRUCTION"));
+
+ off++;
+ len -= off;
+ }
+
+ while (len > 0)
+ {
+ writer.write(cbuf, off, len);
+ len = reader.read(cbuf);
+ off = 0;
+ }
+
+ if (newReader)
+ reader.close();
+ }
+ else
+ {
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "UNSUPPORTED_SOURCE_TYPE", source));
+ }
+
+ endSourceAccess();
+ }
+ catch (IOException ex)
+ {
+ handleSourceAccessException(ex);
+ }
+ }
+
+ private Source beginSourceAccess(Source source)
+ {
+ // no need to buffer those
+ if (source instanceof BufferedStreamSource || source instanceof DOMSource)
+ return source;
+
+ // Buffer the source content
+ if (source instanceof StreamSource)
+ {
+ source = new BufferedStreamSource((StreamSource)source);
+ }
+ else
+ {
+ try
+ {
+ Element element = DOMUtils.sourceToElement(source);
+ source = element != null ? new DOMSource(element) : new DOMSource();
+ }
+ catch (IOException ex)
+ {
+ WSException.rethrow(ex);
+ }
+ }
+
+ return source;
+ }
+
+ private void endSourceAccess()
+ {
+ // Create the marker exception
+ if (source instanceof StreamSource)
+ {
+ streamSourceAccessMarker = new RuntimeException();
+ }
+ }
+
+ private void handleSourceAccessException(IOException ex)
+ {
+ if (source instanceof StreamSource && streamSourceAccessMarker != null)
+ {
+ log.error(BundleUtils.getMessage(bundle, "STREAMSOURCE_WAS_PREVIOUSLY_ACCESSED"), streamSourceAccessMarker);
+ }
+ WSException.rethrow(ex);
+ }
+
+ public String toString()
+ {
+ return "[source=" + source + "]";
+ }
+}
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/utils/SAAJUtils.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/utils/SAAJUtils.java 2012-04-13 10:58:22 UTC (rev 16159)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/utils/SAAJUtils.java 2012-04-13 11:54:57 UTC (rev 16160)
@@ -80,7 +80,7 @@
* @param nsURI the URI of the namespace to search for
* @return the prefix of the namespace or <code>null</code> if not found
*/
- public static String getNamespacePrefix(SOAPElement element, String nsURI)
+ private static String getNamespacePrefix(SOAPElement element, String nsURI)
{
Iterator it = element.getVisibleNamespacePrefixes();
while (it.hasNext())
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/OperationMetaData.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/OperationMetaData.java 2012-04-13 10:58:22 UTC (rev 16159)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/OperationMetaData.java 2012-04-13 11:54:57 UTC (rev 16160)
@@ -32,7 +32,6 @@
import javax.xml.rpc.ParameterMode;
import org.jboss.logging.Logger;
-import org.jboss.util.NotImplementedException;
import org.jboss.ws.WSException;
import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.JavaUtils;
@@ -413,8 +412,7 @@
public void eagerInitialize()
{
- // Call eagerInitialize(List<Method> unsynchronizedMethods) instead
- throw new NotImplementedException();
+ throw new UnsupportedOperationException();
}
/**
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/DOMTypes.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/DOMTypes.java 2012-04-13 10:58:22 UTC (rev 16159)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/DOMTypes.java 2012-04-13 11:54:57 UTC (rev 16160)
@@ -23,7 +23,6 @@
import javax.xml.namespace.QName;
-import org.jboss.util.NotImplementedException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
@@ -56,6 +55,6 @@
public QName getXMLType(QName name)
{
- throw new NotImplementedException();
+ throw new UnsupportedOperationException();
}
}
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSElementDeclaration.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSElementDeclaration.java 2012-04-13 10:58:22 UTC (rev 16159)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSElementDeclaration.java 2012-04-13 11:54:57 UTC (rev 16160)
@@ -32,7 +32,6 @@
import org.apache.xerces.xs.XSNamedMap;
import org.apache.xerces.xs.XSObjectList;
import org.apache.xerces.xs.XSTypeDefinition;
-import org.jboss.util.NotImplementedException;
import org.jboss.ws.api.util.BundleUtils;
/**
@@ -243,6 +242,6 @@
public XSObjectList getAnnotations()
{
- throw new NotImplementedException();
+ throw new UnsupportedOperationException();
}
}
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSModel.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSModel.java 2012-04-13 10:58:22 UTC (rev 16159)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSModel.java 2012-04-13 11:54:57 UTC (rev 16160)
@@ -55,7 +55,6 @@
import org.apache.xerces.xs.XSTerm;
import org.apache.xerces.xs.XSTypeDefinition;
import org.jboss.logging.Logger;
-import org.jboss.util.NotImplementedException;
import org.jboss.ws.WSException;
import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.Constants;
@@ -754,6 +753,6 @@
public XSObjectList getSubstitutionGroup(XSElementDeclaration arg0)
{
- throw new NotImplementedException();
+ throw new UnsupportedOperationException();
}
}
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSModelGroup.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSModelGroup.java 2012-04-13 10:58:22 UTC (rev 16159)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSModelGroup.java 2012-04-13 11:54:57 UTC (rev 16160)
@@ -28,7 +28,6 @@
import org.apache.xerces.xs.XSConstants;
import org.apache.xerces.xs.XSModelGroup;
import org.apache.xerces.xs.XSObjectList;
-import org.jboss.util.NotImplementedException;
/**
* Implements a ModelGroup of the Xerces Schema API
@@ -109,6 +108,6 @@
public XSObjectList getAnnotations()
{
- throw new NotImplementedException();
+ throw new UnsupportedOperationException();
}
}
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSParticle.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSParticle.java 2012-04-13 10:58:22 UTC (rev 16159)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/wsdl/xmlschema/JBossXSParticle.java 2012-04-13 11:54:57 UTC (rev 16160)
@@ -25,7 +25,6 @@
import org.apache.xerces.xs.XSObjectList;
import org.apache.xerces.xs.XSParticle;
import org.apache.xerces.xs.XSTerm;
-import org.jboss.util.NotImplementedException;
/**
* @author <mailto:Anil.Saldhana@jboss.org>Anil Saldhana
@@ -137,6 +136,6 @@
public XSObjectList getAnnotations()
{
- throw new NotImplementedException();
+ throw new UnsupportedOperationException();
}
}
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/WSDLFilePublisher.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/WSDLFilePublisher.java 2012-04-13 10:58:22 UTC (rev 16159)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/WSDLFilePublisher.java 2012-04-13 11:54:57 UTC (rev 16160)
@@ -33,7 +33,6 @@
import javax.wsdl.Definition;
import org.jboss.logging.Logger;
-import org.jboss.util.NotImplementedException;
import org.jboss.ws.WSException;
import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.Constants;
@@ -107,7 +106,7 @@
}
else
{
- throw new NotImplementedException(BundleUtils.getMessage(bundle, "NOT_SUPPORTED_WSDL20"));
+ throw new UnsupportedOperationException(BundleUtils.getMessage(bundle, "NOT_SUPPORTED_WSDL20"));
}
}
catch (RuntimeException rte)
Modified: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/common/binding/SOAPBindingTestCase.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/common/binding/SOAPBindingTestCase.java 2012-04-13 10:58:22 UTC (rev 16159)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/common/binding/SOAPBindingTestCase.java 2012-04-13 11:54:57 UTC (rev 16160)
@@ -23,8 +23,6 @@
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
-import java.util.HashMap;
-import java.util.Map;
import javax.xml.namespace.QName;
import javax.xml.rpc.ParameterMode;
@@ -44,7 +42,6 @@
import org.jboss.ws.core.jaxrpc.handler.SOAPMessageContextJAXRPC;
import org.jboss.ws.core.soap.MessageFactoryImpl;
import org.jboss.ws.core.soap.SOAPMessageImpl;
-import org.jboss.ws.core.soap.UnboundHeader;
import org.jboss.ws.core.soap.utils.MessageContextAssociation;
import org.jboss.ws.metadata.umdm.OperationMetaData;
import org.jboss.ws.metadata.umdm.ParameterMetaData;
Modified: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/common/soap/SOAPContentElementTestCase.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/common/soap/SOAPContentElementTestCase.java 2012-04-13 10:58:22 UTC (rev 16159)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/common/soap/SOAPContentElementTestCase.java 2012-04-13 11:54:57 UTC (rev 16160)
@@ -37,8 +37,8 @@
import org.jboss.ws.core.soap.SOAPBodyImpl;
import org.jboss.ws.core.soap.SOAPContentElement;
import org.jboss.ws.core.soap.SOAPElementImpl;
-import org.jboss.ws.core.soap.XMLFragment;
import org.jboss.ws.core.soap.utils.Style;
+import org.jboss.ws.core.soap.utils.XMLFragment;
import org.jboss.wsf.test.JBossWSTest;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
Modified: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/common/soap/XMLFragmentTestCase.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/common/soap/XMLFragmentTestCase.java 2012-04-13 10:58:22 UTC (rev 16159)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/common/soap/XMLFragmentTestCase.java 2012-04-13 11:54:57 UTC (rev 16160)
@@ -22,7 +22,8 @@
package org.jboss.test.ws.common.soap;
import junit.framework.TestCase;
-import org.jboss.ws.core.soap.XMLFragment;
+
+import org.jboss.ws.core.soap.utils.XMLFragment;
import org.jboss.ws.common.DOMUtils;
import org.jboss.ws.common.DOMWriter;
import org.w3c.dom.Element;
12 years, 8 months
JBossWS SVN: r16158 - in stack/cxf/trunk/modules/testsuite: cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jms and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2012-04-13 06:56:55 -0400 (Fri, 13 Apr 2012)
New Revision: 16158
Added:
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jms/JMSEndpointAPITestCaseForked.java
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jms/JMSEndpointOnlyDeploymentTestCaseForked.java
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jms_http/JMSHTTPEndpointDeploymentTestCaseForked.java
Removed:
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jms/JMSEndpointAPITestCase.java
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jms/JMSEndpointOnlyDeploymentTestCase.java
stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jms_http/JMSHTTPEndpointDeploymentTestCase.java
Modified:
stack/cxf/trunk/modules/testsuite/pom.xml
Log:
[JBWS-3482] Moving soap-over-jms tests to forked test group as they all rely on the same queue, which seems to be able to cause deadlocks in case of concurrent execution
Deleted: stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jms/JMSEndpointAPITestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jms/JMSEndpointAPITestCase.java 2012-04-13 03:51:36 UTC (rev 16157)
+++ stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jms/JMSEndpointAPITestCase.java 2012-04-13 10:56:55 UTC (rev 16158)
@@ -1,53 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2012, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.ws.jaxws.cxf.jms;
-
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
-import java.net.URL;
-
-import junit.framework.Test;
-
-import org.jboss.wsf.test.JBossWSCXFTestSetup;
-import org.jboss.wsf.test.JBossWSTest;
-
-/**
- * Test case for publishing a JMS (SOAP-over-JMS 1.0) endpoint through API
- *
- * @author alessio.soldano(a)jboss.com
- * @since 29-Apr-2011
- */
-public final class JMSEndpointAPITestCase extends JBossWSTest
-{
- public static Test suite()
- {
- return new JBossWSCXFTestSetup(JMSEndpointAPITestCase.class, "jaxws-cxf-jms-api-as7.war");
- }
-
- public void testServerSide() throws Exception
- {
- URL url = new URL("http://" + getServerHost() + ":8080/jaxws-cxf-jms-api-as7");
- BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
- assertEquals("true", br.readLine());
- }
-
-}
Added: stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jms/JMSEndpointAPITestCaseForked.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jms/JMSEndpointAPITestCaseForked.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jms/JMSEndpointAPITestCaseForked.java 2012-04-13 10:56:55 UTC (rev 16158)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.cxf.jms;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.net.URL;
+
+import junit.framework.Test;
+
+import org.jboss.wsf.test.JBossWSCXFTestSetup;
+import org.jboss.wsf.test.JBossWSTest;
+
+/**
+ * Test case for publishing a JMS (SOAP-over-JMS 1.0) endpoint through API
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 29-Apr-2011
+ */
+public final class JMSEndpointAPITestCaseForked extends JBossWSTest
+{
+ public static Test suite()
+ {
+ return new JBossWSCXFTestSetup(JMSEndpointAPITestCaseForked.class, "jaxws-cxf-jms-api-as7.war");
+ }
+
+ public void testServerSide() throws Exception
+ {
+ URL url = new URL("http://" + getServerHost() + ":8080/jaxws-cxf-jms-api-as7");
+ BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
+ assertEquals("true", br.readLine());
+ }
+
+}
Deleted: stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jms/JMSEndpointOnlyDeploymentTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jms/JMSEndpointOnlyDeploymentTestCase.java 2012-04-13 03:51:36 UTC (rev 16157)
+++ stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jms/JMSEndpointOnlyDeploymentTestCase.java 2012-04-13 10:56:55 UTC (rev 16158)
@@ -1,207 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2012, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.ws.jaxws.cxf.jms;
-
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
-import java.net.URL;
-import java.util.Properties;
-
-import javax.jms.Message;
-import javax.jms.MessageListener;
-import javax.jms.Queue;
-import javax.jms.QueueConnection;
-import javax.jms.QueueConnectionFactory;
-import javax.jms.QueueReceiver;
-import javax.jms.QueueSender;
-import javax.jms.QueueSession;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.xml.namespace.QName;
-import javax.xml.ws.Service;
-
-import junit.framework.Test;
-
-import org.apache.cxf.frontend.ClientProxy;
-import org.apache.cxf.transport.jms.JMSConduit;
-import org.apache.cxf.transport.jms.JNDIConfiguration;
-import org.jboss.ws.common.DOMUtils;
-import org.jboss.wsf.test.JBossWSCXFTestSetup;
-import org.jboss.wsf.test.JBossWSTest;
-import org.jboss.wsf.test.JBossWSTestHelper;
-
-/**
- * Test case for deploying an archive with a JMS (SOAP-over-JMS 1.0) endpoint only
- *
- * @author alessio.soldano(a)jboss.com
- * @since 10-Jun-2011
- */
-public class JMSEndpointOnlyDeploymentTestCase extends JBossWSTest
-{
- private static boolean waitForResponse;
-
- public static Test suite()
- {
- return new JBossWSCXFTestSetup(JMSEndpointOnlyDeploymentTestCase.class, "jaxws-cxf-jms-only-deployment-test-servlet.war,jaxws-cxf-jms-only-deployment.jar");
- }
-
- public void testJMSEndpointServerSide() throws Exception
- {
- URL url = new URL("http://" + getServerHost() + ":8080/jaxws-cxf-jms-only-deployment-test-servlet");
- BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
- assertEquals("true", br.readLine());
- }
-
- public void testJMSEndpointClientSide() throws Exception
- {
- if (isTargetJBoss70()) {
- System.out.println("FIXME: can't lookup remote ConnectionFactory, remote JNDI binding not available yet on AS 7.0.x");
- return;
- }
- URL wsdlUrl = getResourceURL("jaxws/cxf/jms/META-INF-as7/wsdl/HelloWorldService.wsdl");
- QName serviceName = new QName("http://org.jboss.ws/jaxws/cxf/jms", "HelloWorldService");
-
- Service service = Service.create(wsdlUrl, serviceName);
- HelloWorld proxy = (HelloWorld) service.getPort(new QName("http://org.jboss.ws/jaxws/cxf/jms", "HelloWorldImplPort"), HelloWorld.class);
- setupProxy(proxy);
- try {
- assertEquals("Hi", proxy.echo("Hi"));
- } catch (Exception e) {
- rethrowAndHandleAuthWarning(e);
- }
- }
-
- public void testMessagingClient() throws Exception
- {
- if (isTargetJBoss70()) {
- System.out.println("FIXME: can't lookup remote ConnectionFactory, remote JNDI binding not available yet on AS 7.0.x");
- return;
- }
-
- String reqMessage =
- "<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">" +
- " <soap:Body>" +
- " <ns2:echo xmlns:ns2=\"http://org.jboss.ws/jaxws/cxf/jms\">" +
- " <arg0>Hi</arg0>" +
- " </ns2:echo>" +
- " </soap:Body>" +
- "</soap:Envelope>";
-
- String resMessage =
- "<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">" +
- " <soap:Body>" +
- " <ns2:echoResponse xmlns:ns2=\"http://org.jboss.ws/jaxws/cxf/jms\">" +
- " <return>Hi</return>" +
- " </ns2:echoResponse>" +
- " </soap:Body>" +
- "</soap:Envelope>";
-
- Properties env = new Properties();
- env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");
- env.put(Context.PROVIDER_URL, "remote://" + getServerHost() + ":4447");
- env.put(Context.SECURITY_PRINCIPAL, JBossWSTestHelper.getTestUsername());
- env.put(Context.SECURITY_CREDENTIALS, JBossWSTestHelper.getTestPassword());
- InitialContext context = null;
- try {
- context = new InitialContext(env);
- } catch (Exception e) {
- rethrowAndHandleAuthWarning(e);
- }
- QueueConnectionFactory connectionFactory = (QueueConnectionFactory)context.lookup("jms/RemoteConnectionFactory");
- Queue reqQueue = (Queue)context.lookup("jms/queue/test");
- Queue resQueue = (Queue)context.lookup("jms/queue/test");
-
- QueueConnection con = connectionFactory.createQueueConnection(JBossWSTestHelper.getTestUsername(), JBossWSTestHelper.getTestPassword());
- QueueSession session = con.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
- QueueReceiver receiver = session.createReceiver(resQueue);
- ResponseListener responseListener = new ResponseListener();
- receiver.setMessageListener(responseListener);
- con.start();
-
- TextMessage message = session.createTextMessage(reqMessage);
- message.setJMSReplyTo(resQueue);
- message.setStringProperty("SOAPJMS_contentType", "text/xml");
- message.setStringProperty("SOAPJMS_requestURI", "jms:queue:testQueue");
-
- waitForResponse = true;
-
- QueueSender sender = session.createSender(reqQueue);
- sender.send(message);
- sender.close();
-
- int timeout = 30000;
- while (waitForResponse && timeout > 0)
- {
- Thread.sleep(100);
- timeout -= 100;
- }
-
- assertNotNull("Expected response message", responseListener.resMessage);
- assertEquals(DOMUtils.parse(resMessage), DOMUtils.parse(responseListener.resMessage));
-
- sender.close();
- receiver.close();
- con.stop();
- session.close();
- con.close();
- }
-
- public static class ResponseListener implements MessageListener
- {
- public String resMessage;
-
- public void onMessage(Message msg)
- {
- TextMessage textMessage = (TextMessage)msg;
- try
- {
- resMessage = textMessage.getText();
- waitForResponse = false;
- }
- catch (Throwable t)
- {
- t.printStackTrace();
- }
- }
- }
-
- private void setupProxy(HelloWorld proxy) {
- JMSConduit conduit = (JMSConduit)ClientProxy.getClient(proxy).getConduit();
- JNDIConfiguration jndiConfig = conduit.getJmsConfig().getJndiConfig();
- jndiConfig.setConnectionUserName(JBossWSTestHelper.getTestUsername());
- jndiConfig.setConnectionPassword(JBossWSTestHelper.getTestPassword());
- Properties props = conduit.getJmsConfig().getJndiTemplate().getEnvironment();
- props.put(Context.SECURITY_PRINCIPAL, JBossWSTestHelper.getTestUsername());
- props.put(Context.SECURITY_CREDENTIALS, JBossWSTestHelper.getTestPassword());
- }
-
- private static void rethrowAndHandleAuthWarning(Exception e) throws Exception {
- final String msg = "Authentication failed";
- if (e.getMessage().contains(msg) || e.getCause().getMessage().contains(msg)) {
- System.out.println("This test requires an user with 'guest' role to be available on the application server; " +
- "please ensure that then specify user and password using -Dtest.username=\"foo\" -Dtest.password=\"bar\".");
- }
- throw e;
- }
-}
Added: stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jms/JMSEndpointOnlyDeploymentTestCaseForked.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jms/JMSEndpointOnlyDeploymentTestCaseForked.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jms/JMSEndpointOnlyDeploymentTestCaseForked.java 2012-04-13 10:56:55 UTC (rev 16158)
@@ -0,0 +1,207 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.cxf.jms;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.net.URL;
+import java.util.Properties;
+
+import javax.jms.Message;
+import javax.jms.MessageListener;
+import javax.jms.Queue;
+import javax.jms.QueueConnection;
+import javax.jms.QueueConnectionFactory;
+import javax.jms.QueueReceiver;
+import javax.jms.QueueSender;
+import javax.jms.QueueSession;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+
+import junit.framework.Test;
+
+import org.apache.cxf.frontend.ClientProxy;
+import org.apache.cxf.transport.jms.JMSConduit;
+import org.apache.cxf.transport.jms.JNDIConfiguration;
+import org.jboss.ws.common.DOMUtils;
+import org.jboss.wsf.test.JBossWSCXFTestSetup;
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestHelper;
+
+/**
+ * Test case for deploying an archive with a JMS (SOAP-over-JMS 1.0) endpoint only
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 10-Jun-2011
+ */
+public class JMSEndpointOnlyDeploymentTestCaseForked extends JBossWSTest
+{
+ private static boolean waitForResponse;
+
+ public static Test suite()
+ {
+ return new JBossWSCXFTestSetup(JMSEndpointOnlyDeploymentTestCaseForked.class, "jaxws-cxf-jms-only-deployment-test-servlet.war,jaxws-cxf-jms-only-deployment.jar");
+ }
+
+ public void testJMSEndpointServerSide() throws Exception
+ {
+ URL url = new URL("http://" + getServerHost() + ":8080/jaxws-cxf-jms-only-deployment-test-servlet");
+ BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
+ assertEquals("true", br.readLine());
+ }
+
+ public void testJMSEndpointClientSide() throws Exception
+ {
+ if (isTargetJBoss70()) {
+ System.out.println("FIXME: can't lookup remote ConnectionFactory, remote JNDI binding not available yet on AS 7.0.x");
+ return;
+ }
+ URL wsdlUrl = getResourceURL("jaxws/cxf/jms/META-INF-as7/wsdl/HelloWorldService.wsdl");
+ QName serviceName = new QName("http://org.jboss.ws/jaxws/cxf/jms", "HelloWorldService");
+
+ Service service = Service.create(wsdlUrl, serviceName);
+ HelloWorld proxy = (HelloWorld) service.getPort(new QName("http://org.jboss.ws/jaxws/cxf/jms", "HelloWorldImplPort"), HelloWorld.class);
+ setupProxy(proxy);
+ try {
+ assertEquals("Hi", proxy.echo("Hi"));
+ } catch (Exception e) {
+ rethrowAndHandleAuthWarning(e);
+ }
+ }
+
+ public void testMessagingClient() throws Exception
+ {
+ if (isTargetJBoss70()) {
+ System.out.println("FIXME: can't lookup remote ConnectionFactory, remote JNDI binding not available yet on AS 7.0.x");
+ return;
+ }
+
+ String reqMessage =
+ "<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">" +
+ " <soap:Body>" +
+ " <ns2:echo xmlns:ns2=\"http://org.jboss.ws/jaxws/cxf/jms\">" +
+ " <arg0>Hi</arg0>" +
+ " </ns2:echo>" +
+ " </soap:Body>" +
+ "</soap:Envelope>";
+
+ String resMessage =
+ "<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">" +
+ " <soap:Body>" +
+ " <ns2:echoResponse xmlns:ns2=\"http://org.jboss.ws/jaxws/cxf/jms\">" +
+ " <return>Hi</return>" +
+ " </ns2:echoResponse>" +
+ " </soap:Body>" +
+ "</soap:Envelope>";
+
+ Properties env = new Properties();
+ env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");
+ env.put(Context.PROVIDER_URL, "remote://" + getServerHost() + ":4447");
+ env.put(Context.SECURITY_PRINCIPAL, JBossWSTestHelper.getTestUsername());
+ env.put(Context.SECURITY_CREDENTIALS, JBossWSTestHelper.getTestPassword());
+ InitialContext context = null;
+ try {
+ context = new InitialContext(env);
+ } catch (Exception e) {
+ rethrowAndHandleAuthWarning(e);
+ }
+ QueueConnectionFactory connectionFactory = (QueueConnectionFactory)context.lookup("jms/RemoteConnectionFactory");
+ Queue reqQueue = (Queue)context.lookup("jms/queue/test");
+ Queue resQueue = (Queue)context.lookup("jms/queue/test");
+
+ QueueConnection con = connectionFactory.createQueueConnection(JBossWSTestHelper.getTestUsername(), JBossWSTestHelper.getTestPassword());
+ QueueSession session = con.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
+ QueueReceiver receiver = session.createReceiver(resQueue);
+ ResponseListener responseListener = new ResponseListener();
+ receiver.setMessageListener(responseListener);
+ con.start();
+
+ TextMessage message = session.createTextMessage(reqMessage);
+ message.setJMSReplyTo(resQueue);
+ message.setStringProperty("SOAPJMS_contentType", "text/xml");
+ message.setStringProperty("SOAPJMS_requestURI", "jms:queue:testQueue");
+
+ waitForResponse = true;
+
+ QueueSender sender = session.createSender(reqQueue);
+ sender.send(message);
+ sender.close();
+
+ int timeout = 30000;
+ while (waitForResponse && timeout > 0)
+ {
+ Thread.sleep(100);
+ timeout -= 100;
+ }
+
+ assertNotNull("Expected response message", responseListener.resMessage);
+ assertEquals(DOMUtils.parse(resMessage), DOMUtils.parse(responseListener.resMessage));
+
+ sender.close();
+ receiver.close();
+ con.stop();
+ session.close();
+ con.close();
+ }
+
+ public static class ResponseListener implements MessageListener
+ {
+ public String resMessage;
+
+ public void onMessage(Message msg)
+ {
+ TextMessage textMessage = (TextMessage)msg;
+ try
+ {
+ resMessage = textMessage.getText();
+ waitForResponse = false;
+ }
+ catch (Throwable t)
+ {
+ t.printStackTrace();
+ }
+ }
+ }
+
+ private void setupProxy(HelloWorld proxy) {
+ JMSConduit conduit = (JMSConduit)ClientProxy.getClient(proxy).getConduit();
+ JNDIConfiguration jndiConfig = conduit.getJmsConfig().getJndiConfig();
+ jndiConfig.setConnectionUserName(JBossWSTestHelper.getTestUsername());
+ jndiConfig.setConnectionPassword(JBossWSTestHelper.getTestPassword());
+ Properties props = conduit.getJmsConfig().getJndiTemplate().getEnvironment();
+ props.put(Context.SECURITY_PRINCIPAL, JBossWSTestHelper.getTestUsername());
+ props.put(Context.SECURITY_CREDENTIALS, JBossWSTestHelper.getTestPassword());
+ }
+
+ private static void rethrowAndHandleAuthWarning(Exception e) throws Exception {
+ final String msg = "Authentication failed";
+ if (e.getMessage().contains(msg) || e.getCause().getMessage().contains(msg)) {
+ System.out.println("This test requires an user with 'guest' role to be available on the application server; " +
+ "please ensure that then specify user and password using -Dtest.username=\"foo\" -Dtest.password=\"bar\".");
+ }
+ throw e;
+ }
+}
Deleted: stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jms_http/JMSHTTPEndpointDeploymentTestCase.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jms_http/JMSHTTPEndpointDeploymentTestCase.java 2012-04-13 03:51:36 UTC (rev 16157)
+++ stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jms_http/JMSHTTPEndpointDeploymentTestCase.java 2012-04-13 10:56:55 UTC (rev 16158)
@@ -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.test.ws.jaxws.cxf.jms_http;
-
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
-import java.net.URL;
-import java.util.Properties;
-
-import javax.naming.Context;
-import javax.xml.namespace.QName;
-import javax.xml.ws.Service;
-
-import junit.framework.Test;
-
-import org.apache.cxf.frontend.ClientProxy;
-import org.apache.cxf.transport.jms.JMSConduit;
-import org.apache.cxf.transport.jms.JNDIConfiguration;
-import org.jboss.test.ws.jaxws.cxf.jms.HelloWorld;
-import org.jboss.wsf.test.JBossWSCXFTestSetup;
-import org.jboss.wsf.test.JBossWSTest;
-import org.jboss.wsf.test.JBossWSTestHelper;
-
-/**
- * Test case for deploying an archive with a JMS (SOAP-over-JMS 1.0) and a HTTP endpoints
- *
- * @author alessio.soldano(a)jboss.com
- * @since 10-Jun-2011
- */
-public final class JMSHTTPEndpointDeploymentTestCase extends JBossWSTest
-{
- public static Test suite()
- {
- return new JBossWSCXFTestSetup(JMSHTTPEndpointDeploymentTestCase.class, "jaxws-cxf-jms-http-deployment-test-servlet.war,jaxws-cxf-jms-http-deployment.war");
- }
-
- public void testJMSEndpointServerSide() throws Exception
- {
- URL url = new URL("http://" + getServerHost() + ":8080/jaxws-cxf-jms-http-deployment-test-servlet");
- BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
- assertEquals("true", br.readLine());
- }
-
- public void testJMSEndpointClientSide() throws Exception
- {
- if (isTargetJBoss70()) {
- System.out.println("FIXME: can't lookup remote ConnectionFactory, remote JNDI binding not available yet on AS 7.0.x");
- return;
- }
-
- URL wsdlUrl = getResourceURL("jaxws/cxf/jms_http/WEB-INF/wsdl/HelloWorldService.wsdl");
- QName serviceName = new QName("http://org.jboss.ws/jaxws/cxf/jms", "HelloWorldService");
-
- Service service = Service.create(wsdlUrl, serviceName);
- HelloWorld proxy = (HelloWorld) service.getPort(new QName("http://org.jboss.ws/jaxws/cxf/jms", "HelloWorldImplPort"), HelloWorld.class);
- setupProxy(proxy);
- try {
- assertEquals("Hi", proxy.echo("Hi"));
- } catch (Exception e) {
- if (e.getMessage().contains("Authentication failed")) {
- System.out.println("This test requires an user with 'guest' role to be available on the application server; " +
- "please ensure that then specify user and password using -Dtest.username=\"foo\" -Dtest.password=\"bar\".");
- }
- throw e;
- }
- }
-
- public void testHTTPEndpointClientSide() throws Exception
- {
- URL wsdlUrl = new URL("http://" + getServerHost() + ":8080/jaxws-cxf-jms-http-deployment?wsdl");
- QName serviceName = new QName("http://org.jboss.ws/jaxws/cxf/jms", "HelloWorldService");
-
- Service service = Service.create(wsdlUrl, serviceName);
- HelloWorld proxy = (HelloWorld) service.getPort(new QName("http://org.jboss.ws/jaxws/cxf/jms", "HttpHelloWorldImplPort"), HelloWorld.class);
- assertEquals("(http) Hi", proxy.echo("Hi"));
- }
-
- private void setupProxy(HelloWorld proxy) {
- JMSConduit conduit = (JMSConduit)ClientProxy.getClient(proxy).getConduit();
- JNDIConfiguration jndiConfig = conduit.getJmsConfig().getJndiConfig();
- jndiConfig.setConnectionUserName(JBossWSTestHelper.getTestUsername());
- jndiConfig.setConnectionPassword(JBossWSTestHelper.getTestPassword());
- Properties props = conduit.getJmsConfig().getJndiTemplate().getEnvironment();
- props.put(Context.SECURITY_PRINCIPAL, JBossWSTestHelper.getTestUsername());
- props.put(Context.SECURITY_CREDENTIALS, JBossWSTestHelper.getTestPassword());
- }
-}
Added: stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jms_http/JMSHTTPEndpointDeploymentTestCaseForked.java
===================================================================
--- stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jms_http/JMSHTTPEndpointDeploymentTestCaseForked.java (rev 0)
+++ stack/cxf/trunk/modules/testsuite/cxf-spring-tests/src/test/java/org/jboss/test/ws/jaxws/cxf/jms_http/JMSHTTPEndpointDeploymentTestCaseForked.java 2012-04-13 10:56:55 UTC (rev 16158)
@@ -0,0 +1,106 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.cxf.jms_http;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.net.URL;
+import java.util.Properties;
+
+import javax.naming.Context;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+
+import junit.framework.Test;
+
+import org.apache.cxf.frontend.ClientProxy;
+import org.apache.cxf.transport.jms.JMSConduit;
+import org.apache.cxf.transport.jms.JNDIConfiguration;
+import org.jboss.test.ws.jaxws.cxf.jms.HelloWorld;
+import org.jboss.wsf.test.JBossWSCXFTestSetup;
+import org.jboss.wsf.test.JBossWSTest;
+import org.jboss.wsf.test.JBossWSTestHelper;
+
+/**
+ * Test case for deploying an archive with a JMS (SOAP-over-JMS 1.0) and a HTTP endpoints
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 10-Jun-2011
+ */
+public final class JMSHTTPEndpointDeploymentTestCaseForked extends JBossWSTest
+{
+ public static Test suite()
+ {
+ return new JBossWSCXFTestSetup(JMSHTTPEndpointDeploymentTestCaseForked.class, "jaxws-cxf-jms-http-deployment-test-servlet.war,jaxws-cxf-jms-http-deployment.war");
+ }
+
+ public void testJMSEndpointServerSide() throws Exception
+ {
+ URL url = new URL("http://" + getServerHost() + ":8080/jaxws-cxf-jms-http-deployment-test-servlet");
+ BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
+ assertEquals("true", br.readLine());
+ }
+
+ public void testJMSEndpointClientSide() throws Exception
+ {
+ if (isTargetJBoss70()) {
+ System.out.println("FIXME: can't lookup remote ConnectionFactory, remote JNDI binding not available yet on AS 7.0.x");
+ return;
+ }
+
+ URL wsdlUrl = getResourceURL("jaxws/cxf/jms_http/WEB-INF/wsdl/HelloWorldService.wsdl");
+ QName serviceName = new QName("http://org.jboss.ws/jaxws/cxf/jms", "HelloWorldService");
+
+ Service service = Service.create(wsdlUrl, serviceName);
+ HelloWorld proxy = (HelloWorld) service.getPort(new QName("http://org.jboss.ws/jaxws/cxf/jms", "HelloWorldImplPort"), HelloWorld.class);
+ setupProxy(proxy);
+ try {
+ assertEquals("Hi", proxy.echo("Hi"));
+ } catch (Exception e) {
+ if (e.getMessage().contains("Authentication failed")) {
+ System.out.println("This test requires an user with 'guest' role to be available on the application server; " +
+ "please ensure that then specify user and password using -Dtest.username=\"foo\" -Dtest.password=\"bar\".");
+ }
+ throw e;
+ }
+ }
+
+ public void testHTTPEndpointClientSide() throws Exception
+ {
+ URL wsdlUrl = new URL("http://" + getServerHost() + ":8080/jaxws-cxf-jms-http-deployment?wsdl");
+ QName serviceName = new QName("http://org.jboss.ws/jaxws/cxf/jms", "HelloWorldService");
+
+ Service service = Service.create(wsdlUrl, serviceName);
+ HelloWorld proxy = (HelloWorld) service.getPort(new QName("http://org.jboss.ws/jaxws/cxf/jms", "HttpHelloWorldImplPort"), HelloWorld.class);
+ assertEquals("(http) Hi", proxy.echo("Hi"));
+ }
+
+ private void setupProxy(HelloWorld proxy) {
+ JMSConduit conduit = (JMSConduit)ClientProxy.getClient(proxy).getConduit();
+ JNDIConfiguration jndiConfig = conduit.getJmsConfig().getJndiConfig();
+ jndiConfig.setConnectionUserName(JBossWSTestHelper.getTestUsername());
+ jndiConfig.setConnectionPassword(JBossWSTestHelper.getTestPassword());
+ Properties props = conduit.getJmsConfig().getJndiTemplate().getEnvironment();
+ props.put(Context.SECURITY_PRINCIPAL, JBossWSTestHelper.getTestUsername());
+ props.put(Context.SECURITY_CREDENTIALS, JBossWSTestHelper.getTestPassword());
+ }
+}
Modified: stack/cxf/trunk/modules/testsuite/pom.xml
===================================================================
--- stack/cxf/trunk/modules/testsuite/pom.xml 2012-04-13 03:51:36 UTC (rev 16157)
+++ stack/cxf/trunk/modules/testsuite/pom.xml 2012-04-13 10:56:55 UTC (rev 16158)
@@ -369,6 +369,7 @@
<include>**/smoke/tools/**/*TestForked.java</include>
<include>**/smoke/tools/**/*TestCaseForked.java</include>
<include>**/jbws2150/**/*TestCaseForked.java</include>
+ <include>**/jms*/**/*TestCaseForked.java</include>
</includes>
<systemProperties>
<property>
12 years, 8 months
JBossWS SVN: r16157 - in stack/native/trunk/modules: core/src/main/java/org/jboss/ws/core/client and 17 other directories.
by jbossws-commits@lists.jboss.org
Author: ropalka
Date: 2012-04-12 23:51:36 -0400 (Thu, 12 Apr 2012)
New Revision: 16157
Added:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/utils/
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/utils/CIDGenerator.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/utils/Message.properties
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/utils/MessageContextAssociation.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/utils/SOAPElementWriter.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/utils/SOAPUtils.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/utils/Style.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/utils/Use.java
Removed:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/MessageAbstraction.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/SOAPMessageAbstraction.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/MessageContextAssociation.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPElementWriter.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/Style.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/Use.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/attachment/CIDGenerator.java
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/CommonBinding.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/CommonClient.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/CommonMessageContext.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/CommonSOAP11Binding.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/CommonSOAP12Binding.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/MessageTrace.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/StubExt.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/client/HTTPRemotingConnection.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/client/RemoteConnection.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/client/SOAPProtocolConnectionHTTP.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/ParameterWrapping.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/SOAPBindingJAXRPC.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/SOAPFaultHelperJAXRPC.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/SerializationContextJAXRPC.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/ServletEndpointContextImpl.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPElementDeserializer.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/JBossXBSupport.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/client/CallImpl.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerChainBaseImpl.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerDelegateJAXRPC.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvokerEJB21.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/EnvelopeBuilder.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/EnvelopeBuilderDOM.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/MessageFactoryImpl.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/ObjectContent.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPConnectionImpl.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPContentElement.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPMessageDispatcher.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPMessageImpl.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPMessageMarshaller.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPPartImpl.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/XMLContent.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/attachment/MultipartRelatedEncoder.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/attachment/MultipartRelatedSwAEncoder.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCMetaDataBuilder.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/OperationMetaData.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/ServiceMetaData.java
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Reader.java
stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/common/binding/SOAPBindingTestCase.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/common/soap/MessageFactoryTestCase.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/common/soap/SOAPContentElementTestCase.java
stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/common/soap/attachment/GenericAttachmentTestCase.java
Log:
[JBWS-3486] slim down native SAAJ impl. dependencies
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/CommonBinding.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/CommonBinding.java 2012-04-11 16:10:32 UTC (rev 16156)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/CommonBinding.java 2012-04-13 03:51:36 UTC (rev 16157)
@@ -21,12 +21,9 @@
*/
package org.jboss.ws.core;
-import java.util.Map;
+import javax.xml.soap.SOAPMessage;
-import javax.xml.namespace.QName;
-
import org.jboss.ws.core.binding.BindingException;
-import org.jboss.ws.core.soap.UnboundHeader;
import org.jboss.ws.metadata.umdm.OperationMetaData;
/**
@@ -38,19 +35,19 @@
public interface CommonBinding
{
/** On the client side, generate the Object from IN parameters. */
- MessageAbstraction bindRequestMessage(OperationMetaData opMetaData, EndpointInvocation epInv, Map<QName, UnboundHeader> unboundHeaders) throws BindingException;
+ SOAPMessage bindRequestMessage(OperationMetaData opMetaData, EndpointInvocation epInv) throws BindingException;
/** On the server side, extract the IN parameters from the Object and populate an Invocation object */
- EndpointInvocation unbindRequestMessage(OperationMetaData opMetaData, MessageAbstraction reqMessage) throws BindingException;
+ EndpointInvocation unbindRequestMessage(OperationMetaData opMetaData, SOAPMessage reqMessage) throws BindingException;
/** On the server side, generate the Object from OUT parameters in the Invocation object. */
- MessageAbstraction bindResponseMessage(OperationMetaData opMetaData, EndpointInvocation epInv) throws BindingException;
+ SOAPMessage bindResponseMessage(OperationMetaData opMetaData, EndpointInvocation epInv) throws BindingException;
/** On the client side, extract the OUT parameters from the Object and return them to the client. */
- void unbindResponseMessage(OperationMetaData opMetaData, MessageAbstraction resMessage, EndpointInvocation epInv, Map<QName, UnboundHeader> unboundHeaders) throws BindingException;
+ void unbindResponseMessage(OperationMetaData opMetaData, SOAPMessage resMessage, EndpointInvocation epInv) throws BindingException;
/** bind an exception to a fault message */
- MessageAbstraction bindFaultMessage(Exception ex);
+ SOAPMessage bindFaultMessage(Exception ex);
void setHeaderSource(HeaderSource source);
}
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/CommonClient.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/CommonClient.java 2012-04-11 16:10:32 UTC (rev 16156)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/CommonClient.java 2012-04-13 03:51:36 UTC (rev 16157)
@@ -35,6 +35,7 @@
import javax.xml.soap.AttachmentPart;
import javax.xml.soap.MessageFactory;
import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
import org.jboss.logging.Logger;
import org.jboss.ws.WSException;
@@ -47,9 +48,8 @@
import org.jboss.ws.core.client.RemoteConnectionFactory;
import org.jboss.ws.core.client.transport.NettyClient;
import org.jboss.ws.core.jaxrpc.ParameterWrapping;
-import org.jboss.ws.core.soap.MessageContextAssociation;
-import org.jboss.ws.core.soap.Style;
-import org.jboss.ws.core.soap.UnboundHeader;
+import org.jboss.ws.core.soap.utils.MessageContextAssociation;
+import org.jboss.ws.core.soap.utils.Style;
import org.jboss.ws.core.utils.HolderUtils;
import org.jboss.ws.metadata.umdm.ClientEndpointMetaData;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
@@ -80,8 +80,6 @@
protected QName operationName;
// The binding provider
protected CommonBindingProvider bindingProvider;
- // A Map<QName,UnboundHeader> of header entries
- private Map<QName, UnboundHeader> unboundHeaders = new LinkedHashMap<QName, UnboundHeader>();
// A List<AttachmentPart> of attachment parts set through the proxy
private List<AttachmentPart> attachmentParts = new ArrayList<AttachmentPart>();
@@ -283,7 +281,7 @@
setOutboundContextProperties();
// Bind the request message
- MessageAbstraction reqMessage = binding.bindRequestMessage(opMetaData, epInv, unboundHeaders);
+ SOAPMessage reqMessage = binding.bindRequestMessage(opMetaData, epInv);
// Add possible attachment parts
addAttachmentParts(reqMessage);
@@ -294,7 +292,7 @@
handlerPass = handlerPass && callRequestHandlerChain(portName, handlerType[2]);
// Handlers might have replaced the message
- reqMessage = msgContext.getMessageAbstraction();
+ reqMessage = msgContext.getSOAPMessage();
if (handlerPass)
{
@@ -311,7 +309,7 @@
addSessionInfo(reqMessage, callProps);
RemoteConnection remoteConnection = new RemoteConnectionFactory().getRemoteConnection(epInfo);
- MessageAbstraction resMessage = remoteConnection.invoke(reqMessage, epInfo, oneway);
+ SOAPMessage resMessage = remoteConnection.invoke(reqMessage, epInfo, oneway);
if (maintainSession)
saveSessionInfo(callProps, requestCtx);
@@ -323,7 +321,7 @@
msgContext.put(CommonMessageContext.REMOTING_METADATA, callProps);
// Associate response message with message context
- msgContext.setMessageAbstraction(resMessage);
+ msgContext.setSOAPMessage(resMessage);
}
setInboundContextProperties();
@@ -344,8 +342,8 @@
if (handlerPass)
{
// unbind the return values
- MessageAbstraction resMessage = msgContext.getMessageAbstraction();
- binding.unbindResponseMessage(opMetaData, resMessage, epInv, unboundHeaders);
+ SOAPMessage resMessage = msgContext.getSOAPMessage();
+ binding.unbindResponseMessage(opMetaData, resMessage, epInv);
}
handlerPass = handlerPass && callResponseHandlerChain(portName, handlerType[1]);
@@ -357,8 +355,8 @@
if (msgContext.isModified())
{
log.debug("Handler modified body payload, unbind message again");
- MessageAbstraction resMessage = msgContext.getMessageAbstraction();
- binding.unbindResponseMessage(opMetaData, resMessage, epInv, unboundHeaders);
+ SOAPMessage resMessage = msgContext.getSOAPMessage();
+ binding.unbindResponseMessage(opMetaData, resMessage, epInv);
}
retObj = syncOutputParams(inputParams, epInv);
@@ -431,7 +429,7 @@
}
@SuppressWarnings("unchecked")
- protected void addSessionInfo(MessageAbstraction reqMessage, Map<String, Object> callProperties)
+ protected void addSessionInfo(SOAPMessage reqMessage, Map<String, Object> callProperties)
{
Map<String, String> cookies = (Map<String, String>)callProperties.get(SESSION_COOKIES);
if (cookies != null)
@@ -453,7 +451,7 @@
return msgContext;
}
- protected void addAttachmentParts(MessageAbstraction reqMessage)
+ protected void addAttachmentParts(SOAPMessage reqMessage)
{
boolean debugEnabled = log.isDebugEnabled();
for (AttachmentPart part : attachmentParts)
@@ -514,74 +512,6 @@
}
/**
- * Add a header that is not bound to an input parameter.
- * A propriatory extension, that is not part of JAXRPC.
- *
- * @param xmlName The XML name of the header element
- * @param xmlType The XML type of the header element
- */
- public void addUnboundHeader(QName xmlName, QName xmlType, Class javaType, ParameterMode mode)
- {
- UnboundHeader unboundHeader = new UnboundHeader(xmlName, xmlType, javaType, mode);
- unboundHeaders.put(xmlName, unboundHeader);
- }
-
- /**
- * Get the header value for the given XML name.
- * A propriatory extension, that is not part of JAXRPC.
- *
- * @param xmlName The XML name of the header element
- * @return The header value, or null
- */
- public Object getUnboundHeaderValue(QName xmlName)
- {
- UnboundHeader unboundHeader = unboundHeaders.get(xmlName);
- return (unboundHeader != null ? unboundHeader.getHeaderValue() : null);
- }
-
- /**
- * Set the header value for the given XML name.
- * A propriatory extension, that is not part of JAXRPC.
- *
- * @param xmlName The XML name of the header element
- */
- public void setUnboundHeaderValue(QName xmlName, Object value)
- {
- UnboundHeader unboundHeader = unboundHeaders.get(xmlName);
- if (unboundHeader == null)
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "CANNOT_FIND_UNBOUND_HEADER", xmlName));
-
- unboundHeader.setHeaderValue(value);
- }
-
- /**
- * Clear all registered headers.
- * A propriatory extension, that is not part of JAXRPC.
- */
- public void clearUnboundHeaders()
- {
- unboundHeaders.clear();
- }
-
- /**
- * Remove the header for the given XML name.
- * A propriatory extension, that is not part of JAXRPC.
- */
- public void removeUnboundHeader(QName xmlName)
- {
- unboundHeaders.remove(xmlName);
- }
-
- /**
- * Get an Iterator over the registered header XML names.
- * A propriatory extension, that is not part of JAXRPC.
- */
- public Iterator getUnboundHeaders()
- {
- return unboundHeaders.keySet().iterator();
- }
-
- /**
* Adds the given AttachmentPart object to the outgoing SOAPMessage.
* An AttachmentPart object must be created before it can be added to a message.
*/
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/CommonMessageContext.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/CommonMessageContext.java 2012-04-11 16:10:32 UTC (rev 16156)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/CommonMessageContext.java 2012-04-13 03:51:36 UTC (rev 16157)
@@ -60,7 +60,7 @@
// The operation for this message ctx
private OperationMetaData opMetaData;
// The Message in this message context
- private MessageAbstraction message;
+ private SOAPMessage message;
// The map of scoped properties
protected Map<String, Object> props = new HashMap<String, Object>();
@@ -112,20 +112,10 @@
public void setSOAPMessage(SOAPMessage soapMessage)
{
- this.message = (MessageAbstraction)soapMessage;
+ this.message = soapMessage;
this.setModified(true);
}
- public MessageAbstraction getMessageAbstraction()
- {
- return message;
- }
-
- public void setMessageAbstraction(MessageAbstraction message)
- {
- this.message = message;
- }
-
public SerializationContext getSerializationContext()
{
if (serContext == null)
@@ -245,7 +235,7 @@
public static void cleanupAttachments(CommonMessageContext messageContext)
{
// cleanup attachments
- MessageAbstraction msg = messageContext.getMessageAbstraction();
+ SOAPMessage msg = messageContext.getSOAPMessage();
if(msg!=null && (msg instanceof SOAPMessage)) // in case of http binding
{
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/CommonSOAP11Binding.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/CommonSOAP11Binding.java 2012-04-11 16:10:32 UTC (rev 16156)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/CommonSOAP11Binding.java 2012-04-13 03:51:36 UTC (rev 16157)
@@ -24,15 +24,16 @@
import java.util.Set;
import javax.xml.namespace.QName;
+import javax.xml.soap.MessageFactory;
import javax.xml.soap.SOAPEnvelope;
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPHeaderElement;
+import javax.xml.soap.SOAPMessage;
import org.jboss.ws.common.Constants;
-import org.jboss.ws.core.soap.MessageFactoryImpl;
import org.jboss.ws.core.soap.SOAPFaultImpl;
-import org.jboss.ws.core.soap.SOAPMessageImpl;
-import org.jboss.ws.core.soap.Use;
+import org.jboss.ws.core.soap.utils.SOAPUtils;
+import org.jboss.ws.core.soap.utils.Use;
import org.jboss.ws.metadata.umdm.OperationMetaData;
/**
@@ -43,18 +44,17 @@
*/
public abstract class CommonSOAP11Binding extends CommonSOAPBinding
{
- private MessageFactoryImpl msgFactory;
+ private MessageFactory msgFactory;
public CommonSOAP11Binding()
{
- msgFactory = new MessageFactoryImpl();
- msgFactory.setEnvNamespace(Constants.NS_SOAP11_ENV);
+ msgFactory = SOAPUtils.newSOAP11MessageFactory();
}
/** Create the SOAP-1.1 message */
- protected MessageAbstraction createMessage(OperationMetaData opMetaData) throws SOAPException
+ protected SOAPMessage createMessage(OperationMetaData opMetaData) throws SOAPException
{
- SOAPMessageImpl soapMessage = (SOAPMessageImpl)msgFactory.createMessage();
+ SOAPMessage soapMessage = msgFactory.createMessage();
Use encStyle = opMetaData.getEndpointMetaData().getEncodingStyle();
if (Use.ENCODED.equals(encStyle))
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/CommonSOAP12Binding.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/CommonSOAP12Binding.java 2012-04-11 16:10:32 UTC (rev 16156)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/CommonSOAP12Binding.java 2012-04-13 03:51:36 UTC (rev 16157)
@@ -24,13 +24,15 @@
import java.util.Set;
import javax.xml.namespace.QName;
+import javax.xml.soap.MessageFactory;
import javax.xml.soap.SOAPConstants;
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPHeaderElement;
+import javax.xml.soap.SOAPMessage;
import org.jboss.ws.common.Constants;
-import org.jboss.ws.core.soap.MessageFactoryImpl;
import org.jboss.ws.core.soap.SOAPFaultImpl;
+import org.jboss.ws.core.soap.utils.SOAPUtils;
import org.jboss.ws.metadata.umdm.OperationMetaData;
/**
@@ -41,18 +43,17 @@
*/
public abstract class CommonSOAP12Binding extends CommonSOAPBinding
{
- private MessageFactoryImpl msgFactory;
+ private MessageFactory msgFactory;
public CommonSOAP12Binding()
{
- msgFactory = new MessageFactoryImpl();
- msgFactory.setEnvNamespace(Constants.NS_SOAP12_ENV);
+ msgFactory = SOAPUtils.newSOAP12MessageFactory();
}
/** Create the SOAP-1.1 message */
- protected MessageAbstraction createMessage(OperationMetaData opMetaData) throws SOAPException
+ protected SOAPMessage createMessage(OperationMetaData opMetaData) throws SOAPException
{
- return (MessageAbstraction)msgFactory.createMessage();
+ return msgFactory.createMessage();
}
protected abstract Set<String> getRoles();
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java 2012-04-11 16:10:32 UTC (rev 16156)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java 2012-04-13 03:51:36 UTC (rev 16157)
@@ -21,9 +21,7 @@
*/
package org.jboss.ws.core;
-import java.util.HashMap;
import java.util.Iterator;
-import java.util.Map;
import java.util.ResourceBundle;
import java.util.Set;
@@ -54,23 +52,20 @@
import org.jboss.ws.common.JavaUtils;
import org.jboss.ws.core.binding.BindingException;
import org.jboss.ws.core.jaxrpc.ParameterWrapping;
-import org.jboss.ws.core.soap.MessageContextAssociation;
-import org.jboss.ws.core.soap.MessageFactoryImpl;
import org.jboss.ws.core.soap.NameImpl;
import org.jboss.ws.core.soap.SOAPBodyElementDoc;
import org.jboss.ws.core.soap.SOAPBodyElementRpc;
import org.jboss.ws.core.soap.SOAPBodyImpl;
import org.jboss.ws.core.soap.SOAPContentElement;
import org.jboss.ws.core.soap.SOAPElementImpl;
-import org.jboss.ws.core.soap.SOAPFactoryImpl;
import org.jboss.ws.core.soap.SOAPFaultImpl;
import org.jboss.ws.core.soap.SOAPHeaderElementImpl;
-import org.jboss.ws.core.soap.SOAPMessageImpl;
-import org.jboss.ws.core.soap.Style;
-import org.jboss.ws.core.soap.UnboundHeader;
-import org.jboss.ws.core.soap.Use;
import org.jboss.ws.core.soap.attachment.AttachmentPartImpl;
-import org.jboss.ws.core.soap.attachment.CIDGenerator;
+import org.jboss.ws.core.soap.utils.CIDGenerator;
+import org.jboss.ws.core.soap.utils.MessageContextAssociation;
+import org.jboss.ws.core.soap.utils.SOAPUtils;
+import org.jboss.ws.core.soap.utils.Style;
+import org.jboss.ws.core.soap.utils.Use;
import org.jboss.ws.core.utils.MimeUtils;
import org.jboss.ws.metadata.umdm.OperationMetaData;
import org.jboss.ws.metadata.umdm.ParameterMetaData;
@@ -105,19 +100,19 @@
public MessageFactory getMessageFactory()
{
- return new MessageFactoryImpl();
+ return SOAPUtils.newSOAP11MessageFactory();
}
public SOAPFactory getSOAPFactory()
{
- return new SOAPFactoryImpl();
+ return SOAPUtils.newSOAP11Factory();
}
/** Create the message */
- protected abstract MessageAbstraction createMessage(OperationMetaData opMetaData) throws SOAPException;
+ protected abstract SOAPMessage createMessage(OperationMetaData opMetaData) throws SOAPException;
/** On the client side, generate the payload from IN parameters. */
- public MessageAbstraction bindRequestMessage(OperationMetaData opMetaData, EndpointInvocation epInv, Map<QName, UnboundHeader> unboundHeaders)
+ public SOAPMessage bindRequestMessage(OperationMetaData opMetaData, EndpointInvocation epInv)
throws BindingException
{
boolean debugEnabled = log.isDebugEnabled();
@@ -131,7 +126,7 @@
throw new WSException(BundleUtils.getMessage(bundle, "MESSAGECONTEXT_NOT_AVAILABLE"));
// Associate current message with message context
- SOAPMessageImpl reqMessage = (SOAPMessageImpl)createMessage(opMetaData);
+ SOAPMessage reqMessage = createMessage(opMetaData);
msgContext.setSOAPMessage(reqMessage);
SOAPEnvelope soapEnvelope = reqMessage.getSOAPPart().getEnvelope();
@@ -171,8 +166,7 @@
if (paramMetaData.isSwA())
{
// NOTE: swa:ref is handled by the AttachmentMarshaller callback
- CIDGenerator cidGenerator = reqMessage.getCidGenerator();
- AttachmentPart part = createAttachmentPart(paramMetaData, value, cidGenerator);
+ AttachmentPart part = createAttachmentPart(paramMetaData, value);
reqMessage.addAttachmentPart(part);
}
else
@@ -182,35 +176,6 @@
}
}
- // Add unbound headers
- if (unboundHeaders != null)
- {
- Iterator it = unboundHeaders.values().iterator();
- while (it.hasNext())
- {
- UnboundHeader unboundHeader = (UnboundHeader)it.next();
- if (unboundHeader.getMode() != ParameterMode.OUT)
- {
- QName xmlName = unboundHeader.getXmlName();
- Object value = unboundHeader.getHeaderValue();
-
- xmlName = namespaceRegistry.registerQName(xmlName);
- Name soapName = new NameImpl(xmlName.getLocalPart(), xmlName.getPrefix(), xmlName.getNamespaceURI());
-
- if (debugEnabled)
- log.debug("Add unboundHeader element: " + soapName);
- SOAPContentElement contentElement = new SOAPHeaderElementImpl(soapName);
- contentElement.setParamMetaData(unboundHeader.toParameterMetaData(opMetaData));
-
- if (soapHeader == null)
- soapHeader = soapEnvelope.addHeader();
-
- soapHeader.addChildElement(contentElement);
- contentElement.setObjectValue(value);
- }
- }
- }
-
// Set the SOAPAction
setSOAPActionHeader(opMetaData, reqMessage);
@@ -227,7 +192,7 @@
public abstract void setSOAPActionHeader(OperationMetaData opMetaData, SOAPMessage reqMessage);
/** On the server side, extract the IN parameters from the payload and populate an Invocation object */
- public EndpointInvocation unbindRequestMessage(OperationMetaData opMetaData, MessageAbstraction payload) throws BindingException
+ public EndpointInvocation unbindRequestMessage(OperationMetaData opMetaData, SOAPMessage payload) throws BindingException
{
if (log.isDebugEnabled())
log.debug("unbindRequestMessage: " + opMetaData.getQName());
@@ -235,7 +200,7 @@
try
{
// Read the SOAPEnvelope from the reqMessage
- SOAPMessageImpl reqMessage = (SOAPMessageImpl)payload;
+ SOAPMessage reqMessage = (SOAPMessage)payload;
SOAPEnvelope soapEnvelope = reqMessage.getSOAPPart().getEnvelope();
SOAPHeader soapHeader = soapEnvelope.getHeader();
SOAPBody soapBody = soapEnvelope.getBody();
@@ -339,7 +304,7 @@
}
/** On the server side, generate the payload from OUT parameters. */
- public MessageAbstraction bindResponseMessage(OperationMetaData opMetaData, EndpointInvocation epInv) throws BindingException
+ public SOAPMessage bindResponseMessage(OperationMetaData opMetaData, EndpointInvocation epInv) throws BindingException
{
if (log.isDebugEnabled())
log.debug("bindResponseMessage: " + opMetaData.getQName());
@@ -351,7 +316,7 @@
throw new WSException(BundleUtils.getMessage(bundle, "MESSAGECONTEXT_NOT_AVAILABLE"));
// Associate current message with message context
- SOAPMessageImpl resMessage = (SOAPMessageImpl)createMessage(opMetaData);
+ SOAPMessage resMessage = (SOAPMessage)createMessage(opMetaData);
msgContext.setSOAPMessage(resMessage);
// R2714 For one-way operations, an INSTANCE MUST NOT return a HTTP response that contains a SOAP envelope.
@@ -400,8 +365,7 @@
if (retMetaData.isSwA())
{
- CIDGenerator cidGenerator = resMessage.getCidGenerator();
- AttachmentPart part = createAttachmentPart(retMetaData, value, cidGenerator);
+ AttachmentPart part = createAttachmentPart(retMetaData, value);
resMessage.addAttachmentPart(part);
epInv.setReturnValue(part);
}
@@ -420,8 +384,7 @@
Object value = epInv.getResponseParamValue(xmlName);
if (paramMetaData.isSwA())
{
- CIDGenerator cidGenerator = resMessage.getCidGenerator();
- AttachmentPart part = createAttachmentPart(paramMetaData, value, cidGenerator);
+ AttachmentPart part = createAttachmentPart(paramMetaData, value);
resMessage.addAttachmentPart(part);
}
else
@@ -447,7 +410,7 @@
}
/** On the client side, extract the OUT parameters from the payload and return them to the client. */
- public void unbindResponseMessage(OperationMetaData opMetaData, MessageAbstraction payload, EndpointInvocation epInv, Map<QName, UnboundHeader> unboundHeaders)
+ public void unbindResponseMessage(OperationMetaData opMetaData, SOAPMessage payload, EndpointInvocation epInv)
throws BindingException
{
if (log.isDebugEnabled())
@@ -463,7 +426,7 @@
}
// WS-Addressing might redirect the response, which results in an empty envelope
- SOAPMessageImpl resMessage = (SOAPMessageImpl)payload;
+ SOAPMessage resMessage = payload;
SOAPEnvelope soapEnvelope = resMessage.getSOAPPart().getEnvelope();
if (soapEnvelope == null)
{
@@ -486,32 +449,6 @@
if (soapBodyElement instanceof SOAPFaultImpl)
throwFaultException((SOAPFaultImpl)soapBodyElement);
- // Extract unbound OUT headers
- if (unboundHeaders != null && soapHeader != null)
- {
- Map<QName, UnboundHeader> outHeaders = new HashMap<QName, UnboundHeader>();
- Iterator itHeaderElements = soapHeader.getChildElements();
- while (itHeaderElements.hasNext())
- {
- SOAPContentElement soapHeaderElement = (SOAPHeaderElementImpl)itHeaderElements.next();
- Name elName = soapHeaderElement.getElementName();
- QName xmlName = new QName(elName.getURI(), elName.getLocalName());
-
- UnboundHeader unboundHeader = (UnboundHeader)unboundHeaders.get(xmlName);
- if (unboundHeader != null)
- {
- soapHeaderElement.setParamMetaData(unboundHeader.toParameterMetaData(opMetaData));
-
- // Do the unmarshalling
- Object value = soapHeaderElement.getObjectValue();
- unboundHeader.setHeaderValue(value);
- outHeaders.put(xmlName, unboundHeader);
- }
- }
- unboundHeaders.clear();
- unboundHeaders.putAll(outHeaders);
- }
-
Style style = opMetaData.getStyle();
SOAPElement soapElement = soapBody;
if (style == Style.RPC)
@@ -558,9 +495,9 @@
}
}
- public MessageAbstraction bindFaultMessage(Exception ex)
+ public SOAPMessage bindFaultMessage(Exception ex)
{
- SOAPMessageImpl faultMessage = (SOAPMessageImpl)createFaultMessageFromException(ex);
+ SOAPMessage faultMessage = createFaultMessageFromException(ex);
CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
if (msgContext != null)
{
@@ -586,7 +523,7 @@
log.warn(BundleUtils.getMessage(bundle, "EXPECTED_SOAP12", envNS));
}
- private AttachmentPart createAttachmentPart(ParameterMetaData paramMetaData, Object value, CIDGenerator cidGenerator) throws SOAPException, BindingException
+ private AttachmentPart createAttachmentPart(ParameterMetaData paramMetaData, Object value) throws SOAPException, BindingException
{
String partName = paramMetaData.getXmlName().getLocalPart();
Set mimeTypes = paramMetaData.getMimeTypes();
@@ -625,33 +562,37 @@
if (paramMetaData.isSwA())
{
- String swaCID = '<' + partName + "=" + cidGenerator.generateFromCount() + '>';
+ String swaCID = '<' + partName + "=" + CIDGenerator.generateFromCount() + '>';
part.setContentId(swaCID);
}
return part;
}
- private AttachmentPart createAttachmentPart(final String contentId, final DataHandler value)
- {
- AttachmentPart part = new AttachmentPartImpl();
- part.setContentId(contentId);
- part.setDataHandler(value);
-
- return part;
- }
-
private AttachmentPart getAttachmentFromMessage(ParameterMetaData paramMetaData, SOAPMessage message) throws SOAPException, BindingException
{
QName xmlName = paramMetaData.getXmlName();
- AttachmentPart part = ((SOAPMessageImpl)message).getAttachmentByPartName(xmlName.getLocalPart());
+ AttachmentPart part = getAttachmentByPartName(xmlName.getLocalPart(), message);
if (part == null)
throw new BindingException(BundleUtils.getMessage(bundle, "COULD_NOT_LOCATE_ATTACHMENT", paramMetaData.getXmlName()));
return part;
}
+ private AttachmentPart getAttachmentByPartName(String partName, SOAPMessage soapMsg)
+ {
+ final Iterator i = soapMsg.getAttachments();
+ while (i.hasNext())
+ {
+ AttachmentPart part = (AttachmentPart)i.next();
+ String contentId = part.getContentId();
+ if (contentId.startsWith("<" + partName + "="))
+ return part;
+ }
+ return null;
+ }
+
/** Marshall the given parameter and add it to the SOAPMessage */
private SOAPContentElement addParameterToMessage(ParameterMetaData paramMetaData, Object value, SOAPElement soapElement) throws SOAPException, BindingException
{
@@ -761,13 +702,13 @@
OperationMetaData opMetaData = paramMetaData.getOperationMetaData();
TypesMetaData typesMetaData = opMetaData.getEndpointMetaData().getServiceMetaData().getTypesMetaData();
- SOAPElementImpl childElement = null;
+ SOAPElement childElement = null;
while (childElement == null && childElements.hasNext())
{
Object current = childElements.next();
- if (current instanceof SOAPElementImpl)
+ if (current instanceof SOAPElement)
{
- childElement = (SOAPElementImpl)current;
+ childElement = (SOAPElement)current;
}
}
@@ -809,7 +750,7 @@
if (msgContext == null)
throw new WSException(BundleUtils.getMessage(bundle, "MESSAGECONTEXT_NOT_AVAILABLE"));
- SOAPMessageImpl soapMessage = (SOAPMessageImpl)msgContext.getSOAPMessage();
+ SOAPMessage soapMessage = (SOAPMessage)msgContext.getSOAPMessage();
SOAPEnvelope soapEnvelope = soapMessage.getSOAPPart().getEnvelope();
if (soapEnvelope == null || soapEnvelope.getHeader() == null)
return;
Deleted: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/MessageAbstraction.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/MessageAbstraction.java 2012-04-11 16:10:32 UTC (rev 16156)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/MessageAbstraction.java 2012-04-13 03:51:36 UTC (rev 16157)
@@ -1,46 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.core;
-
-import java.io.IOException;
-import java.io.OutputStream;
-
-import javax.xml.soap.AttachmentPart;
-import javax.xml.soap.MimeHeaders;
-
-/**
- * A generic message independent of the underlying protocol
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 02-Apr-2007
- */
-public interface MessageAbstraction
-{
- MimeHeaders getMimeHeaders();
-
- void writeTo(OutputStream outputStream) throws IOException;
-
- boolean isFaultMessage();
-
- void addAttachmentPart(AttachmentPart part);
-
-}
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/MessageTrace.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/MessageTrace.java 2012-04-11 16:10:32 UTC (rev 16156)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/MessageTrace.java 2012-04-13 03:51:36 UTC (rev 16157)
@@ -32,9 +32,8 @@
import org.jboss.logging.Logger;
import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.DOMWriter;
-import org.jboss.ws.core.soap.SOAPElementImpl;
-import org.jboss.ws.core.soap.SOAPElementWriter;
import org.jboss.ws.core.soap.XMLFragment;
+import org.jboss.ws.core.soap.utils.SOAPElementWriter;
import org.w3c.dom.Element;
/**
@@ -64,7 +63,7 @@
SOAPEnvelope soapEnv = ((SOAPMessage)message).getSOAPPart().getEnvelope();
if (soapEnv != null)
{
- String envStr = SOAPElementWriter.writeElement((SOAPElementImpl)soapEnv, true);
+ String envStr = SOAPElementWriter.writeElement(soapEnv, true);
msgLog.trace(messagePrefix + "\n" + envStr);
}
}
Deleted: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/SOAPMessageAbstraction.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/SOAPMessageAbstraction.java 2012-04-11 16:10:32 UTC (rev 16156)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/SOAPMessageAbstraction.java 2012-04-13 03:51:36 UTC (rev 16157)
@@ -1,33 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.core;
-
-/**
- * A generic SOAP message
- *
- * @author Thomas.Diesler(a)jboss.com
- * @since 02-Apr-2007
- */
-public interface SOAPMessageAbstraction extends MessageAbstraction
-{
-
-}
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/StubExt.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/StubExt.java 2012-04-11 16:10:32 UTC (rev 16156)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/StubExt.java 2012-04-13 03:51:36 UTC (rev 16157)
@@ -21,10 +21,6 @@
*/
package org.jboss.ws.core;
-import java.util.Iterator;
-
-import javax.xml.namespace.QName;
-import javax.xml.rpc.ParameterMode;
import javax.xml.soap.AttachmentPart;
/**
@@ -75,54 +71,7 @@
/** Client ReceiveTimeout property: javax.xml.ws.client.receiveTimeout */
static final String PROPERTY_RECEIVE_TIMEOUT = "javax.xml.ws.client.receiveTimeout";
-
-
-
/**
- * Add a header that is not bound to an input parameter.
- * A propriatory extension, that is not part of JAXRPC.
- *
- * @param xmlName The XML name of the header element
- * @param xmlType The XML type of the header element
- */
- void addUnboundHeader(QName xmlName, QName xmlType, Class javaType, ParameterMode mode);
-
- /**
- * Get the header value for the given XML name.
- * A propriatory extension, that is not part of JAXRPC.
- *
- * @param xmlName The XML name of the header element
- * @return The header value, or null
- */
- Object getUnboundHeaderValue(QName xmlName);
-
- /**
- * Set the header value for the given XML name.
- * A propriatory extension, that is not part of JAXRPC.
- *
- * @param xmlName The XML name of the header element
- */
- void setUnboundHeaderValue(QName xmlName, Object value);
-
- /**
- * Clear all registered headers.
- * A propriatory extension, that is not part of JAXRPC.
- */
- void clearUnboundHeaders();
-
- /**
- * Remove the header for the given XML name.
- * A propriatory extension, that is not part of JAXRPC.
- */
- void removeUnboundHeader(QName xmlName);
-
- /**
- * Get an Iterator over the registered header XML names.
- * A propriatory extension, that is not part of JAXRPC.
- */
- Iterator getUnboundHeaders();
-
- /**
* Adds the given AttachmentPart object to the outgoing SOAPMessage.
* An AttachmentPart object must be created before it can be added to a message.
*/
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/client/HTTPRemotingConnection.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/client/HTTPRemotingConnection.java 2012-04-11 16:10:32 UTC (rev 16156)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/client/HTTPRemotingConnection.java 2012-04-13 03:51:36 UTC (rev 16157)
@@ -29,9 +29,9 @@
import javax.xml.soap.MimeHeader;
import javax.xml.soap.MimeHeaders;
+import javax.xml.soap.SOAPMessage;
import org.jboss.ws.api.util.BundleUtils;
-import org.jboss.ws.core.MessageAbstraction;
import org.jboss.ws.core.MessageTrace;
import org.jboss.ws.core.StubExt;
import org.jboss.ws.core.client.transport.NettyClient;
@@ -87,7 +87,7 @@
*
* A null reqMessage signifies a HTTP GET request.
*/
- public MessageAbstraction invoke(MessageAbstraction reqMessage, Object endpoint, boolean oneway) throws IOException
+ public SOAPMessage invoke(SOAPMessage reqMessage, Object endpoint, boolean oneway) throws IOException
{
if (endpoint == null)
throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "GIVEN_ENDPOINT_CANNOT_BE_NULL"));
@@ -125,7 +125,7 @@
populateHeaders(reqMessage, additionalHeaders);
//Trace the outgoing message
MessageTrace.traceMessage("Outgoing Request Message", reqMessage);
- MessageAbstraction resMessage = (MessageAbstraction)client.invoke(reqMessage, targetAddress, oneway, additionalHeaders, callProps);
+ SOAPMessage resMessage = (SOAPMessage)client.invoke(reqMessage, targetAddress, oneway, additionalHeaders, callProps);
//Trace the incoming response message
MessageTrace.traceMessage("Incoming Response Message", resMessage);
return resMessage;
@@ -133,7 +133,7 @@
- protected void populateHeaders(MessageAbstraction reqMessage, Map<String, Object> metadata)
+ protected void populateHeaders(SOAPMessage reqMessage, Map<String, Object> metadata)
{
if (reqMessage != null)
{
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/client/RemoteConnection.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/client/RemoteConnection.java 2012-04-11 16:10:32 UTC (rev 16156)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/client/RemoteConnection.java 2012-04-13 03:51:36 UTC (rev 16157)
@@ -23,9 +23,8 @@
import java.io.IOException;
-import org.jboss.ws.core.MessageAbstraction;
+import javax.xml.soap.SOAPMessage;
-
/**
* A remote connection
*
@@ -38,5 +37,5 @@
UnMarshaller getUnmarshaller();
- MessageAbstraction invoke(MessageAbstraction reqMessage, Object endpoint, boolean oneway) throws IOException;
+ SOAPMessage invoke(SOAPMessage reqMessage, Object endpoint, boolean oneway) throws IOException;
}
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/client/SOAPProtocolConnectionHTTP.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/client/SOAPProtocolConnectionHTTP.java 2012-04-11 16:10:32 UTC (rev 16156)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/client/SOAPProtocolConnectionHTTP.java 2012-04-13 03:51:36 UTC (rev 16157)
@@ -28,7 +28,6 @@
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPMessage;
-import org.jboss.ws.core.MessageAbstraction;
import org.jboss.ws.core.soap.SOAPMessageMarshaller;
import org.jboss.ws.core.soap.SOAPMessageUnMarshallerHTTP;
@@ -52,12 +51,12 @@
}
@Override
- public MessageAbstraction invoke(MessageAbstraction reqMessage, Object endpoint, boolean oneway) throws IOException
+ public SOAPMessage invoke(SOAPMessage reqMessage, Object endpoint, boolean oneway) throws IOException
{
try
{
// save object model changes
- SOAPMessage soapMessage = (SOAPMessage)reqMessage;
+ SOAPMessage soapMessage = reqMessage;
if (reqMessage != null && soapMessage.saveRequired())
soapMessage.saveChanges();
@@ -71,7 +70,7 @@
}
}
- protected void populateHeaders(MessageAbstraction reqMessage, Map<String, Object> metadata)
+ protected void populateHeaders(SOAPMessage reqMessage, Map<String, Object> metadata)
{
super.populateHeaders(reqMessage, metadata);
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/ParameterWrapping.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/ParameterWrapping.java 2012-04-11 16:10:32 UTC (rev 16156)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/ParameterWrapping.java 2012-04-13 03:51:36 UTC (rev 16157)
@@ -44,7 +44,7 @@
import org.jboss.ws.core.binding.TypeMappingImpl;
import org.jboss.ws.core.jaxrpc.binding.JBossXBDeserializerFactory;
import org.jboss.ws.core.jaxrpc.binding.JBossXBSerializerFactory;
-import org.jboss.ws.core.soap.Style;
+import org.jboss.ws.core.soap.utils.Style;
import org.jboss.ws.core.utils.HolderUtils;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.metadata.umdm.OperationMetaData;
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/SOAPBindingJAXRPC.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/SOAPBindingJAXRPC.java 2012-04-11 16:10:32 UTC (rev 16156)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/SOAPBindingJAXRPC.java 2012-04-13 03:51:36 UTC (rev 16157)
@@ -27,7 +27,7 @@
import org.jboss.logging.Logger;
import org.jboss.ws.core.jaxrpc.handler.MessageContextJAXRPC;
-import org.jboss.ws.core.soap.MessageContextAssociation;
+import org.jboss.ws.core.soap.utils.MessageContextAssociation;
import org.jboss.ws.metadata.umdm.OperationMetaData;
/**
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/SOAPFaultHelperJAXRPC.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/SOAPFaultHelperJAXRPC.java 2012-04-11 16:10:32 UTC (rev 16156)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/SOAPFaultHelperJAXRPC.java 2012-04-13 03:51:36 UTC (rev 16157)
@@ -32,12 +32,16 @@
import javax.xml.rpc.soap.SOAPFaultException;
import javax.xml.soap.Detail;
import javax.xml.soap.DetailEntry;
+import javax.xml.soap.MessageFactory;
import javax.xml.soap.Name;
import javax.xml.soap.SOAPBody;
import javax.xml.soap.SOAPConstants;
import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPEnvelope;
import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPFactory;
import javax.xml.soap.SOAPFault;
+import javax.xml.soap.SOAPMessage;
import javax.xml.transform.Result;
import javax.xml.transform.Source;
import javax.xml.transform.dom.DOMSource;
@@ -54,13 +58,10 @@
import org.jboss.ws.core.binding.DeserializerSupport;
import org.jboss.ws.core.binding.SerializationContext;
import org.jboss.ws.core.binding.SerializerSupport;
-import org.jboss.ws.core.soap.MessageContextAssociation;
-import org.jboss.ws.core.soap.MessageFactoryImpl;
import org.jboss.ws.core.soap.NameImpl;
-import org.jboss.ws.core.soap.SOAPEnvelopeImpl;
-import org.jboss.ws.core.soap.SOAPFactoryImpl;
-import org.jboss.ws.core.soap.SOAPMessageImpl;
import org.jboss.ws.core.soap.XMLFragment;
+import org.jboss.ws.core.soap.utils.MessageContextAssociation;
+import org.jboss.ws.core.soap.utils.SOAPUtils;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.metadata.umdm.FaultMetaData;
import org.jboss.ws.metadata.umdm.OperationMetaData;
@@ -177,7 +178,7 @@
/** Translate the request exception into a SOAPFault message.
*/
- public static SOAPMessageImpl exceptionToFaultMessage(Exception reqEx)
+ public static SOAPMessage exceptionToFaultMessage(Exception reqEx)
{
// Get or create the SOAPFaultException
SOAPFaultException faultEx;
@@ -215,7 +216,7 @@
try
{
- SOAPMessageImpl faultMessage = toSOAPMessage(faultEx);
+ SOAPMessage faultMessage = toSOAPMessage(faultEx);
return faultMessage;
}
catch (RuntimeException rte)
@@ -229,7 +230,7 @@
}
}
- private static SOAPMessageImpl toSOAPMessage(SOAPFaultException faultEx) throws SOAPException
+ private static SOAPMessage toSOAPMessage(SOAPFaultException faultEx) throws SOAPException
{
assertFaultCode(faultEx.getFaultCode());
@@ -237,9 +238,9 @@
SerializationContext serContext = (msgContext != null ? msgContext.getSerializationContext() : new SerializationContextJAXRPC());
NamespaceRegistry nsRegistry = serContext.getNamespaceRegistry();
- SOAPMessageImpl soapMessage = createSOAPMessage();
+ SOAPMessage soapMessage = createSOAPMessage();
- SOAPEnvelopeImpl soapEnvelope = (SOAPEnvelopeImpl)soapMessage.getSOAPPart().getEnvelope();
+ SOAPEnvelope soapEnvelope = soapMessage.getSOAPPart().getEnvelope();
SOAPBody soapBody = soapEnvelope.getBody();
QName faultCode = faultEx.getFaultCode();
@@ -289,7 +290,7 @@
XMLFragment xmlFragment = new XMLFragment(result);
Element domElement = xmlFragment.toElement();
- SOAPFactoryImpl soapFactory = new SOAPFactoryImpl();
+ SOAPFactory soapFactory = SOAPUtils.newSOAP11Factory();
SOAPElement soapElement = soapFactory.createElement(domElement);
detail = soapFault.addDetail();
@@ -310,16 +311,10 @@
return soapMessage;
}
- private static SOAPMessageImpl createSOAPMessage() throws SOAPException
+ private static SOAPMessage createSOAPMessage() throws SOAPException
{
- MessageFactoryImpl factory = new MessageFactoryImpl();
-
- if (isSOAP12() == true)
- {
- factory.setEnvNamespace(Constants.NS_SOAP12_ENV);
- }
-
- return (SOAPMessageImpl)factory.createMessage();
+ final MessageFactory factory = isSOAP12() ? SOAPUtils.newSOAP12MessageFactory() : SOAPUtils.newSOAP11MessageFactory();
+ return factory.createMessage();
}
private static boolean isSOAP12()
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/SerializationContextJAXRPC.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/SerializationContextJAXRPC.java 2012-04-11 16:10:32 UTC (rev 16156)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/SerializationContextJAXRPC.java 2012-04-13 03:51:36 UTC (rev 16157)
@@ -33,7 +33,7 @@
import org.jboss.ws.common.JavaUtils;
import org.jboss.ws.core.binding.SerializationContext;
import org.jboss.ws.core.jaxrpc.handler.SOAPMessageContextJAXRPC;
-import org.jboss.ws.core.soap.MessageContextAssociation;
+import org.jboss.ws.core.soap.utils.MessageContextAssociation;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.jboss.ws.metadata.jaxrpcmapping.JavaXmlTypeMapping;
import org.jboss.ws.metadata.jaxrpcmapping.PackageMapping;
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/ServletEndpointContextImpl.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/ServletEndpointContextImpl.java 2012-04-11 16:10:32 UTC (rev 16156)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/ServletEndpointContextImpl.java 2012-04-13 03:51:36 UTC (rev 16157)
@@ -31,7 +31,7 @@
import javax.xml.rpc.server.ServletEndpointContext;
import org.jboss.ws.core.server.ServletRequestContext;
-import org.jboss.ws.core.soap.MessageContextAssociation;
+import org.jboss.ws.core.soap.utils.MessageContextAssociation;
/**
* Implementation of <code>ServletEndpointContext</code>
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPElementDeserializer.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPElementDeserializer.java 2012-04-11 16:10:32 UTC (rev 16156)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/SOAPElementDeserializer.java 2012-04-13 03:51:36 UTC (rev 16157)
@@ -29,7 +29,7 @@
import org.jboss.ws.core.binding.BindingException;
import org.jboss.ws.core.binding.DeserializerSupport;
import org.jboss.ws.core.binding.SerializationContext;
-import org.jboss.ws.core.soap.SOAPFactoryImpl;
+import org.jboss.ws.core.soap.utils.SOAPUtils;
import org.w3c.dom.Element;
/**
@@ -52,7 +52,7 @@
if(log.isDebugEnabled()) log.debug("deserialize: [xmlName=" + xmlName + ",xmlType=" + xmlType + "]");
try
{
- return new SOAPFactoryImpl().createElement(xmlFragment);
+ return SOAPUtils.newSOAP11Factory().createElement(xmlFragment);
}
catch (SOAPException se)
{
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/JBossXBSupport.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/JBossXBSupport.java 2012-04-11 16:10:32 UTC (rev 16156)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/binding/jbossxb/JBossXBSupport.java 2012-04-13 03:51:36 UTC (rev 16157)
@@ -28,7 +28,7 @@
import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.core.CommonMessageContext;
-import org.jboss.ws.core.soap.MessageContextAssociation;
+import org.jboss.ws.core.soap.utils.MessageContextAssociation;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.metadata.umdm.OperationMetaData;
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/client/CallImpl.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/client/CallImpl.java 2012-04-11 16:10:32 UTC (rev 16156)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/client/CallImpl.java 2012-04-13 03:51:36 UTC (rev 16157)
@@ -62,7 +62,7 @@
import org.jboss.ws.core.jaxrpc.handler.HandlerChainBaseImpl;
import org.jboss.ws.core.jaxrpc.handler.MessageContextJAXRPC;
import org.jboss.ws.core.jaxrpc.handler.SOAPMessageContextJAXRPC;
-import org.jboss.ws.core.soap.MessageContextAssociation;
+import org.jboss.ws.core.soap.utils.MessageContextAssociation;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.metadata.umdm.OperationMetaData;
import org.jboss.ws.metadata.umdm.ParameterMetaData;
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerChainBaseImpl.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerChainBaseImpl.java 2012-04-11 16:10:32 UTC (rev 16156)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerChainBaseImpl.java 2012-04-13 03:51:36 UTC (rev 16157)
@@ -44,9 +44,8 @@
import org.jboss.logging.Logger;
import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.Constants;
-import org.jboss.ws.core.soap.SOAPElementImpl;
-import org.jboss.ws.core.soap.SOAPElementWriter;
import org.jboss.ws.core.soap.SOAPEnvelopeImpl;
+import org.jboss.ws.core.soap.utils.SOAPElementWriter;
import org.jboss.wsf.spi.deployment.Endpoint;
import org.jboss.wsf.spi.invocation.EndpointAssociation;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData.HandlerType;
@@ -455,7 +454,7 @@
try
{
SOAPEnvelopeImpl soapEnv = (SOAPEnvelopeImpl)soapPart.getEnvelope();
- String envStr = SOAPElementWriter.writeElement((SOAPElementImpl)soapEnv, true);
+ String envStr = SOAPElementWriter.writeElement(soapEnv, true);
if (envStr.equals(lastMessageTrace))
{
log.trace(logMsg + ": unchanged");
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerDelegateJAXRPC.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerDelegateJAXRPC.java 2012-04-11 16:10:32 UTC (rev 16156)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxrpc/handler/HandlerDelegateJAXRPC.java 2012-04-13 03:51:36 UTC (rev 16157)
@@ -35,7 +35,7 @@
import org.jboss.logging.Logger;
import org.jboss.ws.core.RoleSource;
import org.jboss.ws.core.server.ServerHandlerDelegate;
-import org.jboss.ws.core.soap.MessageContextAssociation;
+import org.jboss.ws.core.soap.utils.MessageContextAssociation;
import org.jboss.ws.metadata.umdm.HandlerMetaData;
import org.jboss.ws.metadata.umdm.HandlerMetaDataJAXRPC;
import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java 2012-04-11 16:10:32 UTC (rev 16156)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvoker.java 2012-04-13 03:51:36 UTC (rev 16157)
@@ -33,6 +33,7 @@
import javax.xml.soap.SOAPBodyElement;
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPHeader;
+import javax.xml.soap.SOAPMessage;
import org.jboss.logging.Logger;
import org.jboss.ws.api.util.BundleUtils;
@@ -46,14 +47,13 @@
import org.jboss.ws.core.DirectionHolder;
import org.jboss.ws.core.DirectionHolder.Direction;
import org.jboss.ws.core.EndpointInvocation;
-import org.jboss.ws.core.MessageAbstraction;
import org.jboss.ws.core.jaxrpc.ServletEndpointContextImpl;
import org.jboss.ws.core.jaxrpc.handler.HandlerDelegateJAXRPC;
import org.jboss.ws.core.jaxrpc.handler.MessageContextJAXRPC;
import org.jboss.ws.core.jaxrpc.handler.SOAPMessageContextJAXRPC;
-import org.jboss.ws.core.soap.MessageContextAssociation;
import org.jboss.ws.core.soap.SOAPBodyImpl;
-import org.jboss.ws.core.soap.SOAPMessageImpl;
+import org.jboss.ws.core.soap.SOAPMessageDispatcher;
+import org.jboss.ws.core.soap.utils.MessageContextAssociation;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.metadata.umdm.OperationMetaData;
import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
@@ -116,7 +116,7 @@
{
CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
ServerEndpointMetaData sepMetaData = (ServerEndpointMetaData)msgContext.getEndpointMetaData();
- MessageAbstraction reqMessage = msgContext.getMessageAbstraction();
+ SOAPMessage reqMessage = msgContext.getSOAPMessage();
// The direction of the message
DirectionHolder direction = new DirectionHolder(Direction.InBound);
@@ -171,7 +171,7 @@
if (msgContext.isModified())
{
log.debug("Handler modified payload, unbind message again");
- reqMessage = msgContext.getMessageAbstraction();
+ reqMessage = msgContext.getSOAPMessage();
sepInv = binding.unbindRequestMessage(opMetaData, reqMessage);
}
@@ -197,15 +197,15 @@
msgContext = processPivotInternal(msgContext, direction);
// Bind the response message
- MessageAbstraction resMessage = binding.bindResponseMessage(opMetaData, sepInv);
- msgContext.setMessageAbstraction(resMessage);
+ SOAPMessage resMessage = binding.bindResponseMessage(opMetaData, sepInv);
+ msgContext.setSOAPMessage(resMessage);
}
else
{
// Reverse the message direction without calling the endpoint
- MessageAbstraction resMessage = msgContext.getMessageAbstraction();
+ SOAPMessage resMessage = msgContext.getSOAPMessage();
msgContext = processPivotInternal(msgContext, direction);
- msgContext.setMessageAbstraction(resMessage);
+ msgContext.setSOAPMessage(resMessage);
}
if (oneway == false)
@@ -352,12 +352,12 @@
return msgContext;
}
- private OperationMetaData getDispatchDestination(EndpointMetaData epMetaData, MessageAbstraction reqMessage) throws SOAPException
+ private OperationMetaData getDispatchDestination(EndpointMetaData epMetaData, SOAPMessage reqMessage) throws SOAPException
{
OperationMetaData opMetaData;
- SOAPMessageImpl soapMessage = (SOAPMessageImpl)reqMessage;
- opMetaData = soapMessage.getOperationMetaData(epMetaData);
+ SOAPMessage soapMessage = reqMessage;
+ opMetaData = getOperationMetaData(epMetaData, soapMessage);
SOAPHeader soapHeader = soapMessage.getSOAPHeader();
// Report a MustUnderstand fault
@@ -392,4 +392,14 @@
}
return opMetaData;
}
+
+ /** Get the operation meta data for this SOAP message
+ */
+ public OperationMetaData getOperationMetaData(EndpointMetaData epMetaData, SOAPMessage soapMsg) throws SOAPException
+ {
+ SOAPMessageDispatcher dispatcher = new SOAPMessageDispatcher();
+ return dispatcher.getDispatchDestination(epMetaData, soapMsg);
+ }
+
+
}
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvokerEJB21.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvokerEJB21.java 2012-04-11 16:10:32 UTC (rev 16156)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/server/ServiceEndpointInvokerEJB21.java 2012-04-13 03:51:36 UTC (rev 16157)
@@ -28,7 +28,7 @@
import org.jboss.ws.core.CommonMessageContext;
import org.jboss.ws.core.EndpointInvocation;
import org.jboss.ws.core.binding.BindingException;
-import org.jboss.ws.core.soap.MessageContextAssociation;
+import org.jboss.ws.core.soap.utils.MessageContextAssociation;
import org.jboss.ws.metadata.umdm.OperationMetaData;
import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
import org.jboss.wsf.spi.deployment.Endpoint;
@@ -120,7 +120,7 @@
CommonBinding binding = bindingProvider.getCommonBinding();
log.debug("Handler modified payload, unbind message and update invocation args");
- EndpointInvocation epInv = binding.unbindRequestMessage(opMetaData, messageContext.getMessageAbstraction());
+ EndpointInvocation epInv = binding.unbindRequestMessage(opMetaData, messageContext.getSOAPMessage());
wsInv.getInvocationContext().addAttachment(EndpointInvocation.class, epInv);
}
catch (BindingException ex)
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/EnvelopeBuilder.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/EnvelopeBuilder.java 2012-04-11 16:10:32 UTC (rev 16156)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/EnvelopeBuilder.java 2012-04-13 03:51:36 UTC (rev 16157)
@@ -30,6 +30,7 @@
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPMessage;
+import org.jboss.ws.core.soap.utils.Style;
import org.w3c.dom.Element;
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/EnvelopeBuilderDOM.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/EnvelopeBuilderDOM.java 2012-04-11 16:10:32 UTC (rev 16156)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/EnvelopeBuilderDOM.java 2012-04-13 03:51:36 UTC (rev 16157)
@@ -44,6 +44,7 @@
import org.jboss.ws.common.Constants;
import org.jboss.ws.common.DOMUtils;
import org.jboss.ws.core.CommonSOAPFaultException;
+import org.jboss.ws.core.soap.utils.Style;
import org.w3c.dom.Comment;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
Deleted: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/MessageContextAssociation.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/MessageContextAssociation.java 2012-04-11 16:10:32 UTC (rev 16156)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/MessageContextAssociation.java 2012-04-13 03:51:36 UTC (rev 16157)
@@ -1,88 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.core.soap;
-
-import java.util.Stack;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.common.DOMUtils;
-import org.jboss.ws.core.CommonMessageContext;
-import org.jboss.ws.core.utils.ThreadLocalAssociation;
-
-/**
- * A thread local association with the current message context
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 14-Dec-2004
- */
-public class MessageContextAssociation
-{
- // provide logging
- private static Logger log = Logger.getLogger(MessageContextAssociation.class);
-
- public static void pushMessageContext(CommonMessageContext msgContext)
- {
- if (log.isDebugEnabled())
- log.debug("pushMessageContext: " + msgContext + " (Thread " + Thread.currentThread().getName() + ")");
- Stack<CommonMessageContext> stack = ThreadLocalAssociation.localMsgContextAssoc().get();
- if (stack == null)
- {
- stack = new Stack<CommonMessageContext>();
- ThreadLocalAssociation.localMsgContextAssoc().set(stack);
- }
- stack.push(msgContext);
- }
-
- public static CommonMessageContext peekMessageContext()
- {
- CommonMessageContext msgContext = null;
- Stack<CommonMessageContext> stack = ThreadLocalAssociation.localMsgContextAssoc().get();
- if (stack != null && stack.isEmpty() == false)
- {
- msgContext = stack.peek();
- }
- return msgContext;
- }
-
- public static CommonMessageContext popMessageContext()
- {
- return popMessageContext(true);
- }
-
- public static CommonMessageContext popMessageContext(boolean clearDOMIfEmpty)
- {
- CommonMessageContext msgContext = null;
- Stack<CommonMessageContext> stack = ThreadLocalAssociation.localMsgContextAssoc().get();
- if (stack != null && stack.isEmpty() == false)
- {
- msgContext = stack.pop();
- if (stack.isEmpty() == true && clearDOMIfEmpty == true)
- {
- DOMUtils.clearThreadLocals();
- }
- }
- if (log.isDebugEnabled())
- log.debug("popMessageContext: " + msgContext + " (Thread " + Thread.currentThread().getName() + ")");
- return msgContext;
- }
-
-}
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/MessageFactoryImpl.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/MessageFactoryImpl.java 2012-04-11 16:10:32 UTC (rev 16156)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/MessageFactoryImpl.java 2012-04-13 03:51:36 UTC (rev 16157)
@@ -46,6 +46,8 @@
import org.jboss.ws.core.CommonMessageContext;
import org.jboss.ws.core.soap.attachment.MimeConstants;
import org.jboss.ws.core.soap.attachment.MultipartRelatedDecoder;
+import org.jboss.ws.core.soap.utils.MessageContextAssociation;
+import org.jboss.ws.core.soap.utils.Style;
/**
* MessageFactory implementation
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/ObjectContent.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/ObjectContent.java 2012-04-11 16:10:32 UTC (rev 16156)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/ObjectContent.java 2012-04-13 03:51:36 UTC (rev 16157)
@@ -39,6 +39,7 @@
import org.jboss.ws.core.binding.SerializerSupport;
import org.jboss.ws.core.binding.TypeMappingImpl;
import org.jboss.ws.core.jaxrpc.binding.NullValueSerializer;
+import org.jboss.ws.core.soap.utils.MessageContextAssociation;
import org.jboss.ws.metadata.umdm.OperationMetaData;
import org.jboss.ws.metadata.umdm.ParameterMetaData;
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPConnectionImpl.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPConnectionImpl.java 2012-04-11 16:10:32 UTC (rev 16156)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPConnectionImpl.java 2012-04-13 03:51:36 UTC (rev 16157)
@@ -28,7 +28,6 @@
import javax.xml.soap.SOAPMessage;
import org.jboss.ws.api.util.BundleUtils;
-import org.jboss.ws.core.MessageAbstraction;
import org.jboss.ws.core.client.HTTPRemotingConnection;
import org.jboss.ws.core.client.RemoteConnection;
import org.jboss.ws.core.client.SOAPProtocolConnectionHTTP;
@@ -62,8 +61,7 @@
if (reqMessage == null)
throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "SOAPMESSAGE_CANNOT_BE_NULL"));
- MessageAbstraction resMessage = callInternal(reqMessage, endpoint, false);
- return (SOAPMessage)resMessage;
+ return callInternal(reqMessage, endpoint, false);
}
/**
@@ -72,8 +70,7 @@
@Override
public SOAPMessage get(Object endpoint) throws SOAPException
{
- MessageAbstraction resMessage = callInternal(null, endpoint, false);
- return (SOAPMessage)resMessage;
+ return callInternal(null, endpoint, false);
}
/**
@@ -85,8 +82,7 @@
if (reqMessage == null)
throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "SOAPMESSAGE_CANNOT_BE_NULL"));
- MessageAbstraction resMessage = callInternal(reqMessage, endpoint, true);
- return (SOAPMessage)resMessage;
+ return callInternal(reqMessage, endpoint, true);
}
private RemoteConnection getRemotingConnection(Object endpoint)
@@ -113,12 +109,12 @@
}
}
- private MessageAbstraction callInternal(SOAPMessage reqMessage, Object endpoint, boolean oneway) throws SOAPException
+ private SOAPMessage callInternal(SOAPMessage reqMessage, Object endpoint, boolean oneway) throws SOAPException
{
try
{
remotingConnection = getRemotingConnection(endpoint);
- MessageAbstraction resMessage = remotingConnection.invoke((SOAPMessageImpl)reqMessage, endpoint, oneway);
+ SOAPMessage resMessage = remotingConnection.invoke((SOAPMessageImpl)reqMessage, endpoint, oneway);
return resMessage;
}
catch (Exception ex)
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPContentElement.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPContentElement.java 2012-04-11 16:10:32 UTC (rev 16156)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPContentElement.java 2012-04-13 03:51:36 UTC (rev 16157)
@@ -38,6 +38,7 @@
import org.jboss.ws.common.DOMWriter;
import org.jboss.ws.core.CommonMessageContext;
import org.jboss.ws.core.soap.SOAPContent.State;
+import org.jboss.ws.core.soap.utils.MessageContextAssociation;
import org.jboss.ws.metadata.umdm.ParameterMetaData;
import org.w3c.dom.Attr;
import org.w3c.dom.DOMException;
Deleted: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPElementWriter.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPElementWriter.java 2012-04-11 16:10:32 UTC (rev 16156)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPElementWriter.java 2012-04-13 03:51:36 UTC (rev 16157)
@@ -1,160 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.core.soap;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.OutputStreamWriter;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.io.UnsupportedEncodingException;
-import java.io.Writer;
-import java.util.ResourceBundle;
-
-import javax.xml.soap.SOAPEnvelope;
-
-import org.jboss.ws.WSException;
-import org.jboss.ws.api.util.BundleUtils;
-import org.jboss.ws.common.DOMUtils;
-import org.jboss.ws.common.DOMWriter;
-
-/**
- * Writes a SAAJ elements to an output stream.
- *
- * @author Heiko Braun <heiko.braun(a)jboss.com>
- * @author Thomas.Diesler(a)jboss.com
- * @since 4-Aug-2006
- */
-public class SOAPElementWriter
-{
- private static final ResourceBundle bundle = BundleUtils.getBundle(SOAPElementWriter.class);
-
- // Print writer
- private PrintWriter out;
- // True, if the XML declaration should be written
- private boolean writeXMLDeclaration;
- // Explicit character set encoding
- private String charsetName;
-
- public SOAPElementWriter(Writer w)
- {
- this.out = new PrintWriter(w);
- }
-
- public SOAPElementWriter(OutputStream stream)
- {
- try
- {
- this.out = new PrintWriter(new OutputStreamWriter(stream, "UTF-8"));
- }
- catch (UnsupportedEncodingException e)
- {
- // ignore, UTF-8 should be available
- }
- }
-
- public SOAPElementWriter(OutputStream stream, String charsetName)
- {
- try
- {
- this.out = new PrintWriter(new OutputStreamWriter(stream, charsetName));
- this.charsetName = charsetName;
- }
- catch (UnsupportedEncodingException e)
- {
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "UNSUPPORTED_ENCODING", charsetName));
- }
- }
-
- /**
- * Set wheter the XML declaration should be written.
- * The default is false.
- */
- public SOAPElementWriter setWriteXMLDeclaration(boolean writeXMLDeclaration)
- {
- this.writeXMLDeclaration = writeXMLDeclaration;
- return this;
- }
-
- /**
- * Print a node with explicit prettyprinting.
- * The defaults for all other DOMWriter properties apply.
- */
- public static String writeElement(SOAPElementImpl element, boolean pretty)
- {
- if (element == null)
- return null;
-
- StringWriter strw = new StringWriter();
- new SOAPElementWriter(strw).writeElement(element);
- String xmlStr = strw.toString();
-
- if (pretty)
- {
- // This is expensive. Make sure it only happens for debugging
- try
- {
- // TODO: this unescapes sepcial chars, which might be quiet confusing
- // but they are actually send escaped.
- xmlStr = DOMWriter.printNode(DOMUtils.parse(xmlStr), true);
- }
- catch (IOException ex)
- {
- throw new WSException ("Cannot parse xml: " + xmlStr, ex);
- }
- }
-
- return xmlStr;
- }
-
- public void writeElement(SOAPElementImpl element)
- {
- writeElementInternal(element);
- }
-
- private void writeElementInternal(SOAPElementImpl element)
- {
- if (element != null)
- {
- try
- {
- if (writeXMLDeclaration == true && element instanceof SOAPEnvelope)
- {
- out.print("<?xml version='1.0'");
- if (charsetName != null)
- out.print(" encoding='" + charsetName + "'");
-
- out.println("?>");
- writeXMLDeclaration = false;
- }
-
- element.writeElement(out);
-
- out.flush();
- }
- catch (IOException ex)
- {
- throw new WSException(BundleUtils.getMessage(bundle, "CANNOT_WRITE_SOAP_ELEMENT"), ex);
- }
- }
- }
-}
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPMessageDispatcher.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPMessageDispatcher.java 2012-04-11 16:10:32 UTC (rev 16156)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPMessageDispatcher.java 2012-04-13 03:51:36 UTC (rev 16157)
@@ -33,6 +33,7 @@
import org.jboss.logging.Logger;
import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.core.soap.utils.Style;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.metadata.umdm.OperationMetaData;
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPMessageImpl.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPMessageImpl.java 2012-04-11 16:10:32 UTC (rev 16156)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPMessageImpl.java 2012-04-13 03:51:36 UTC (rev 16157)
@@ -42,7 +42,6 @@
import javax.xml.soap.SOAPElement;
import javax.xml.soap.SOAPEnvelope;
import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPFault;
import javax.xml.soap.SOAPHeader;
import javax.xml.soap.SOAPMessage;
import javax.xml.soap.SOAPPart;
@@ -52,13 +51,13 @@
import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.Constants;
import org.jboss.ws.core.CommonMessageContext;
-import org.jboss.ws.core.SOAPMessageAbstraction;
import org.jboss.ws.core.soap.SOAPContent.State;
import org.jboss.ws.core.soap.attachment.AttachmentPartImpl;
-import org.jboss.ws.core.soap.attachment.CIDGenerator;
import org.jboss.ws.core.soap.attachment.MimeConstants;
import org.jboss.ws.core.soap.attachment.MultipartRelatedEncoder;
import org.jboss.ws.core.soap.attachment.MultipartRelatedSwAEncoder;
+import org.jboss.ws.core.soap.utils.MessageContextAssociation;
+import org.jboss.ws.core.soap.utils.SOAPElementWriter;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.metadata.umdm.OperationMetaData;
import org.w3c.dom.Node;
@@ -71,7 +70,7 @@
* @author Thomas.Diesler(a)jboss.org
* @author <a href="mailto:jason@stacksmash.com">Jason T. Greene</a>
*/
-public class SOAPMessageImpl extends SOAPMessage implements SOAPMessageAbstraction
+public class SOAPMessageImpl extends SOAPMessage
{
private static final ResourceBundle bundle = BundleUtils.getBundle(SOAPMessageImpl.class);
private static Logger log = Logger.getLogger(SOAPMessageImpl.class);
@@ -79,8 +78,6 @@
private boolean saveRequired = true;
private MimeHeaders mimeHeaders = new MimeHeaders();
private List<AttachmentPart> attachments = new LinkedList<AttachmentPart>();
- private CIDGenerator cidGenerator = new CIDGenerator();
- private boolean faultMessage;
private SOAPPartImpl soapPart;
private MultipartRelatedEncoder multipartRelatedEncoder;
private static final boolean writeXMLDeclaration = Boolean.getBoolean(WRITE_XML_DECLARATION);
@@ -135,23 +132,6 @@
throw new SOAPException(BundleUtils.getMessage(bundle, "CANNOT_OBTAIN_SOAPHEADER"));
}
- public CIDGenerator getCidGenerator()
- {
- return cidGenerator;
- }
-
- /**
- * Marks this <code>SOAPMessage</code> as a fault. Otherwise, the message
- * will be checked for a SOAPFault. The reason for this is to allow for
- * faults to be encrypted, in which case there is no SOAPFault.
- *
- * @param faultMessage whether this message is a fault
- */
- public void setFaultMessage(boolean faultMessage)
- {
- this.faultMessage = faultMessage;
- }
-
public void setAttachments(Collection<AttachmentPart> parts) throws SOAPException
{
for (AttachmentPart part : parts)
@@ -415,22 +395,6 @@
return opMetaData;
}
- public boolean isFaultMessage()
- {
- if (faultMessage)
- return true;
-
- SOAPFault soapFault = null;
- try
- {
- soapFault = getSOAPBody().getFault();
- }
- catch (Exception ignore)
- {
- }
- return soapFault != null;
- }
-
private boolean isWriteXMLDeclaration() throws SOAPException
{
Boolean booleanValue = new Boolean(false);
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPMessageMarshaller.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPMessageMarshaller.java 2012-04-11 16:10:32 UTC (rev 16156)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPMessageMarshaller.java 2012-04-13 03:51:36 UTC (rev 16157)
@@ -25,9 +25,9 @@
import java.io.OutputStream;
import java.util.ResourceBundle;
+import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPMessage;
-import org.jboss.logging.Logger;
import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.core.client.Marshaller;
@@ -39,8 +39,6 @@
public class SOAPMessageMarshaller implements Marshaller
{
private static final ResourceBundle bundle = BundleUtils.getBundle(SOAPMessageMarshaller.class);
- // Provide logging
- private static Logger log = Logger.getLogger(SOAPMessageMarshaller.class);
/**
* Marshaller will need to take the dataObject and convert
@@ -56,7 +54,11 @@
if ((dataObject instanceof SOAPMessage) == false)
throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "NOT_A_SOAPMESSAGE", dataObject));
- SOAPMessageImpl soapMessage = (SOAPMessageImpl)dataObject;
- soapMessage.writeTo(output);
+ SOAPMessage soapMessage = (SOAPMessage)dataObject;
+ try {
+ soapMessage.writeTo(output);
+ } catch (SOAPException e) {
+ throw new IOException(e);
+ }
}
}
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPPartImpl.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPPartImpl.java 2012-04-11 16:10:32 UTC (rev 16156)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/SOAPPartImpl.java 2012-04-13 03:51:36 UTC (rev 16157)
@@ -42,6 +42,7 @@
import org.jboss.logging.Logger;
import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.api.util.ServiceLoader;
+import org.jboss.ws.core.soap.utils.Style;
import org.w3c.dom.Attr;
import org.w3c.dom.CDATASection;
import org.w3c.dom.Comment;
Deleted: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/Style.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/Style.java 2012-04-11 16:10:32 UTC (rev 16156)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/Style.java 2012-04-13 03:51:36 UTC (rev 16157)
@@ -1,65 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.core.soap;
-
-import java.util.ResourceBundle;
-
-import org.jboss.ws.api.util.BundleUtils;
-
-/** A type-safe enumeration for encoding style.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 14-Oct-2004
- */
-public class Style
-{
- private static final ResourceBundle bundle = BundleUtils.getBundle(Style.class);
- private String style;
-
- public static final Style RPC = new Style("rpc");
- public static final Style DOCUMENT = new Style("document");
-
- private Style(String style)
- {
- this.style = style;
- }
-
- public static Style getDefaultStyle()
- {
- return DOCUMENT;
- }
-
- public static Style valueOf(String style)
- {
- if (RPC.style.equals(style))
- return RPC;
- if (DOCUMENT.style.equals(style))
- return DOCUMENT;
-
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "UNSUPPORTED_STYLE", style));
- }
-
- public String toString()
- {
- return style;
- }
-}
Deleted: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/Use.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/Use.java 2012-04-11 16:10:32 UTC (rev 16156)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/Use.java 2012-04-13 03:51:36 UTC (rev 16157)
@@ -1,76 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.core.soap;
-
-import java.util.ResourceBundle;
-
-import org.jboss.ws.api.util.BundleUtils;
-import org.jboss.ws.common.Constants;
-
-/** A type-safe enumeration for encoding use.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 16-Oct-2005
- */
-public class Use
-{
- private static final ResourceBundle bundle = BundleUtils.getBundle(Use.class);
- private String use;
-
- public static final Use LITERAL = new Use("literal");
- public static final Use ENCODED = new Use("encoded");
-
- private Use(String use)
- {
- this.use = use;
- }
-
- public static Use getDefaultUse()
- {
- return LITERAL;
- }
-
- public static Use valueOf(String encodingStyle)
- {
- if (Constants.URI_LITERAL_ENC.equals(encodingStyle) || LITERAL.use.equals(encodingStyle))
- return LITERAL;
- if (Constants.URI_SOAP11_ENC.equals(encodingStyle) || ENCODED.use.equals(encodingStyle))
- return ENCODED;
-
- throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "UNSUPPORTED_ENCODING_STYLE", encodingStyle));
- }
-
- public String toURI()
- {
- String encURI = null;
- if (this == LITERAL)
- encURI = Constants.URI_LITERAL_ENC;
- else if (this == ENCODED)
- encURI = Constants.URI_SOAP11_ENC;
- return encURI;
- }
-
- public String toString()
- {
- return use;
- }
-}
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/XMLContent.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/XMLContent.java 2012-04-11 16:10:32 UTC (rev 16156)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/XMLContent.java 2012-04-13 03:51:36 UTC (rev 16157)
@@ -41,6 +41,7 @@
import org.jboss.ws.core.binding.DeserializerSupport;
import org.jboss.ws.core.binding.SerializationContext;
import org.jboss.ws.core.binding.TypeMappingImpl;
+import org.jboss.ws.core.soap.utils.MessageContextAssociation;
import org.jboss.ws.metadata.umdm.OperationMetaData;
import org.jboss.ws.metadata.umdm.ParameterMetaData;
import org.w3c.dom.Comment;
Deleted: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/attachment/CIDGenerator.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/attachment/CIDGenerator.java 2012-04-11 16:10:32 UTC (rev 16156)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/attachment/CIDGenerator.java 2012-04-13 03:51:36 UTC (rev 16157)
@@ -1,76 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ws.core.soap.attachment;
-
-import java.io.UnsupportedEncodingException;
-import java.net.URLEncoder;
-import java.util.ResourceBundle;
-
-import org.jboss.logging.Logger;
-import org.jboss.ws.api.util.BundleUtils;
-import org.jboss.ws.common.utils.UUIDGenerator;
-
-/**
- * A common CID generator
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 17-Jan-2006
- */
-public class CIDGenerator
-{
- private static final ResourceBundle bundle = BundleUtils.getBundle(CIDGenerator.class);
- // provide logging
- private static Logger log = Logger.getLogger(CIDGenerator.class);
-
- private int count = 0;
-
- public String generateFromCount()
- {
- StringBuilder cid = new StringBuilder();
- long time = System.currentTimeMillis();
-
- cid.append(count++).append("-").append(time).append("-")
- .append(cid.hashCode()).append("@").append(MimeConstants.CID_DOMAIN);
-
- if(log.isDebugEnabled()) log.debug("generateFromCount: " + cid);
- return cid.toString();
- }
-
- public String generateFromName(String name)
- {
-
- // See http://www.ietf.org/rfc/rfc2392.txt on rules howto create cid's
- // TODO: URL decode when cid's are received
- try
- {
- name = URLEncoder.encode(name, "UTF-8");
- }
- catch (UnsupportedEncodingException ex)
- {
- log.error(BundleUtils.getMessage(bundle, "CANNOT_ENCODE_NAME", ex));
- }
-
- String cid = name + "-" + UUIDGenerator.generateRandomUUIDString() + "@" + MimeConstants.CID_DOMAIN;
- if(log.isDebugEnabled()) log.debug("generateFromName: " + cid);
- return cid;
- }
-}
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/attachment/MultipartRelatedEncoder.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/attachment/MultipartRelatedEncoder.java 2012-04-11 16:10:32 UTC (rev 16156)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/attachment/MultipartRelatedEncoder.java 2012-04-13 03:51:36 UTC (rev 16157)
@@ -33,9 +33,10 @@
import javax.xml.soap.AttachmentPart;
import javax.xml.soap.MimeHeader;
import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
import org.jboss.ws.api.util.BundleUtils;
-import org.jboss.ws.core.soap.SOAPMessageImpl;
+import org.jboss.ws.core.soap.utils.CIDGenerator;
/**
* MultipartRelatedEncoder encodes a SOAPMessage
@@ -47,10 +48,10 @@
public abstract class MultipartRelatedEncoder
{
private static final ResourceBundle bundle = BundleUtils.getBundle(MultipartRelatedEncoder.class);
- protected SOAPMessageImpl soapMessage;
+ protected SOAPMessage soapMessage;
protected MimeMultipart multipart;
- public MultipartRelatedEncoder(SOAPMessageImpl soapMessage) throws SOAPException
+ public MultipartRelatedEncoder(SOAPMessage soapMessage) throws SOAPException
{
this.soapMessage = soapMessage;
}
@@ -83,8 +84,7 @@
if (mimePart.getHeader(MimeConstants.CONTENT_ID) == null)
{
- CIDGenerator cidGenerator = soapMessage.getCidGenerator();
- mimePart.setHeader(MimeConstants.CONTENT_ID, cidGenerator.generateFromCount());
+ mimePart.setHeader(MimeConstants.CONTENT_ID, CIDGenerator.generateFromCount());
}
// TODO - Binary encoding is the most efficient, however, some transports (old mail servers)
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/attachment/MultipartRelatedSwAEncoder.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/attachment/MultipartRelatedSwAEncoder.java 2012-04-11 16:10:32 UTC (rev 16156)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/attachment/MultipartRelatedSwAEncoder.java 2012-04-13 03:51:36 UTC (rev 16157)
@@ -29,10 +29,9 @@
import javax.mail.internet.ParameterList;
import javax.xml.soap.SOAPEnvelope;
import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
-import org.jboss.ws.core.soap.SOAPElementImpl;
-import org.jboss.ws.core.soap.SOAPElementWriter;
-import org.jboss.ws.core.soap.SOAPMessageImpl;
+import org.jboss.ws.core.soap.utils.SOAPElementWriter;
/**
* MultipartRelatedEncoder encodes a SOAPMessage
@@ -49,7 +48,7 @@
*
* @param soapMessage the SOAP message to be sent as a root part
*/
- public MultipartRelatedSwAEncoder(SOAPMessageImpl soapMessage) throws SOAPException
+ public MultipartRelatedSwAEncoder(SOAPMessage soapMessage) throws SOAPException
{
super(soapMessage);
}
@@ -70,7 +69,7 @@
* stream.
*/
SOAPEnvelope soapEnv = soapMessage.getSOAPPart().getEnvelope();
- String envStr = SOAPElementWriter.writeElement((SOAPElementImpl)soapEnv, false);
+ String envStr = SOAPElementWriter.writeElement(soapEnv, false);
rootPart.setText(envStr, "UTF-8");
rootPart.setContentID(MimeConstants.ROOTPART_CID);
Added: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/utils/CIDGenerator.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/utils/CIDGenerator.java (rev 0)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/utils/CIDGenerator.java 2012-04-13 03:51:36 UTC (rev 16157)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.core.soap.utils;
+
+import org.jboss.ws.core.soap.attachment.MimeConstants;
+
+/**
+ * A common CID generator
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 17-Jan-2006
+ */
+public final class CIDGenerator
+{
+ private static int count = 0;
+
+ private CIDGenerator() {
+ // forbidden instantiation
+ }
+
+ public static synchronized String generateFromCount()
+ {
+ if (count == 1000) count = 0;
+ StringBuilder cid = new StringBuilder();
+ long time = System.currentTimeMillis();
+
+ cid.append(count++).append("-").append(time).append("-")
+ .append(cid.hashCode()).append("@").append(MimeConstants.CID_DOMAIN);
+
+ return cid.toString();
+ }
+}
Added: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/utils/Message.properties
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/utils/Message.properties (rev 0)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/utils/Message.properties 2012-04-13 03:51:36 UTC (rev 16157)
@@ -0,0 +1,2 @@
+UNSUPPORTED_ENCODING_STYLE=Unsupported encoding style: {0}
+UNSUPPORTED_STYLE=Unsupported style: {0}
Added: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/utils/MessageContextAssociation.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/utils/MessageContextAssociation.java (rev 0)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/utils/MessageContextAssociation.java 2012-04-13 03:51:36 UTC (rev 16157)
@@ -0,0 +1,88 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.core.soap.utils;
+
+import java.util.Stack;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.common.DOMUtils;
+import org.jboss.ws.core.CommonMessageContext;
+import org.jboss.ws.core.utils.ThreadLocalAssociation;
+
+/**
+ * A thread local association with the current message context
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 14-Dec-2004
+ */
+public class MessageContextAssociation
+{
+ // provide logging
+ private static Logger log = Logger.getLogger(MessageContextAssociation.class);
+
+ public static void pushMessageContext(CommonMessageContext msgContext)
+ {
+ if (log.isDebugEnabled())
+ log.debug("pushMessageContext: " + msgContext + " (Thread " + Thread.currentThread().getName() + ")");
+ Stack<CommonMessageContext> stack = ThreadLocalAssociation.localMsgContextAssoc().get();
+ if (stack == null)
+ {
+ stack = new Stack<CommonMessageContext>();
+ ThreadLocalAssociation.localMsgContextAssoc().set(stack);
+ }
+ stack.push(msgContext);
+ }
+
+ public static CommonMessageContext peekMessageContext()
+ {
+ CommonMessageContext msgContext = null;
+ Stack<CommonMessageContext> stack = ThreadLocalAssociation.localMsgContextAssoc().get();
+ if (stack != null && stack.isEmpty() == false)
+ {
+ msgContext = stack.peek();
+ }
+ return msgContext;
+ }
+
+ public static CommonMessageContext popMessageContext()
+ {
+ return popMessageContext(true);
+ }
+
+ public static CommonMessageContext popMessageContext(boolean clearDOMIfEmpty)
+ {
+ CommonMessageContext msgContext = null;
+ Stack<CommonMessageContext> stack = ThreadLocalAssociation.localMsgContextAssoc().get();
+ if (stack != null && stack.isEmpty() == false)
+ {
+ msgContext = stack.pop();
+ if (stack.isEmpty() == true && clearDOMIfEmpty == true)
+ {
+ DOMUtils.clearThreadLocals();
+ }
+ }
+ if (log.isDebugEnabled())
+ log.debug("popMessageContext: " + msgContext + " (Thread " + Thread.currentThread().getName() + ")");
+ return msgContext;
+ }
+
+}
Added: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/utils/SOAPElementWriter.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/utils/SOAPElementWriter.java (rev 0)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/utils/SOAPElementWriter.java 2012-04-13 03:51:36 UTC (rev 16157)
@@ -0,0 +1,162 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.core.soap.utils;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.io.UnsupportedEncodingException;
+import java.io.Writer;
+import java.util.ResourceBundle;
+
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPEnvelope;
+
+import org.jboss.ws.WSException;
+import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.common.DOMUtils;
+import org.jboss.ws.common.DOMWriter;
+import org.jboss.ws.core.soap.SOAPElementImpl;
+
+/**
+ * Writes a SAAJ elements to an output stream.
+ *
+ * @author Heiko Braun <heiko.braun(a)jboss.com>
+ * @author Thomas.Diesler(a)jboss.com
+ * @since 4-Aug-2006
+ */
+public class SOAPElementWriter
+{
+ private static final ResourceBundle bundle = BundleUtils.getBundle(SOAPElementWriter.class);
+
+ // Print writer
+ private PrintWriter out;
+ // True, if the XML declaration should be written
+ private boolean writeXMLDeclaration;
+ // Explicit character set encoding
+ private String charsetName;
+
+ public SOAPElementWriter(Writer w)
+ {
+ this.out = new PrintWriter(w);
+ }
+
+ public SOAPElementWriter(OutputStream stream)
+ {
+ try
+ {
+ this.out = new PrintWriter(new OutputStreamWriter(stream, "UTF-8"));
+ }
+ catch (UnsupportedEncodingException e)
+ {
+ // ignore, UTF-8 should be available
+ }
+ }
+
+ public SOAPElementWriter(OutputStream stream, String charsetName)
+ {
+ try
+ {
+ this.out = new PrintWriter(new OutputStreamWriter(stream, charsetName));
+ this.charsetName = charsetName;
+ }
+ catch (UnsupportedEncodingException e)
+ {
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "UNSUPPORTED_ENCODING", charsetName));
+ }
+ }
+
+ /**
+ * Set wheter the XML declaration should be written.
+ * The default is false.
+ */
+ public SOAPElementWriter setWriteXMLDeclaration(boolean writeXMLDeclaration)
+ {
+ this.writeXMLDeclaration = writeXMLDeclaration;
+ return this;
+ }
+
+ /**
+ * Print a node with explicit prettyprinting.
+ * The defaults for all other DOMWriter properties apply.
+ */
+ public static String writeElement(SOAPElement element, boolean pretty)
+ {
+ if (element == null)
+ return null;
+
+ StringWriter strw = new StringWriter();
+ new SOAPElementWriter(strw).writeElement(element);
+ String xmlStr = strw.toString();
+
+ if (pretty)
+ {
+ // This is expensive. Make sure it only happens for debugging
+ try
+ {
+ // TODO: this unescapes sepcial chars, which might be quiet confusing
+ // but they are actually send escaped.
+ xmlStr = DOMWriter.printNode(DOMUtils.parse(xmlStr), true);
+ }
+ catch (IOException ex)
+ {
+ throw new WSException ("Cannot parse xml: " + xmlStr, ex);
+ }
+ }
+
+ return xmlStr;
+ }
+
+ public void writeElement(SOAPElement element)
+ {
+ writeElementInternal((SOAPElementImpl)element);
+ }
+
+ private void writeElementInternal(SOAPElementImpl element)
+ {
+ if (element != null)
+ {
+ try
+ {
+ if (writeXMLDeclaration == true && element instanceof SOAPEnvelope)
+ {
+ out.print("<?xml version='1.0'");
+ if (charsetName != null)
+ out.print(" encoding='" + charsetName + "'");
+
+ out.println("?>");
+ writeXMLDeclaration = false;
+ }
+
+ element.writeElement(out);
+
+ out.flush();
+ }
+ catch (IOException ex)
+ {
+ throw new WSException(BundleUtils.getMessage(bundle, "CANNOT_WRITE_SOAP_ELEMENT"), ex);
+ }
+ }
+ }
+}
Added: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/utils/SOAPUtils.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/utils/SOAPUtils.java (rev 0)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/utils/SOAPUtils.java 2012-04-13 03:51:36 UTC (rev 16157)
@@ -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.ws.core.soap.utils;
+
+import javax.xml.soap.SOAPConstants;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.MessageFactory;
+import javax.xml.soap.SOAPFactory;
+import javax.xml.soap.SOAPMessage;
+
+import org.jboss.ws.core.soap.MessageFactoryImpl;
+import org.jboss.ws.core.soap.SOAPFactoryImpl;
+
+/**
+ * @author <a href="mailto:ropalka@redhat.com">Richard Opalka</a>
+ *
+ */
+public final class SOAPUtils {
+
+ private SOAPUtils() {
+ // forbidden instantiation
+ }
+
+ public static MessageFactory newSOAP11MessageFactory() {
+ return newMessageFactory(SOAPConstants.SOAP_1_1_PROTOCOL);
+ }
+
+ public static MessageFactory newSOAP12MessageFactory() {
+ return newMessageFactory(SOAPConstants.SOAP_1_2_PROTOCOL);
+ }
+
+ private static MessageFactory newMessageFactory(final String protocol) {
+ try {
+ return new MessageFactoryImpl(protocol);
+ } catch (final SOAPException ignore) {
+ return null;
+ }
+ // TODO: use standard SOAP API to create objects
+ //return MessageFactory.newInstance()
+ }
+
+ public static SOAPFactory newSOAP11Factory() {
+ return newSOAPFactory(SOAPConstants.SOAP_1_1_PROTOCOL);
+ }
+
+ public static SOAPFactory newSOAP12Factory() {
+ return newSOAPFactory(SOAPConstants.SOAP_1_2_PROTOCOL);
+ }
+
+ private static SOAPFactory newSOAPFactory(final String protocol) {
+ try {
+ return new SOAPFactoryImpl(protocol);
+ } catch (final SOAPException ignore) {
+ return null;
+ }
+ // TODO: use standard SOAP API to create objects
+ //return MessageFactory.newInstance()
+ }
+
+ public static boolean isFaultMessage(final SOAPMessage msg) {
+ try {
+ return msg.getSOAPBody().getFault() != null;
+ } catch (final Exception ignore) {
+ }
+ return false;
+ }
+
+}
Added: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/utils/Style.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/utils/Style.java (rev 0)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/utils/Style.java 2012-04-13 03:51:36 UTC (rev 16157)
@@ -0,0 +1,65 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.core.soap.utils;
+
+import java.util.ResourceBundle;
+
+import org.jboss.ws.api.util.BundleUtils;
+
+/** A type-safe enumeration for encoding style.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 14-Oct-2004
+ */
+public class Style
+{
+ private static final ResourceBundle bundle = BundleUtils.getBundle(Style.class);
+ private String style;
+
+ public static final Style RPC = new Style("rpc");
+ public static final Style DOCUMENT = new Style("document");
+
+ private Style(String style)
+ {
+ this.style = style;
+ }
+
+ public static Style getDefaultStyle()
+ {
+ return DOCUMENT;
+ }
+
+ public static Style valueOf(String style)
+ {
+ if (RPC.style.equals(style))
+ return RPC;
+ if (DOCUMENT.style.equals(style))
+ return DOCUMENT;
+
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "UNSUPPORTED_STYLE", style));
+ }
+
+ public String toString()
+ {
+ return style;
+ }
+}
Added: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/utils/Use.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/utils/Use.java (rev 0)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/soap/utils/Use.java 2012-04-13 03:51:36 UTC (rev 16157)
@@ -0,0 +1,76 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.ws.core.soap.utils;
+
+import java.util.ResourceBundle;
+
+import org.jboss.ws.api.util.BundleUtils;
+import org.jboss.ws.common.Constants;
+
+/** A type-safe enumeration for encoding use.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 16-Oct-2005
+ */
+public class Use
+{
+ private static final ResourceBundle bundle = BundleUtils.getBundle(Use.class);
+ private String use;
+
+ public static final Use LITERAL = new Use("literal");
+ public static final Use ENCODED = new Use("encoded");
+
+ private Use(String use)
+ {
+ this.use = use;
+ }
+
+ public static Use getDefaultUse()
+ {
+ return LITERAL;
+ }
+
+ public static Use valueOf(String encodingStyle)
+ {
+ if (Constants.URI_LITERAL_ENC.equals(encodingStyle) || LITERAL.use.equals(encodingStyle))
+ return LITERAL;
+ if (Constants.URI_SOAP11_ENC.equals(encodingStyle) || ENCODED.use.equals(encodingStyle))
+ return ENCODED;
+
+ throw new IllegalArgumentException(BundleUtils.getMessage(bundle, "UNSUPPORTED_ENCODING_STYLE", encodingStyle));
+ }
+
+ public String toURI()
+ {
+ String encURI = null;
+ if (this == LITERAL)
+ encURI = Constants.URI_LITERAL_ENC;
+ else if (this == ENCODED)
+ encURI = Constants.URI_SOAP11_ENC;
+ return encURI;
+ }
+
+ public String toString()
+ {
+ return use;
+ }
+}
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java 2012-04-11 16:10:32 UTC (rev 16156)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/MetaDataBuilder.java 2012-04-13 03:51:36 UTC (rev 16157)
@@ -48,7 +48,7 @@
import org.jboss.ws.common.Constants;
import org.jboss.ws.common.ObjectNameFactory;
import org.jboss.ws.core.jaxrpc.UnqualifiedFaultException;
-import org.jboss.ws.core.soap.Use;
+import org.jboss.ws.core.soap.utils.Use;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.metadata.umdm.FaultMetaData;
import org.jboss.ws.metadata.umdm.OperationMetaData;
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCMetaDataBuilder.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCMetaDataBuilder.java 2012-04-11 16:10:32 UTC (rev 16156)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/builder/jaxrpc/JAXRPCMetaDataBuilder.java 2012-04-13 03:51:36 UTC (rev 16157)
@@ -40,8 +40,8 @@
import org.jboss.ws.core.jaxrpc.EncodedTypeMapping;
import org.jboss.ws.core.jaxrpc.LiteralTypeMapping;
import org.jboss.ws.core.jaxrpc.TypeMappingRegistryImpl;
-import org.jboss.ws.core.soap.Style;
-import org.jboss.ws.core.soap.Use;
+import org.jboss.ws.core.soap.utils.Style;
+import org.jboss.ws.core.soap.utils.Use;
import org.jboss.ws.metadata.builder.MetaDataBuilder;
import org.jboss.ws.metadata.jaxrpcmapping.ExceptionMapping;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java 2012-04-11 16:10:32 UTC (rev 16156)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java 2012-04-13 03:51:36 UTC (rev 16157)
@@ -44,8 +44,8 @@
import org.jboss.ws.core.jaxrpc.binding.JBossXBSerializerFactory;
import org.jboss.ws.core.jaxrpc.binding.SOAPArrayDeserializerFactory;
import org.jboss.ws.core.jaxrpc.binding.SOAPArraySerializerFactory;
-import org.jboss.ws.core.soap.Style;
-import org.jboss.ws.core.soap.Use;
+import org.jboss.ws.core.soap.utils.Style;
+import org.jboss.ws.core.soap.utils.Use;
import org.jboss.ws.metadata.accessor.AccessorFactory;
import org.jboss.ws.metadata.accessor.AccessorFactoryCreator;
import org.jboss.wsf.spi.metadata.j2ee.serviceref.UnifiedHandlerMetaData.HandlerType;
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/OperationMetaData.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/OperationMetaData.java 2012-04-11 16:10:32 UTC (rev 16156)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/OperationMetaData.java 2012-04-13 03:51:36 UTC (rev 16157)
@@ -36,8 +36,8 @@
import org.jboss.ws.WSException;
import org.jboss.ws.api.util.BundleUtils;
import org.jboss.ws.common.JavaUtils;
-import org.jboss.ws.core.soap.Style;
-import org.jboss.ws.core.soap.Use;
+import org.jboss.ws.core.soap.utils.Style;
+import org.jboss.ws.core.soap.utils.Use;
import org.w3c.dom.Element;
/**
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/ServiceMetaData.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/ServiceMetaData.java 2012-04-11 16:10:32 UTC (rev 16156)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/metadata/umdm/ServiceMetaData.java 2012-04-13 03:51:36 UTC (rev 16157)
@@ -42,7 +42,7 @@
import org.jboss.ws.core.binding.TypeMappingImpl;
import org.jboss.ws.core.jaxrpc.TypeMappingRegistryImpl;
import org.jboss.ws.core.jaxrpc.binding.jbossxb.SchemaBindingBuilder;
-import org.jboss.ws.core.soap.Use;
+import org.jboss.ws.core.soap.utils.Use;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMapping;
import org.jboss.ws.metadata.jaxrpcmapping.JavaWsdlMappingFactory;
import org.jboss.ws.metadata.wsdl.WSDLDefinitions;
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Reader.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Reader.java 2012-04-11 16:10:32 UTC (rev 16156)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/ws/tools/wsdl/WSDL11Reader.java 2012-04-13 03:51:36 UTC (rev 16157)
@@ -81,7 +81,7 @@
import org.jboss.ws.common.DOMWriter;
import org.jboss.ws.common.utils.JBossWSEntityResolver;
import org.jboss.ws.common.utils.ResourceURL;
-import org.jboss.ws.core.soap.Style;
+import org.jboss.ws.core.soap.utils.Style;
import org.jboss.ws.metadata.wsdl.Extendable;
import org.jboss.ws.metadata.wsdl.WSDLBinding;
import org.jboss.ws.metadata.wsdl.WSDLBindingMessageReference;
Modified: stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java
===================================================================
--- stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java 2012-04-11 16:10:32 UTC (rev 16156)
+++ stack/native/trunk/modules/core/src/main/java/org/jboss/wsf/stack/jbws/RequestHandlerImpl.java 2012-04-13 03:51:36 UTC (rev 16157)
@@ -54,7 +54,6 @@
import org.jboss.ws.core.CommonBindingProvider;
import org.jboss.ws.core.CommonMessageContext;
import org.jboss.ws.core.CommonSOAPFaultException;
-import org.jboss.ws.core.MessageAbstraction;
import org.jboss.ws.core.MessageTrace;
import org.jboss.ws.core.binding.BindingException;
import org.jboss.ws.core.jaxrpc.handler.MessageContextJAXRPC;
@@ -64,9 +63,9 @@
import org.jboss.ws.core.server.ServletHeaderSource;
import org.jboss.ws.core.server.ServletRequestContext;
import org.jboss.ws.core.server.WSDLRequestHandler;
-import org.jboss.ws.core.soap.MessageContextAssociation;
import org.jboss.ws.core.soap.MessageFactoryImpl;
-import org.jboss.ws.core.soap.SOAPMessageImpl;
+import org.jboss.ws.core.soap.utils.MessageContextAssociation;
+import org.jboss.ws.core.soap.utils.SOAPUtils;
import org.jboss.ws.core.utils.ThreadLocalAssociation;
import org.jboss.ws.metadata.umdm.ServerEndpointMetaData;
import org.jboss.wsf.spi.SPIProvider;
@@ -262,30 +261,27 @@
try
{
msgContext.setEndpointMetaData(sepMetaData);
- MessageAbstraction resMessage = processRequest(endpoint, headerSource, invContext, inStream);
+ SOAPMessage resMessage = processRequest(endpoint, headerSource, invContext, inStream);
CommonMessageContext reqMsgContext = msgContext;
boolean isFault = false;
- if (resMessage instanceof SOAPMessage)
- {
- SOAPPart part = ((SOAPMessage)resMessage).getSOAPPart();
- if (part == null)
- throw new SOAPException(BundleUtils.getMessage(bundle, "CANNOT_OBTAIN_SOAPPART"));
+ SOAPPart part = ((SOAPMessage)resMessage).getSOAPPart();
+ if (part == null)
+ throw new SOAPException(BundleUtils.getMessage(bundle, "CANNOT_OBTAIN_SOAPPART"));
- // R1126 An INSTANCE MUST return a "500 Internal Server Error" HTTP status code
- // if the response envelope is a Fault.
- //
- // Also, a one-way operation must show up as empty content, and can be detected
- // by a null envelope.
- SOAPEnvelope soapEnv = part.getEnvelope();
- isFault = soapEnv != null && soapEnv.getBody().hasFault();
- if (isFault)
- {
- if (httpResponse != null)
- {
- httpResponse.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
- }
- }
+ // R1126 An INSTANCE MUST return a "500 Internal Server Error" HTTP status code
+ // if the response envelope is a Fault.
+ //
+ // Also, a one-way operation must show up as empty content, and can be detected
+ // by a null envelope.
+ SOAPEnvelope soapEnv = part.getEnvelope();
+ isFault = soapEnv != null && soapEnv.getBody().hasFault();
+ if (isFault)
+ {
+ if (httpResponse != null)
+ {
+ httpResponse.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+ }
}
if (outStream != null)
@@ -312,7 +308,7 @@
private void sendResponse(Endpoint endpoint, OutputStream output, boolean isFault) throws SOAPException, IOException
{
CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
- MessageAbstraction resMessage = msgContext.getMessageAbstraction();
+ SOAPMessage resMessage = msgContext.getSOAPMessage();
if (resMessage == null)
{
@@ -326,7 +322,7 @@
/**
* Handle a request to this web service endpoint
*/
- private MessageAbstraction processRequest(Endpoint ep, MimeHeaderSource headerSource, InvocationContext reqContext, InputStream inputStream) throws BindingException
+ private SOAPMessage processRequest(Endpoint ep, MimeHeaderSource headerSource, InvocationContext reqContext, InputStream inputStream) throws BindingException
{
CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
@@ -352,13 +348,13 @@
MimeHeaders headers = (headerSource != null ? headerSource.getMimeHeaders() : null);
- MessageAbstraction reqMessage;
+ SOAPMessage reqMessage;
msgFactory.setStyle(sepMetaData.getStyle());
- reqMessage = (SOAPMessageImpl)msgFactory.createMessage(headers, inputStream);
+ reqMessage = msgFactory.createMessage(headers, inputStream);
// Associate current message with message context
- msgContext.setMessageAbstraction(reqMessage);
+ msgContext.setSOAPMessage(reqMessage);
// debug the incomming message
MessageTrace.traceMessage("Incoming Request Message", reqMessage);
@@ -375,7 +371,7 @@
msgContext = MessageContextAssociation.peekMessageContext();
// Get the response message
- MessageAbstraction resMessage = msgContext.getMessageAbstraction();
+ SOAPMessage resMessage = msgContext.getSOAPMessage();
if (resMessage != null)
postProcessResponse(headerSource, resMessage);
@@ -383,11 +379,11 @@
}
catch (Exception ex)
{
- MessageAbstraction resMessage = MessageContextAssociation.peekMessageContext().getMessageAbstraction();
+ SOAPMessage resMessage = MessageContextAssociation.peekMessageContext().getSOAPMessage();
// In case we have an exception before the invoker is called
// we create the fault message here.
- if (resMessage == null || resMessage.isFaultMessage() == false)
+ if (resMessage == null || SOAPUtils.isFaultMessage(resMessage) == false)
{
CommonBindingProvider bindingProvider = new CommonBindingProvider(sepMetaData);
CommonBinding binding = bindingProvider.getCommonBinding();
@@ -403,10 +399,10 @@
{
try
{
- MessageAbstraction resMessage = MessageContextAssociation.peekMessageContext().getMessageAbstraction();
+ SOAPMessage resMessage = MessageContextAssociation.peekMessageContext().getSOAPMessage();
if (resMessage != null)
{
- if (resMessage.isFaultMessage())
+ if (SOAPUtils.isFaultMessage(resMessage))
{
processFaultMetrics(ep, beginProcessing);
}
@@ -453,12 +449,12 @@
/** Set response mime headers
*/
- private void postProcessResponse(MimeHeaderSource headerSource, MessageAbstraction resMessage)
+ private void postProcessResponse(MimeHeaderSource headerSource, SOAPMessage resMessage)
{
try
{
// Set the outbound headers
- if (headerSource != null && resMessage instanceof SOAPMessage)
+ if (headerSource != null)
{
((SOAPMessage)resMessage).saveChanges();
headerSource.setMimeHeaders(resMessage.getMimeHeaders());
Modified: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/common/binding/SOAPBindingTestCase.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/common/binding/SOAPBindingTestCase.java 2012-04-11 16:10:32 UTC (rev 16156)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/common/binding/SOAPBindingTestCase.java 2012-04-13 03:51:36 UTC (rev 16157)
@@ -42,10 +42,10 @@
import org.jboss.ws.core.EndpointInvocation;
import org.jboss.ws.core.jaxrpc.client.CallImpl;
import org.jboss.ws.core.jaxrpc.handler.SOAPMessageContextJAXRPC;
-import org.jboss.ws.core.soap.MessageContextAssociation;
import org.jboss.ws.core.soap.MessageFactoryImpl;
import org.jboss.ws.core.soap.SOAPMessageImpl;
import org.jboss.ws.core.soap.UnboundHeader;
+import org.jboss.ws.core.soap.utils.MessageContextAssociation;
import org.jboss.ws.metadata.umdm.OperationMetaData;
import org.jboss.ws.metadata.umdm.ParameterMetaData;
import org.jboss.ws.common.DOMUtils;
@@ -185,7 +185,7 @@
EndpointInvocation epInv = new EndpointInvocation(opMetaData);
epInv.initInputParams(new Object[]{"Hello World!"});
- SOAPMessage reqMessage = (SOAPMessage)binding.bindRequestMessage(opMetaData, epInv, null);
+ SOAPMessage reqMessage = (SOAPMessage)binding.bindRequestMessage(opMetaData, epInv);
ByteArrayOutputStream outs = new ByteArrayOutputStream();
reqMessage.writeTo(outs);
@@ -211,7 +211,7 @@
EndpointInvocation epInv = new EndpointInvocation(opMetaData);
epInv.initInputParams(new Object[]{"Hello World!", "IN header message"});
- SOAPMessage reqMessage = (SOAPMessage)binding.bindRequestMessage(opMetaData, epInv, null);
+ SOAPMessage reqMessage = (SOAPMessage)binding.bindRequestMessage(opMetaData, epInv);
ByteArrayOutputStream outs = new ByteArrayOutputStream();
reqMessage.writeTo(outs);
@@ -220,33 +220,6 @@
assertEquals(DOMUtils.parse(reqEnvelopeWithBoundHeader), DOMUtils.parse(retString));
}
- /** Test binding of the request message with header
- */
- public void testBindRequestMessageWithUnboundHeader() throws Exception
- {
- CommonBindingProvider bindingProvider = new CommonBindingProvider(CommonSOAPBinding.SOAP12HTTP_BINDING);
- CommonBinding binding = (CommonBinding)bindingProvider.getCommonBinding();
-
- // Add unbound header
- QName xmlName = new QName("http://somens", "String_2");
- UnboundHeader header = new UnboundHeader(xmlName, Constants.TYPE_LITERAL_STRING, String.class, ParameterMode.IN);
- header.setHeaderValue("IN header message");
-
- Map headers = new HashMap();
- headers.put(xmlName, header);
-
- EndpointInvocation epInv = new EndpointInvocation(opMetaData);
- epInv.initInputParams(new Object[]{"Hello World!"});
-
- SOAPMessage reqMessage = (SOAPMessage)binding.bindRequestMessage(opMetaData, epInv, headers);
-
- ByteArrayOutputStream outs = new ByteArrayOutputStream();
- reqMessage.writeTo(outs);
-
- String retString = new String(outs.toByteArray());
- assertEquals(DOMUtils.parse(reqEnvelopeWithUnboundHeader), DOMUtils.parse(retString));
- }
-
/** Test unbinding of the request message
*/
public void testUnbindRequestMessage() throws Exception
@@ -357,7 +330,7 @@
msgContext.setSOAPMessage(resMessage);
EndpointInvocation epInv = new EndpointInvocation(opMetaData);
- binding.unbindResponseMessage(opMetaData, resMessage, epInv, null);
+ binding.unbindResponseMessage(opMetaData, resMessage, epInv);
assertEquals("Hello World!", epInv.getReturnValue());
}
@@ -385,7 +358,7 @@
opMetaData.addParameter(paramMetaData);
EndpointInvocation epInv = new EndpointInvocation(opMetaData);
- binding.unbindResponseMessage(opMetaData, resMessage, epInv, null);
+ binding.unbindResponseMessage(opMetaData, resMessage, epInv);
assertEquals("Hello World!", epInv.getReturnValue());
Object headerValue = epInv.getResponseParamValue(xmlName);
@@ -394,34 +367,6 @@
/** Test unbinding of the response message with unbound header
*/
- public void testUnbindResponseMessageWithUnboundHeader() throws Exception
- {
- CommonBindingProvider bindingProvider = new CommonBindingProvider(CommonSOAPBinding.SOAP12HTTP_BINDING);
- CommonBinding binding = (CommonBinding)bindingProvider.getCommonBinding();
-
- ByteArrayInputStream inputStream = new ByteArrayInputStream(resEnvelopeWithUnboundHeader.getBytes());
-
- MessageFactory factory = new MessageFactoryImpl();
- SOAPMessageImpl resMessage = (SOAPMessageImpl)factory.createMessage(null, inputStream);
-
- CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
- msgContext.setSOAPMessage(resMessage);
-
- QName xmlName = new QName("http://somens", "OutHeader");
- UnboundHeader header = new UnboundHeader(xmlName, Constants.TYPE_LITERAL_STRING, String.class, ParameterMode.OUT);
-
- Map headers = new HashMap();
- headers.put(xmlName, header);
-
- EndpointInvocation epInv = new EndpointInvocation(opMetaData);
- binding.unbindResponseMessage(opMetaData, resMessage, epInv, headers);
- assertEquals("Hello World!", epInv.getReturnValue());
-
- assertEquals("OUT header message", header.getHeaderValue());
- }
-
- /** Test unbinding of the response message with unbound header
- */
public void testUnbindFaultResponse() throws Exception
{
CommonBindingProvider bindingProvider = new CommonBindingProvider(CommonSOAPBinding.SOAP12HTTP_BINDING);
@@ -438,7 +383,7 @@
try
{
EndpointInvocation epInv = new EndpointInvocation(opMetaData);
- binding.unbindResponseMessage(opMetaData, resMessage, epInv, null);
+ binding.unbindResponseMessage(opMetaData, resMessage, epInv);
fail("SOAPFaultException expected");
}
catch (SOAPFaultException faultEx)
Modified: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/common/soap/MessageFactoryTestCase.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/common/soap/MessageFactoryTestCase.java 2012-04-11 16:10:32 UTC (rev 16156)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/common/soap/MessageFactoryTestCase.java 2012-04-13 03:51:36 UTC (rev 16157)
@@ -39,7 +39,7 @@
import org.jboss.ws.common.Constants;
import org.jboss.ws.core.soap.MessageFactoryImpl;
-import org.jboss.ws.core.soap.Style;
+import org.jboss.ws.core.soap.utils.Style;
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.ws.common.DOMUtils;
import org.jboss.ws.common.DOMWriter;
Modified: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/common/soap/SOAPContentElementTestCase.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/common/soap/SOAPContentElementTestCase.java 2012-04-11 16:10:32 UTC (rev 16156)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/common/soap/SOAPContentElementTestCase.java 2012-04-13 03:51:36 UTC (rev 16157)
@@ -37,8 +37,8 @@
import org.jboss.ws.core.soap.SOAPBodyImpl;
import org.jboss.ws.core.soap.SOAPContentElement;
import org.jboss.ws.core.soap.SOAPElementImpl;
-import org.jboss.ws.core.soap.Style;
import org.jboss.ws.core.soap.XMLFragment;
+import org.jboss.ws.core.soap.utils.Style;
import org.jboss.wsf.test.JBossWSTest;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
Modified: stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/common/soap/attachment/GenericAttachmentTestCase.java
===================================================================
--- stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/common/soap/attachment/GenericAttachmentTestCase.java 2012-04-11 16:10:32 UTC (rev 16156)
+++ stack/native/trunk/modules/testsuite/native-tests/src/test/java/org/jboss/test/ws/common/soap/attachment/GenericAttachmentTestCase.java 2012-04-13 03:51:36 UTC (rev 16157)
@@ -46,10 +46,10 @@
import org.jboss.ws.core.EndpointInvocation;
import org.jboss.ws.core.jaxrpc.client.CallImpl;
import org.jboss.ws.core.jaxrpc.handler.SOAPMessageContextJAXRPC;
-import org.jboss.ws.core.soap.MessageContextAssociation;
import org.jboss.ws.core.soap.MessageFactoryImpl;
import org.jboss.ws.core.soap.SOAPMessageImpl;
import org.jboss.ws.core.soap.attachment.MimeConstants;
+import org.jboss.ws.core.soap.utils.MessageContextAssociation;
import org.jboss.ws.metadata.umdm.OperationMetaData;
import org.jboss.wsf.test.JBossWSTest;
@@ -152,7 +152,7 @@
EndpointInvocation epInv = new EndpointInvocation(opMetaData);
epInv.initInputParams(new Object[]{"Hello World!", "hi"});
- SOAPMessage reqMessage = (SOAPMessage)binding.bindRequestMessage(opMetaData, epInv, null);
+ SOAPMessage reqMessage = (SOAPMessage)binding.bindRequestMessage(opMetaData, epInv);
ByteArrayOutputStream stream = new ByteArrayOutputStream();
@@ -187,7 +187,7 @@
headers.addHeader(MimeConstants.CONTENT_TYPE, type);
SOAPMessageImpl msg3 = (SOAPMessageImpl)new MessageFactoryImpl().createMessage(headers, in);
- binding.unbindResponseMessage(opMetaData, msg3, epInv, null);
+ binding.unbindResponseMessage(opMetaData, msg3, epInv);
assertEquals("test", epInv.getReturnValue());
}
12 years, 8 months