JBossWS SVN: r5465 - in stack/native/trunk: src/main/resources and 1 other directories.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-01-11 05:44:30 -0500 (Fri, 11 Jan 2008)
New Revision: 5465
Added:
stack/native/trunk/src/main/resources/jbossws-core.jar/META-INF/services/org.jboss.wsf.spi.invocation.RequestHandlerFactory
stack/native/trunk/src/main/resources/jbossws-core.jar/META-INF/services/org.jboss.wsf.spi.management.EndpointRegistryFactory
stack/native/trunk/src/main/resources/jbossws-core.jar/META-INF/services/org.jboss.wsf.spi.serviceref.ServiceRefBinderFactory
Removed:
stack/native/trunk/src/main/resources/jbossws-native.jar/
Modified:
stack/native/trunk/build.xml
Log:
Remove jbossws-native.jar and consolidate with jbossws-core.jar
Modified: stack/native/trunk/build.xml
===================================================================
--- stack/native/trunk/build.xml 2008-01-11 10:35:19 UTC (rev 5464)
+++ stack/native/trunk/build.xml 2008-01-11 10:44:30 UTC (rev 5465)
@@ -180,6 +180,7 @@
<jar jarfile="${core.output.lib.dir}/jbossws-core.jar" manifest="${core.output.etc.dir}/default.mf">
<fileset dir="${core.output.classes.dir}">
<include name="org/jboss/annotation/**"/>
+ <include name="org/jboss/wsf/stack/jbws/**"/>
<include name="org/jboss/ws/**"/>
</fileset>
<fileset dir="${core.resources.dir}">
@@ -194,7 +195,6 @@
<fileset dir="${core.output.classes.dir}">
<include name="org/jboss/wsf/**"/>
<include name="org/jboss/ws/**"/>
-
<!-- JAX-WS 2.1 extensions -->
<include name="javax/xml/ws/**/*21.class"/>
<include name="javax/xml/ws/Action.class"/>
@@ -211,7 +211,6 @@
<include name="javax/xml/ws/soap/MTOM.class"/>
<include name="javax/xml/ws/soap/MTOMFeature.class"/>
<include name="javax/xml/ws/wsaddressing/**"/>
-
</fileset>
<fileset dir="${core.resources.dir}">
<include name="schema/**"/>
@@ -226,14 +225,6 @@
<metainf dir="${core.resources.dir}/standard-config"/>
</jar>
- <!-- Build jbossws-native.jar -->
- <jar jarfile="${core.output.lib.dir}/jbossws-native.jar" manifest="${core.output.etc.dir}/default.mf">
- <fileset dir="${core.output.classes.dir}">
- <include name="org/jboss/wsf/stack/jbws/**"/>
- </fileset>
- <metainf dir="${core.resources.dir}/jbossws-native.jar/META-INF"/>
- </jar>
-
<!-- Build jbossws-context.war -->
<copy todir="${core.output.lib.dir}/jbossws-context.war" filtering="true">
<fileset dir="${core.resources.dir}/jbossws-context.war">
@@ -284,9 +275,6 @@
<jar jarfile="${core.output.lib.dir}/jbossws-native50.sar" manifest="${core.output.etc.dir}/default.mf">
<fileset dir="${core.output.lib.dir}">
<include name="jbossws-context.war/**"/>
- <include name="jbossws-native.jar"/>
- </fileset>
- <fileset dir="${core.dir}/output/lib">
<include name="jbossws-core.jar"/>
</fileset>
<fileset dir="${core.dir}/thirdparty">
@@ -325,11 +313,8 @@
<jar jarfile="${core.output.lib.dir}/jbossws-native42.sar" manifest="${core.output.etc.dir}/default.mf">
<fileset dir="${core.output.lib.dir}">
<include name="jbossws-context.war/**"/>
- <include name="jbossws-native.jar"/>
- </fileset>
- <fileset dir="${core.dir}/output/lib">
<include name="jboss-jaxws.jar"/>
- <include name="jboss-jaxws-ext.jar"/>
+ <include name="jboss-jaxws-ext.jar"/>
<include name="jboss-jaxrpc.jar"/>
<include name="jboss-saaj.jar"/>
<include name="jbossws-core.jar"/>
@@ -388,11 +373,8 @@
<jar jarfile="${core.output.lib.dir}/jbossws-native40.sar" manifest="${core.output.etc.dir}/default.mf">
<fileset dir="${core.output.lib.dir}">
<include name="jbossws-context.war/**"/>
- <include name="jbossws-native.jar"/>
- </fileset>
- <fileset dir="${core.dir}/output/lib">
<include name="jboss-jaxws.jar"/>
- <include name="jboss-jaxws-ext.jar"/>
+ <include name="jboss-jaxws-ext.jar"/>
<include name="jbossws-core.jar"/>
</fileset>
<fileset dir="${core.dir}/thirdparty">
Copied: stack/native/trunk/src/main/resources/jbossws-core.jar/META-INF/services/org.jboss.wsf.spi.invocation.RequestHandlerFactory (from rev 5462, stack/native/trunk/src/main/resources/jbossws-native.jar/META-INF/services/org.jboss.wsf.spi.invocation.RequestHandlerFactory)
===================================================================
--- stack/native/trunk/src/main/resources/jbossws-core.jar/META-INF/services/org.jboss.wsf.spi.invocation.RequestHandlerFactory (rev 0)
+++ stack/native/trunk/src/main/resources/jbossws-core.jar/META-INF/services/org.jboss.wsf.spi.invocation.RequestHandlerFactory 2008-01-11 10:44:30 UTC (rev 5465)
@@ -0,0 +1 @@
+org.jboss.wsf.stack.jbws.RequestHandlerFactoryImpl
\ No newline at end of file
Copied: stack/native/trunk/src/main/resources/jbossws-core.jar/META-INF/services/org.jboss.wsf.spi.management.EndpointRegistryFactory (from rev 5462, stack/native/trunk/src/main/resources/jbossws-native.jar/META-INF/services/org.jboss.wsf.spi.management.EndpointRegistryFactory)
===================================================================
--- stack/native/trunk/src/main/resources/jbossws-core.jar/META-INF/services/org.jboss.wsf.spi.management.EndpointRegistryFactory (rev 0)
+++ stack/native/trunk/src/main/resources/jbossws-core.jar/META-INF/services/org.jboss.wsf.spi.management.EndpointRegistryFactory 2008-01-11 10:44:30 UTC (rev 5465)
@@ -0,0 +1 @@
+org.jboss.wsf.stack.jbws.EndpointRegistryFactoryImpl
\ No newline at end of file
Copied: stack/native/trunk/src/main/resources/jbossws-core.jar/META-INF/services/org.jboss.wsf.spi.serviceref.ServiceRefBinderFactory (from rev 5462, stack/native/trunk/src/main/resources/jbossws-native.jar/META-INF/services/org.jboss.wsf.spi.serviceref.ServiceRefBinderFactory)
===================================================================
--- stack/native/trunk/src/main/resources/jbossws-core.jar/META-INF/services/org.jboss.wsf.spi.serviceref.ServiceRefBinderFactory (rev 0)
+++ stack/native/trunk/src/main/resources/jbossws-core.jar/META-INF/services/org.jboss.wsf.spi.serviceref.ServiceRefBinderFactory 2008-01-11 10:44:30 UTC (rev 5465)
@@ -0,0 +1 @@
+org.jboss.ws.core.client.ServiceRefBinderFactoryImpl
\ No newline at end of file
16 years, 12 months
JBossWS SVN: r5464 - stack/cxf/trunk.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-01-11 05:35:19 -0500 (Fri, 11 Jan 2008)
New Revision: 5464
Modified:
stack/cxf/trunk/build.xml
Log:
Remove wstx.jar from as50 sar
Modified: stack/cxf/trunk/build.xml
===================================================================
--- stack/cxf/trunk/build.xml 2008-01-11 10:34:40 UTC (rev 5463)
+++ stack/cxf/trunk/build.xml 2008-01-11 10:35:19 UTC (rev 5464)
@@ -178,9 +178,7 @@
<include name="jaxb-api.jar"/>
<include name="jaxb-impl.jar"/>
<include name="jaxrpc-api.jar"/>
- <include name="stax-api.jar"/>
<include name="wsdl4j.jar"/>
- <include name="wstx.jar"/>
</fileset>
<metainf dir="${cxf.output.lib.dir}/jbossws-cxf50">
<include name="jbossws-beans.xml"/>
16 years, 12 months
JBossWS SVN: r5463 - stack/native/trunk.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-01-11 05:34:40 -0500 (Fri, 11 Jan 2008)
New Revision: 5463
Modified:
stack/native/trunk/build.xml
Log:
Remove wstx.jar from as50 sar
Modified: stack/native/trunk/build.xml
===================================================================
--- stack/native/trunk/build.xml 2008-01-11 06:29:06 UTC (rev 5462)
+++ stack/native/trunk/build.xml 2008-01-11 10:34:40 UTC (rev 5463)
@@ -293,7 +293,6 @@
<include name="policy.jar"/>
<include name="wsdl4j.jar"/>
<include name="xmlsec.jar"/>
- <include name="wstx.jar"/>
<include name="jboss-jaxb-intros.jar"/>
</fileset>
<metainf dir="${core.dir}/src/main/resources/standard-config">
16 years, 12 months
JBossWS SVN: r5462 - legacy/branches/jbossws-1.2.1.GA_JBWS-1900/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/samples/wsaddr/replyto.
by jbossws-commits@lists.jboss.org
Author: mageshbk(a)jboss.com
Date: 2008-01-11 01:29:06 -0500 (Fri, 11 Jan 2008)
New Revision: 5462
Modified:
legacy/branches/jbossws-1.2.1.GA_JBWS-1900/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/samples/wsaddr/replyto/ClientHandler.java
Log:
[JBWS-1900] JBWS-1937-Removed dependency from jaxws testcase
Modified: legacy/branches/jbossws-1.2.1.GA_JBWS-1900/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/samples/wsaddr/replyto/ClientHandler.java
===================================================================
--- legacy/branches/jbossws-1.2.1.GA_JBWS-1900/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/samples/wsaddr/replyto/ClientHandler.java 2008-01-11 06:28:13 UTC (rev 5461)
+++ legacy/branches/jbossws-1.2.1.GA_JBWS-1900/jbossws-tests/src/java/org/jboss/test/ws/jaxrpc/samples/wsaddr/replyto/ClientHandler.java 2008-01-11 06:29:06 UTC (rev 5462)
@@ -25,6 +25,7 @@
import java.net.URISyntaxException;
import javax.xml.namespace.QName;
+import javax.xml.rpc.handler.GenericHandler;
import javax.xml.rpc.handler.MessageContext;
import javax.xml.ws.addressing.AddressingBuilder;
@@ -34,7 +35,6 @@
import javax.xml.ws.addressing.soap.SOAPAddressingProperties;
import org.jboss.logging.Logger;
-import org.jboss.test.ws.jaxws.wsaddressing.AddressingHandler;
/**
* A client side handler for the ws-addressing
@@ -42,7 +42,7 @@
* @author mageshbk(a)jboss.com
* @since 12-Dec-2007
*/
-public class ClientHandler extends AddressingHandler
+public class ClientHandler extends GenericHandler
{
// Provide logging
private static Logger log = Logger.getLogger(ClientHandler.class);
@@ -69,11 +69,21 @@
}
log.info("exit handleRequest");
return true;
- }
+ }
- public QName[] getHeaders()
- {
- return headers;
- }
+ public QName[] getHeaders()
+ {
+ return headers;
+ }
+ /**
+ * Get the JBoss server host from system property "jbosstest.server.host"
+ * This defaults to "localhost" if the property is not set
+ */
+ private String getServerHost()
+ {
+ String hostName = System.getProperty("jbosstest.server.host", "localhost");
+ return hostName;
+ }
+
}
16 years, 12 months
JBossWS SVN: r5461 - stack/native/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/wsaddr/replyto.
by jbossws-commits@lists.jboss.org
Author: mageshbk(a)jboss.com
Date: 2008-01-11 01:28:13 -0500 (Fri, 11 Jan 2008)
New Revision: 5461
Modified:
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/wsaddr/replyto/ClientHandler.java
Log:
[JBWS-1937] Removed dependency from jaxws testcase
Modified: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/wsaddr/replyto/ClientHandler.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/wsaddr/replyto/ClientHandler.java 2008-01-10 21:16:59 UTC (rev 5460)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/jaxrpc/samples/wsaddr/replyto/ClientHandler.java 2008-01-11 06:28:13 UTC (rev 5461)
@@ -25,6 +25,7 @@
import java.net.URISyntaxException;
import javax.xml.namespace.QName;
+import javax.xml.rpc.handler.GenericHandler;
import javax.xml.rpc.handler.MessageContext;
import javax.xml.ws.addressing.AddressingBuilder;
@@ -34,7 +35,6 @@
import javax.xml.ws.addressing.soap.SOAPAddressingProperties;
import org.jboss.logging.Logger;
-import org.jboss.test.ws.jaxws.wsaddressing.AddressingHandler;
/**
* A client side handler for the ws-addressing
@@ -42,7 +42,7 @@
* @author mageshbk(a)jboss.com
* @since 12-Dec-2007
*/
-public class ClientHandler extends AddressingHandler
+public class ClientHandler extends GenericHandler
{
// Provide logging
private static Logger log = Logger.getLogger(ClientHandler.class);
@@ -69,11 +69,21 @@
}
log.info("exit handleRequest");
return true;
- }
+ }
- public QName[] getHeaders()
- {
- return headers;
- }
+ public QName[] getHeaders()
+ {
+ return headers;
+ }
+ /**
+ * Get the JBoss server host from system property "jbosstest.server.host"
+ * This defaults to "localhost" if the property is not set
+ */
+ private String getServerHost()
+ {
+ String hostName = System.getProperty("jbosstest.server.host", "localhost");
+ return hostName;
+ }
+
}
16 years, 12 months
JBossWS SVN: r5460 - stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2008-01-10 16:16:59 -0500 (Thu, 10 Jan 2008)
New Revision: 5460
Modified:
stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
Log:
Fixing JBWS-1792: EndpointMetaData should always set itself into the HandlerMetaData
Modified: stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java 2008-01-10 15:58:26 UTC (rev 5459)
+++ stack/native/trunk/src/main/java/org/jboss/ws/metadata/umdm/EndpointMetaData.java 2008-01-10 21:16:59 UTC (rev 5460)
@@ -456,6 +456,8 @@
public void addHandlers(List<HandlerMetaData> configHandlers)
{
+ for (HandlerMetaData handler : configHandlers)
+ handler.setEndpointMetaData(this);
handlers.addAll(configHandlers);
}
16 years, 12 months
JBossWS SVN: r5459 - framework/trunk.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2008-01-10 10:58:26 -0500 (Thu, 10 Jan 2008)
New Revision: 5459
Modified:
framework/trunk/.classpath
Log:
Reverting erroneously committed .classpath
Modified: framework/trunk/.classpath
===================================================================
--- framework/trunk/.classpath 2008-01-10 15:52:42 UTC (rev 5458)
+++ framework/trunk/.classpath 2008-01-10 15:58:26 UTC (rev 5459)
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src/main/java"/>
- <classpathentry kind="src" path="src/test/java"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3.8.1"/>
<classpathentry kind="lib" path="thirdparty/jboss-common-core.jar"/>
@@ -17,8 +16,5 @@
<classpathentry kind="lib" path="thirdparty/jaxb-api.jar"/>
<classpathentry kind="lib" path="thirdparty/jbossws-common.jar"/>
<classpathentry kind="lib" path="thirdparty/jbossws-spi.jar"/>
- <classpathentry kind="lib" path="/stack-native/thirdparty/wsdl4j.jar" sourcepath="/stack-native/thirdparty/wsdl4j-src.jar"/>
- <classpathentry kind="lib" path="/stack-native/thirdparty/ejb3.deployer/jboss-annotations-ejb3.jar"/>
- <classpathentry kind="lib" path="/home/alessio/dati/jboss-5.0/build/output/jboss-5.0.0.Beta3/client/jbossall-client.jar"/>
<classpathentry kind="output" path="output/eclipse"/>
</classpath>
16 years, 12 months
JBossWS SVN: r5458 - in framework/trunk: src/main/java/org/jboss/wsf/framework/management/recording and 1 other directory.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2008-01-10 10:52:42 -0500 (Thu, 10 Jan 2008)
New Revision: 5458
Modified:
framework/trunk/.classpath
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/MemoryBufferRecorder.java
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/MemoryBufferRecorderMBean.java
Log:
Adding group ID to the table
Modified: framework/trunk/.classpath
===================================================================
--- framework/trunk/.classpath 2008-01-10 14:43:53 UTC (rev 5457)
+++ framework/trunk/.classpath 2008-01-10 15:52:42 UTC (rev 5458)
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src/main/java"/>
+ <classpathentry kind="src" path="src/test/java"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3.8.1"/>
<classpathentry kind="lib" path="thirdparty/jboss-common-core.jar"/>
@@ -16,5 +17,8 @@
<classpathentry kind="lib" path="thirdparty/jaxb-api.jar"/>
<classpathentry kind="lib" path="thirdparty/jbossws-common.jar"/>
<classpathentry kind="lib" path="thirdparty/jbossws-spi.jar"/>
+ <classpathentry kind="lib" path="/stack-native/thirdparty/wsdl4j.jar" sourcepath="/stack-native/thirdparty/wsdl4j-src.jar"/>
+ <classpathentry kind="lib" path="/stack-native/thirdparty/ejb3.deployer/jboss-annotations-ejb3.jar"/>
+ <classpathentry kind="lib" path="/home/alessio/dati/jboss-5.0/build/output/jboss-5.0.0.Beta3/client/jbossall-client.jar"/>
<classpathentry kind="output" path="output/eclipse"/>
</classpath>
Modified: framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/MemoryBufferRecorder.java
===================================================================
--- framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/MemoryBufferRecorder.java 2008-01-10 14:43:53 UTC (rev 5457)
+++ framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/MemoryBufferRecorder.java 2008-01-10 15:52:42 UTC (rev 5458)
@@ -211,7 +211,7 @@
private void openTable(StringBuffer sb, boolean showDetails)
{
- sb.append("<table border='1'><tr class='AttributesHeader'><th>Type</th><th>Date</th><th>From</th><th>To</th><th>Operation</th>");
+ sb.append("<table border='1'><tr class='AttributesHeader'><th>Group ID</th><th>Type</th><th>Date</th><th>From</th><th>To</th><th>Operation</th>");
if (showDetails)
sb.append("<th>Headers</th><th>Envelope</th>");
sb.append("</tr><tr>");
@@ -224,6 +224,9 @@
private void appendRecordRow(StringBuffer sb, Record record, boolean showDetails) {
sb.append("<tr><td><pre>");
+ sb.append(record.getGroupID() != null ? record.getGroupID() : "[Not available]");
+ sb.append("</pre></td>");
+ sb.append("<td><pre>");
sb.append(record.getMessageType() != null ? record.getMessageType() : "[Not available]");
sb.append("</pre></td>");
sb.append("<td><pre>");
Modified: framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/MemoryBufferRecorderMBean.java
===================================================================
--- framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/MemoryBufferRecorderMBean.java 2008-01-10 14:43:53 UTC (rev 5457)
+++ framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/MemoryBufferRecorderMBean.java 2008-01-10 15:52:42 UTC (rev 5458)
@@ -91,7 +91,7 @@
/**
* Shows all the records as a HTML table
*
- * @param groupRecords whether the records should be grouped using the record ID
+ * @param groupRecords whether the records should be grouped using the group ID
* @param showDetails whether to show headers and envelopes
* @return
*/
16 years, 12 months
JBossWS SVN: r5457 - framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording.
by jbossws-commits@lists.jboss.org
Author: alessio.soldano(a)jboss.com
Date: 2008-01-10 09:43:53 -0500 (Thu, 10 Jan 2008)
New Revision: 5457
Modified:
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/MemoryBufferRecorder.java
framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/MemoryBufferRecorderMBean.java
Log:
[JBWS-1950] Adding methods to the MemoryBufferRecorder to output html code
Modified: framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/MemoryBufferRecorder.java
===================================================================
--- framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/MemoryBufferRecorder.java 2008-01-10 14:16:57 UTC (rev 5456)
+++ framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/MemoryBufferRecorder.java 2008-01-10 14:43:53 UTC (rev 5457)
@@ -140,6 +140,11 @@
filters[0] = new HostFilter(clientHost, true);
return this.getMatchingRecords(filters);
}
+
+ public String getRecordsByClientHostAsHTMLTable(boolean groupRecords, boolean showDetails, String clientHost)
+ {
+ return toHtml(groupRecords, showDetails, this.getRecordsByClientHost(clientHost));
+ }
public Map<String, List<Record>> getRecordsByOperation(String namespace, String localPart)
{
@@ -147,6 +152,11 @@
filters[0] = new OperationFilter(new QName(namespace, localPart));
return this.getMatchingRecords(filters);
}
+
+ public String getRecordsByOperationAsHTMLTable(boolean groupRecords, boolean showDetails, String namespace, String localPart)
+ {
+ return toHtml(groupRecords, showDetails, this.getRecordsByOperation(namespace, localPart));
+ }
public int getMaxSize()
{
@@ -170,4 +180,84 @@
return size;
}
+ public String getRecordsAsHTMLTable(boolean groupRecords, boolean showDetails)
+ {
+ Map<String,List<Record>> records = this.getRecentRecords();
+ return toHtml(groupRecords, showDetails, records);
+ }
+
+ private String toHtml(boolean groupRecords, boolean showDetails, Map<String, List<Record>> records)
+ {
+ StringBuffer sb = new StringBuffer();
+ sb.append("</pre></span>");
+ if (!groupRecords)
+ openTable(sb, showDetails);
+ for (String key : records.keySet())
+ {
+ if (groupRecords)
+ openTable(sb, showDetails);
+ for (Record record : records.get(key))
+ {
+ appendRecordRow(sb, record, showDetails);
+ }
+ if (groupRecords)
+ closeTable(sb);
+ }
+ if (!groupRecords)
+ closeTable(sb);
+ sb.append("<pre><span class='OpResult'>");
+ return sb.toString();
+ }
+
+ private void openTable(StringBuffer sb, boolean showDetails)
+ {
+ sb.append("<table border='1'><tr class='AttributesHeader'><th>Type</th><th>Date</th><th>From</th><th>To</th><th>Operation</th>");
+ if (showDetails)
+ sb.append("<th>Headers</th><th>Envelope</th>");
+ sb.append("</tr><tr>");
+ }
+
+ private void closeTable(StringBuffer sb)
+ {
+ sb.append("</tr></table><br />");
+ }
+
+ private void appendRecordRow(StringBuffer sb, Record record, boolean showDetails) {
+ sb.append("<tr><td><pre>");
+ sb.append(record.getMessageType() != null ? record.getMessageType() : "[Not available]");
+ sb.append("</pre></td>");
+ sb.append("<td><pre>");
+ sb.append(record.getDate() != null ? record.getDate() : "[Not available]");
+ sb.append("</pre></td>");
+ sb.append("<td><pre>");
+ sb.append(record.getSourceHost() != null ? record.getSourceHost() : "[Not available]");
+ sb.append("</pre></td>");
+ sb.append("<td><pre>");
+ sb.append(record.getDestinationHost() != null ? record.getDestinationHost() : "[Not available]");
+ sb.append("</pre></td>");
+ sb.append("<td><pre>");
+ sb.append(record.getOperation() != null ? record.getOperation() : "[Not available]");
+ sb.append("</pre></td>");
+ if (showDetails)
+ {
+ sb.append("<td><pre>");
+ if (record.getHeaders() != null)
+ {
+ for (String headerName : record.getHeaders().keySet())
+ {
+ sb.append(headerName);
+ sb.append(": ");
+ sb.append(record.getHeaders().get(headerName));
+ sb.append("<br />");
+ }
+ }
+ else
+ sb.append("[Not available]");
+ sb.append("</pre></td>");
+ sb.append("<td><pre>");
+ sb.append(record.getEnvelope() != null ? record.getEnvelope().replaceAll("<", "<").replaceAll(">", ">") : "[Not available]");
+ sb.append("</pre></td>");
+ }
+ sb.append("</tr>");
+ }
}
Modified: framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/MemoryBufferRecorderMBean.java
===================================================================
--- framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/MemoryBufferRecorderMBean.java 2008-01-10 14:16:57 UTC (rev 5456)
+++ framework/trunk/src/main/java/org/jboss/wsf/framework/management/recording/MemoryBufferRecorderMBean.java 2008-01-10 14:43:53 UTC (rev 5457)
@@ -87,4 +87,34 @@
* @return
*/
public int getSize();
+
+ /**
+ * Shows all the records as a HTML table
+ *
+ * @param groupRecords whether the records should be grouped using the record ID
+ * @param showDetails whether to show headers and envelopes
+ * @return
+ */
+ public String getRecordsAsHTMLTable(boolean groupRecords, boolean showDetails);
+
+ /**
+ * Shows the records with the given client host as a HTML table.
+ *
+ * @param groupRecords
+ * @param showDetails
+ * @param clientHost
+ * @return
+ */
+ public String getRecordsByClientHostAsHTMLTable(boolean groupRecords, boolean showDetails, String clientHost);
+
+ /**
+ * Shows the records with the given operation as a HTML table.
+ *
+ * @param groupRecords
+ * @param showDetails
+ * @param namespace
+ * @param localPart
+ * @return
+ */
+ public String getRecordsByOperationAsHTMLTable(boolean groupRecords, boolean showDetails, String namespace, String localPart);
}
16 years, 12 months
JBossWS SVN: r5456 - in stack/native/trunk: src/main/java/org/jboss/ws/core and 6 other directories.
by jbossws-commits@lists.jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-01-10 09:16:57 -0500 (Thu, 10 Jan 2008)
New Revision: 5456
Added:
stack/native/trunk/src/main/java/org/jboss/ws/core/client/HTTPProtocolConnection.java
stack/native/trunk/src/main/java/org/jboss/ws/core/client/HTTPRemotingConnection.java
stack/native/trunk/src/main/java/org/jboss/ws/core/client/RemoteConnection.java
stack/native/trunk/src/main/java/org/jboss/ws/core/client/RemoteConnectionFactory.java
stack/native/trunk/src/main/java/org/jboss/ws/core/client/SOAPProtocolConnectionHTTP.java
stack/native/trunk/src/main/java/org/jboss/ws/core/client/SOAPProtocolConnectionJMS.java
stack/native/trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageUnMarshallerHTTP.java
stack/native/trunk/src/main/resources/jbossws-core.jar/META-INF/services/org.jboss.ws.core.client.RemoteConnection.http
stack/native/trunk/src/main/resources/jbossws-core.jar/META-INF/services/org.jboss.ws.core.client.RemoteConnection.jms
stack/native/trunk/src/test/resources/jaxws/samples/jmstransport/jmsservice.wsdl
Removed:
stack/native/trunk/src/main/java/org/jboss/ws/core/client/HTTPRemotingConnection.java
stack/native/trunk/src/main/java/org/jboss/ws/core/client/RemotingConnection.java
stack/native/trunk/src/main/java/org/jboss/ws/core/client/RemotingConnectionImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/core/client/SOAPRemotingConnection.java
Modified:
stack/native/trunk/
stack/native/trunk/src/main/java/org/jboss/ws/core/CommonClient.java
stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws/client/DispatchImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/core/soap/SOAPConnectionImpl.java
stack/native/trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageUnMarshaller.java
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/jmstransport/JMSTransportTestCase.java
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/jmstransport/Organization.java
stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/jmstransport/OrganizationJMSEndpoint.java
Log:
[JBWS-1911] Implement JMS transport for JAXWS client
Property changes on: stack/native/trunk
___________________________________________________________________
Name: svn:ignore
- output-eclipse
output
thirdparty
output*
version.properties.md5
ant.properties
clipboard.txt
+ output-eclipse
output
thirdparty
output*
version.properties.md5
ant.properties
clipboard.txt
clipboard.*
Modified: stack/native/trunk/src/main/java/org/jboss/ws/core/CommonClient.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/core/CommonClient.java 2008-01-10 12:21:02 UTC (rev 5455)
+++ stack/native/trunk/src/main/java/org/jboss/ws/core/CommonClient.java 2008-01-10 14:16:57 UTC (rev 5456)
@@ -47,7 +47,9 @@
import org.jboss.ws.WSException;
import org.jboss.ws.core.DirectionHolder.Direction;
import org.jboss.ws.core.client.EndpointInfo;
-import org.jboss.ws.core.client.SOAPRemotingConnection;
+import org.jboss.ws.core.client.RemoteConnection;
+import org.jboss.ws.core.client.RemoteConnectionFactory;
+import org.jboss.ws.core.client.SOAPProtocolConnectionHTTP;
import org.jboss.ws.core.jaxrpc.ParameterWrapping;
import org.jboss.ws.core.soap.MessageContextAssociation;
import org.jboss.ws.core.soap.Style;
@@ -334,8 +336,8 @@
if (shouldMaintainSession())
addSessionInfo(reqMessage, callProps);
- SOAPRemotingConnection remotingConnection = new SOAPRemotingConnection();
- MessageAbstraction resMessage = remotingConnection.invoke(reqMessage, epInfo, oneway);
+ RemoteConnection remoteConnection = new RemoteConnectionFactory().getRemoteConnection(epInfo);
+ MessageAbstraction resMessage = remoteConnection.invoke(reqMessage, epInfo, oneway);
if (shouldMaintainSession())
saveSessionInfo(callProps, getRequestContext());
Copied: stack/native/trunk/src/main/java/org/jboss/ws/core/client/HTTPProtocolConnection.java (from rev 5449, stack/native/trunk/src/main/java/org/jboss/ws/core/client/HTTPRemotingConnection.java)
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/core/client/HTTPProtocolConnection.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/core/client/HTTPProtocolConnection.java 2008-01-10 14:16:57 UTC (rev 5456)
@@ -0,0 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.client;
+
+// $Id$
+
+import org.jboss.remoting.marshal.Marshaller;
+import org.jboss.remoting.marshal.UnMarshaller;
+import org.jboss.ws.core.jaxws.binding.HTTPMessageMarshaller;
+import org.jboss.ws.core.jaxws.binding.HTTPMessageUnMarshaller;
+
+/**
+ * @since 02-Apr-2007
+ */
+public class HTTPProtocolConnection extends HTTPRemotingConnection
+{
+ public UnMarshaller getUnmarshaller()
+ {
+ return new HTTPMessageUnMarshaller();
+ }
+
+ public Marshaller getMarshaller()
+ {
+ return new HTTPMessageMarshaller();
+ }
+}
Deleted: stack/native/trunk/src/main/java/org/jboss/ws/core/client/HTTPRemotingConnection.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/core/client/HTTPRemotingConnection.java 2008-01-10 12:21:02 UTC (rev 5455)
+++ stack/native/trunk/src/main/java/org/jboss/ws/core/client/HTTPRemotingConnection.java 2008-01-10 14:16:57 UTC (rev 5456)
@@ -1,45 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.client;
-
-// $Id$
-
-import org.jboss.remoting.marshal.Marshaller;
-import org.jboss.remoting.marshal.UnMarshaller;
-import org.jboss.ws.core.jaxws.binding.HTTPMessageMarshaller;
-import org.jboss.ws.core.jaxws.binding.HTTPMessageUnMarshaller;
-
-/**
- * @since 02-Apr-2007
- */
-public class HTTPRemotingConnection extends RemotingConnectionImpl
-{
- protected UnMarshaller getUnmarshaller()
- {
- return new HTTPMessageUnMarshaller();
- }
-
- protected Marshaller getMarshaller()
- {
- return new HTTPMessageMarshaller();
- }
-}
Added: stack/native/trunk/src/main/java/org/jboss/ws/core/client/HTTPRemotingConnection.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/core/client/HTTPRemotingConnection.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/core/client/HTTPRemotingConnection.java 2008-01-10 14:16:57 UTC (rev 5456)
@@ -0,0 +1,407 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.client;
+
+// $Id$
+
+import java.io.IOException;
+import java.lang.reflect.Field;
+import java.net.MalformedURLException;
+import java.net.SocketTimeoutException;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Properties;
+
+import javax.xml.rpc.Stub;
+import javax.xml.soap.MimeHeader;
+import javax.xml.soap.MimeHeaders;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.addressing.EndpointReference;
+
+import org.jboss.logging.Logger;
+import org.jboss.remoting.Client;
+import org.jboss.remoting.InvokerLocator;
+import org.jboss.remoting.Version;
+import org.jboss.remoting.marshal.MarshalFactory;
+import org.jboss.remoting.marshal.Marshaller;
+import org.jboss.remoting.marshal.UnMarshaller;
+import org.jboss.ws.core.CommonMessageContext;
+import org.jboss.ws.core.MessageAbstraction;
+import org.jboss.ws.core.MessageTrace;
+import org.jboss.ws.core.StubExt;
+import org.jboss.ws.core.WSTimeoutException;
+import org.jboss.ws.core.soap.MessageContextAssociation;
+import org.jboss.ws.metadata.config.EndpointProperty;
+
+import org.jboss.ws.extensions.wsrm.transport.RMChannel;
+import org.jboss.ws.extensions.wsrm.transport.RMTransportHelper;
+import org.jboss.ws.extensions.wsrm.transport.RMMetadata;
+
+/**
+ * SOAPConnection implementation.
+ * <p/>
+ *
+ * Per default HTTP 1.1 chunked encoding is used.
+ * This may be ovverriden through {@link org.jboss.ws.metadata.config.EndpointProperty#CHUNKED_ENCODING_SIZE}.
+ * A chunksize value of zero disables chunked encoding.
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @author <a href="mailto:jason@stacksmash.com">Jason T. Greene</a>
+ *
+ * @since 02-Feb-2005
+ */
+public abstract class HTTPRemotingConnection implements RemoteConnection
+{
+ // provide logging
+ private static Logger log = Logger.getLogger(HTTPRemotingConnection.class);
+
+ private Map<String, Object> clientConfig = new HashMap<String, Object>();
+
+ private static Map<String, String> metadataMap = new HashMap<String, String>();
+ static
+ {
+ metadataMap.put(Stub.USERNAME_PROPERTY, "http.basic.username");
+ metadataMap.put(Stub.PASSWORD_PROPERTY, "http.basic.password");
+ metadataMap.put(BindingProvider.USERNAME_PROPERTY, "http.basic.username");
+ metadataMap.put(BindingProvider.PASSWORD_PROPERTY, "http.basic.password");
+ }
+ private static Map<String, String> configMap = new HashMap<String, String>();
+ static
+ {
+ configMap.put(StubExt.PROPERTY_KEY_STORE, "org.jboss.remoting.keyStore");
+ configMap.put(StubExt.PROPERTY_KEY_STORE_PASSWORD, "org.jboss.remoting.keyStorePassword");
+ configMap.put(StubExt.PROPERTY_KEY_STORE_TYPE, "org.jboss.remoting.keyStoreType");
+ configMap.put(StubExt.PROPERTY_TRUST_STORE, "org.jboss.remoting.trustStore");
+ configMap.put(StubExt.PROPERTY_TRUST_STORE_PASSWORD, "org.jboss.remoting.trustStorePassword");
+ configMap.put(StubExt.PROPERTY_TRUST_STORE_TYPE, "org.jboss.remoting.trustStoreType");
+ }
+
+ private boolean closed;
+
+ private static final RMChannel RM_CHANNEL = RMChannel.getInstance();
+
+ public HTTPRemotingConnection()
+ {
+ // HTTPClientInvoker conect sends gratuitous POST
+ // http://jira.jboss.com/jira/browse/JBWS-711
+ clientConfig.put(Client.ENABLE_LEASE, false);
+ }
+
+ public boolean isClosed()
+ {
+ return closed;
+ }
+
+ public void setClosed(boolean closed)
+ {
+ this.closed = closed;
+ }
+
+ /**
+ * Sends the given message to the specified endpoint.
+ *
+ * A null reqMessage signifies a HTTP GET request.
+ */
+ public MessageAbstraction invoke(MessageAbstraction reqMessage, Object endpoint, boolean oneway) throws IOException
+ {
+ if (endpoint == null)
+ throw new IllegalArgumentException("Given endpoint cannot be null");
+
+ if (closed)
+ throw new IOException("Connection is already closed");
+
+ Object timeout = null;
+ String targetAddress;
+ Map<String, Object> callProps = new HashMap<String, Object>();
+
+ if (endpoint instanceof EndpointInfo)
+ {
+ EndpointInfo epInfo = (EndpointInfo)endpoint;
+ targetAddress = epInfo.getTargetAddress();
+ callProps = epInfo.getProperties();
+
+ if (callProps.containsKey(StubExt.PROPERTY_CLIENT_TIMEOUT))
+ {
+ timeout = callProps.get(StubExt.PROPERTY_CLIENT_TIMEOUT);
+ targetAddress = addURLParameter(targetAddress, "timeout", timeout.toString());
+ }
+
+ }
+ else if (endpoint instanceof EndpointReference)
+ {
+ EndpointReference epr = (EndpointReference)endpoint;
+ targetAddress = epr.getAddress().toString();
+ }
+ else
+ {
+ targetAddress = endpoint.toString();
+ }
+
+ // setup remoting client
+ Map<String, Object> metadata = createRemotingMetaData(reqMessage, callProps);
+ Marshaller marshaller = getMarshaller();
+ UnMarshaller unmarshaller = getUnmarshaller();
+ InvokerLocator locator = null;
+ try
+ {
+ // Get the invoker from Remoting for a given endpoint address
+ log.debug("Get locator for: " + endpoint);
+
+ /**
+ * [JBWS-1704] The Use Of Remoting Causes An Additional 'datatype' Parameter To Be Sent On All Requests
+ *
+ * An HTTPClientInvoker may disconnect from the server and recreated by the remoting layer.
+ * In that case the new invoker does not inherit the marshaller/unmarshaller from the disconnected invoker.
+ * We therefore explicitly specify the invoker locator datatype and register the SOAP marshaller/unmarshaller
+ * with the MarshalFactory.
+ *
+ * This applies to remoting-1.4.5 and less
+ */
+ String version = getRemotingVersion();
+ if (version.startsWith("1.4"))
+ {
+ targetAddress = addURLParameter(targetAddress, InvokerLocator.DATATYPE, "JBossWSMessage");
+ MarshalFactory.addMarshaller("JBossWSMessage", marshaller, unmarshaller);
+ }
+
+ locator = new InvokerLocator(targetAddress);
+ }
+ catch (MalformedURLException e)
+ {
+ throw new IllegalArgumentException("Malformed endpoint address", e);
+ }
+
+ try
+ {
+ if (RMTransportHelper.isRMMessage(callProps))
+ {
+ RMMetadata rmMetadata = new RMMetadata(getRemotingVersion(), targetAddress, marshaller, unmarshaller, callProps, metadata, clientConfig);
+ return RM_CHANNEL.send(reqMessage, rmMetadata);
+ }
+ else
+ {
+ Client client = new Client(locator, "jbossws", clientConfig);
+ client.connect();
+
+ client.setMarshaller(marshaller);
+
+ if (oneway == false)
+ client.setUnMarshaller(unmarshaller);
+
+ if (log.isDebugEnabled())
+ log.debug("Remoting metadata: " + metadata);
+
+ // debug the outgoing message
+ MessageTrace.traceMessage("Outgoing Request Message", reqMessage);
+
+ MessageAbstraction resMessage = null;
+
+ if (oneway == true)
+ {
+ client.invokeOneway(reqMessage, metadata, false);
+ }
+ else
+ {
+ resMessage = (MessageAbstraction)client.invoke(reqMessage, metadata);
+ }
+
+ // Disconnect the remoting client
+ client.disconnect();
+
+ callProps.clear();
+ callProps.putAll(metadata);
+
+ // trace the incomming response message
+ MessageTrace.traceMessage("Incoming Response Message", resMessage);
+
+ return resMessage;
+ }
+ }
+ catch (Throwable th)
+ {
+ if (timeout != null && (th.getCause() instanceof SocketTimeoutException))
+ {
+ throw new WSTimeoutException("Timeout after: " + timeout + "ms", new Long(timeout.toString()));
+ }
+
+ IOException io = new IOException("Could not transmit message");
+ io.initCause(th);
+ throw io;
+ }
+ }
+
+ private String addURLParameter(String urlStr, String key, String value) throws MalformedURLException
+ {
+ URL url = new URL(urlStr);
+ urlStr += (url.getQuery() == null ? "?" : "&") + key + "=" + value;
+ return urlStr;
+ }
+
+ private String getRemotingVersion()
+ {
+ String version = null;
+ try
+ {
+ // Access the constant dynamically, otherwise it will be the compile time value
+ Field field = Version.class.getDeclaredField("VERSION");
+ version = (String)field.get(null);
+ }
+ catch (Exception ex)
+ {
+ throw new RuntimeException("Cannot obtain remoting version", ex);
+ }
+
+ if (version == null)
+ {
+ URL codeURL = Version.class.getProtectionDomain().getCodeSource().getLocation();
+ throw new RuntimeException("Cannot obtain remoting version from: " + codeURL);
+ }
+ return version;
+ }
+
+ private Map<String, Object> createRemotingMetaData(MessageAbstraction reqMessage, Map callProps)
+ {
+ CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
+
+ Map<String, Object> metadata = new HashMap<String, Object>();
+
+ // We need to unmarshall faults (HTTP 500)
+ // metadata.put(HTTPMetadataConstants.NO_THROW_ON_ERROR, "true"); // since 2.0.0.GA
+ metadata.put("NoThrowOnError", "true");
+
+ if (reqMessage != null)
+ {
+ populateHeaders(reqMessage, metadata);
+
+ // Enable chunked encoding. This is the default size.
+ clientConfig.put("chunkedLength", "1024");
+
+ // May be overridden through endpoint config
+ if (msgContext != null)
+ {
+ Properties epmdProps = msgContext.getEndpointMetaData().getProperties();
+
+ // chunksize settings
+ String chunkSizeValue = epmdProps.getProperty(EndpointProperty.CHUNKED_ENCODING_SIZE);
+ int chunkSize = chunkSizeValue != null ? Integer.valueOf(chunkSizeValue) : -1;
+ if (chunkSize > 0)
+ {
+ clientConfig.put(EndpointProperty.CHUNKED_ENCODING_SIZE, chunkSizeValue);
+ }
+ else
+ {
+ clientConfig.remove("chunkedLength");
+ }
+ }
+ }
+ else
+ {
+ metadata.put("TYPE", "GET");
+ }
+
+ if (callProps != null)
+ {
+ Iterator it = callProps.entrySet().iterator();
+
+ // Get authentication type, default to BASIC authetication
+ String authType = (String)callProps.get(StubExt.PROPERTY_AUTH_TYPE);
+ if (authType == null)
+ authType = StubExt.PROPERTY_AUTH_TYPE_BASIC;
+
+ while (it.hasNext())
+ {
+ Map.Entry entry = (Map.Entry)it.next();
+ String key = (String)entry.getKey();
+ Object val = entry.getValue();
+
+ // pass properties to remoting meta data
+ if (metadataMap.containsKey(key))
+ {
+ String remotingKey = metadataMap.get(key);
+ if ("http.basic.username".equals(remotingKey) || "http.basic.password".equals(remotingKey))
+ {
+ if (authType.equals(StubExt.PROPERTY_AUTH_TYPE_BASIC))
+ {
+ metadata.put(remotingKey, val);
+ }
+ else
+ {
+ log.warn("Ignore '" + key + "' with auth typy: " + authType);
+ }
+ }
+ else
+ {
+ metadata.put(remotingKey, val);
+ }
+ }
+
+ // pass properties to remoting client config
+ if (configMap.containsKey(key))
+ {
+ String remotingKey = configMap.get(key);
+ clientConfig.put(remotingKey, val);
+ }
+ }
+ }
+
+ return metadata;
+ }
+
+ protected void populateHeaders(MessageAbstraction reqMessage, Map<String, Object> metadata)
+ {
+ MimeHeaders mimeHeaders = reqMessage.getMimeHeaders();
+
+ Properties props = new Properties();
+ metadata.put("HEADER", props);
+
+ Iterator i = mimeHeaders.getAllHeaders();
+ while (i.hasNext())
+ {
+ MimeHeader header = (MimeHeader)i.next();
+ String currentValue = props.getProperty(header.getName());
+
+ /*
+ * Coalesce multiple headers into one
+ *
+ * From HTTP/1.1 RFC 2616:
+ *
+ * Multiple message-header fields with the same field-name MAY be
+ * present in a message if and only if the entire field-value for that
+ * header field is defined as a comma-separated list [i.e., #(values)].
+ * It MUST be possible to combine the multiple header fields into one
+ * "field-name: field-value" pair, without changing the semantics of
+ * the message, by appending each subsequent field-value to the first,
+ * each separated by a comma.
+ */
+ if (currentValue != null)
+ {
+ props.put(header.getName(), currentValue + "," + header.getValue());
+ }
+ else
+ {
+ props.put(header.getName(), header.getValue());
+ }
+ }
+ }
+}
Copied: stack/native/trunk/src/main/java/org/jboss/ws/core/client/RemoteConnection.java (from rev 5449, stack/native/trunk/src/main/java/org/jboss/ws/core/client/RemotingConnection.java)
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/core/client/RemoteConnection.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/core/client/RemoteConnection.java 2008-01-10 14:16:57 UTC (rev 5456)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.client;
+
+
+import java.io.IOException;
+
+import org.jboss.remoting.marshal.Marshaller;
+import org.jboss.remoting.marshal.UnMarshaller;
+import org.jboss.ws.core.MessageAbstraction;
+
+// $Id$
+
+/**
+ * A remote connection
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 02-Apr-2007
+ */
+public interface RemoteConnection
+{
+ Marshaller getMarshaller();
+
+ UnMarshaller getUnmarshaller();
+
+ MessageAbstraction invoke(MessageAbstraction reqMessage, Object endpoint, boolean oneway) throws IOException;
+}
Added: stack/native/trunk/src/main/java/org/jboss/ws/core/client/RemoteConnectionFactory.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/core/client/RemoteConnectionFactory.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/core/client/RemoteConnectionFactory.java 2008-01-10 14:16:57 UTC (rev 5456)
@@ -0,0 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.client;
+
+import org.jboss.wsf.spi.util.ServiceLoader;
+
+// $Id$
+
+/**
+ * A factory for remote connections
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 10-Jan-2008
+ */
+public class RemoteConnectionFactory
+{
+ public RemoteConnection getRemoteConnection(EndpointInfo epInfo)
+ {
+ String targetAddress = epInfo.getTargetAddress();
+ if (targetAddress == null)
+ throw new IllegalArgumentException("Cannot obtain target address from: " + epInfo);
+
+ String key = null;
+ if (targetAddress.startsWith("http"))
+ key = RemoteConnection.class.getName() + ".http";
+ else if (targetAddress.startsWith("jms"))
+ key = RemoteConnection.class.getName() + ".jms";
+
+ if (key == null)
+ throw new IllegalArgumentException("Cannot obtain remote connetion for: " + targetAddress);
+
+ RemoteConnection con = (RemoteConnection)ServiceLoader.loadService(key, null);
+ if (con == null)
+ throw new IllegalArgumentException("Cannot obtain remote connetion for: " + key);
+
+ return con;
+ }
+}
Property changes on: stack/native/trunk/src/main/java/org/jboss/ws/core/client/RemoteConnectionFactory.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: stack/native/trunk/src/main/java/org/jboss/ws/core/client/RemotingConnection.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/core/client/RemotingConnection.java 2008-01-10 12:21:02 UTC (rev 5455)
+++ stack/native/trunk/src/main/java/org/jboss/ws/core/client/RemotingConnection.java 2008-01-10 14:16:57 UTC (rev 5456)
@@ -1,40 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.client;
-
-
-import java.io.IOException;
-
-import org.jboss.ws.core.MessageAbstraction;
-
-// $Id$
-
-/**
- * A remoting connection
- *
- * @author Thomas.Diesler(a)jboss.org
- * @since 02-Apr-2007
- */
-public interface RemotingConnection
-{
- MessageAbstraction invoke(MessageAbstraction reqMessage, Object endpoint, boolean oneway) throws IOException;
-}
Deleted: stack/native/trunk/src/main/java/org/jboss/ws/core/client/RemotingConnectionImpl.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/core/client/RemotingConnectionImpl.java 2008-01-10 12:21:02 UTC (rev 5455)
+++ stack/native/trunk/src/main/java/org/jboss/ws/core/client/RemotingConnectionImpl.java 2008-01-10 14:16:57 UTC (rev 5456)
@@ -1,411 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.client;
-
-// $Id$
-
-import java.io.IOException;
-import java.lang.reflect.Field;
-import java.net.MalformedURLException;
-import java.net.SocketTimeoutException;
-import java.net.URL;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Properties;
-
-import javax.xml.rpc.Stub;
-import javax.xml.soap.MimeHeader;
-import javax.xml.soap.MimeHeaders;
-import javax.xml.ws.BindingProvider;
-import javax.xml.ws.addressing.EndpointReference;
-
-import org.jboss.logging.Logger;
-import org.jboss.remoting.Client;
-import org.jboss.remoting.InvokerLocator;
-import org.jboss.remoting.Version;
-import org.jboss.remoting.marshal.MarshalFactory;
-import org.jboss.remoting.marshal.Marshaller;
-import org.jboss.remoting.marshal.UnMarshaller;
-import org.jboss.ws.core.CommonMessageContext;
-import org.jboss.ws.core.MessageAbstraction;
-import org.jboss.ws.core.MessageTrace;
-import org.jboss.ws.core.StubExt;
-import org.jboss.ws.core.WSTimeoutException;
-import org.jboss.ws.core.soap.MessageContextAssociation;
-import org.jboss.ws.metadata.config.EndpointProperty;
-
-import org.jboss.ws.extensions.wsrm.transport.RMChannel;
-import org.jboss.ws.extensions.wsrm.transport.RMTransportHelper;
-import org.jboss.ws.extensions.wsrm.transport.RMMetadata;
-
-/**
- * SOAPConnection implementation.
- * <p/>
- *
- * Per default HTTP 1.1 chunked encoding is used.
- * This may be ovverriden through {@link org.jboss.ws.metadata.config.EndpointProperty#CHUNKED_ENCODING_SIZE}.
- * A chunksize value of zero disables chunked encoding.
- *
- * @author Thomas.Diesler(a)jboss.org
- * @author <a href="mailto:jason@stacksmash.com">Jason T. Greene</a>
- *
- * @since 02-Feb-2005
- */
-public abstract class RemotingConnectionImpl implements RemotingConnection
-{
- // provide logging
- private static Logger log = Logger.getLogger(RemotingConnectionImpl.class);
-
- private Map<String, Object> clientConfig = new HashMap<String, Object>();
-
- private static Map<String, String> metadataMap = new HashMap<String, String>();
- static
- {
- metadataMap.put(Stub.USERNAME_PROPERTY, "http.basic.username");
- metadataMap.put(Stub.PASSWORD_PROPERTY, "http.basic.password");
- metadataMap.put(BindingProvider.USERNAME_PROPERTY, "http.basic.username");
- metadataMap.put(BindingProvider.PASSWORD_PROPERTY, "http.basic.password");
- }
- private static Map<String, String> configMap = new HashMap<String, String>();
- static
- {
- configMap.put(StubExt.PROPERTY_KEY_STORE, "org.jboss.remoting.keyStore");
- configMap.put(StubExt.PROPERTY_KEY_STORE_PASSWORD, "org.jboss.remoting.keyStorePassword");
- configMap.put(StubExt.PROPERTY_KEY_STORE_TYPE, "org.jboss.remoting.keyStoreType");
- configMap.put(StubExt.PROPERTY_TRUST_STORE, "org.jboss.remoting.trustStore");
- configMap.put(StubExt.PROPERTY_TRUST_STORE_PASSWORD, "org.jboss.remoting.trustStorePassword");
- configMap.put(StubExt.PROPERTY_TRUST_STORE_TYPE, "org.jboss.remoting.trustStoreType");
- }
-
- private boolean closed;
-
- private static final RMChannel RM_CHANNEL = RMChannel.getInstance();
-
- public RemotingConnectionImpl()
- {
- // HTTPClientInvoker conect sends gratuitous POST
- // http://jira.jboss.com/jira/browse/JBWS-711
- clientConfig.put(Client.ENABLE_LEASE, false);
- }
-
- public boolean isClosed()
- {
- return closed;
- }
-
- public void setClosed(boolean closed)
- {
- this.closed = closed;
- }
-
- /**
- * Sends the given message to the specified endpoint.
- *
- * A null reqMessage signifies a HTTP GET request.
- */
- public MessageAbstraction invoke(MessageAbstraction reqMessage, Object endpoint, boolean oneway) throws IOException
- {
- if (endpoint == null)
- throw new IllegalArgumentException("Given endpoint cannot be null");
-
- if (closed)
- throw new IOException("Connection is already closed");
-
- Object timeout = null;
- String targetAddress;
- Map<String, Object> callProps = new HashMap<String, Object>();
-
- if (endpoint instanceof EndpointInfo)
- {
- EndpointInfo epInfo = (EndpointInfo)endpoint;
- targetAddress = epInfo.getTargetAddress();
- callProps = epInfo.getProperties();
-
- if (callProps.containsKey(StubExt.PROPERTY_CLIENT_TIMEOUT))
- {
- timeout = callProps.get(StubExt.PROPERTY_CLIENT_TIMEOUT);
- targetAddress = addURLParameter(targetAddress, "timeout", timeout.toString());
- }
-
- }
- else if (endpoint instanceof EndpointReference)
- {
- EndpointReference epr = (EndpointReference)endpoint;
- targetAddress = epr.getAddress().toString();
- }
- else
- {
- targetAddress = endpoint.toString();
- }
-
- // setup remoting client
- Map<String, Object> metadata = createRemotingMetaData(reqMessage, callProps);
- Marshaller marshaller = getMarshaller();
- UnMarshaller unmarshaller = getUnmarshaller();
- InvokerLocator locator = null;
- try
- {
- // Get the invoker from Remoting for a given endpoint address
- log.debug("Get locator for: " + endpoint);
-
- /**
- * [JBWS-1704] The Use Of Remoting Causes An Additional 'datatype' Parameter To Be Sent On All Requests
- *
- * An HTTPClientInvoker may disconnect from the server and recreated by the remoting layer.
- * In that case the new invoker does not inherit the marshaller/unmarshaller from the disconnected invoker.
- * We therefore explicitly specify the invoker locator datatype and register the SOAP marshaller/unmarshaller
- * with the MarshalFactory.
- *
- * This applies to remoting-1.4.5 and less
- */
- String version = getRemotingVersion();
- if (version.startsWith("1.4"))
- {
- targetAddress = addURLParameter(targetAddress, InvokerLocator.DATATYPE, "JBossWSMessage");
- MarshalFactory.addMarshaller("JBossWSMessage", marshaller, unmarshaller);
- }
-
- locator = new InvokerLocator(targetAddress);
- }
- catch (MalformedURLException e)
- {
- throw new IllegalArgumentException("Malformed endpoint address", e);
- }
-
- try
- {
- if (RMTransportHelper.isRMMessage(callProps))
- {
- RMMetadata rmMetadata = new RMMetadata(getRemotingVersion(), targetAddress, marshaller, unmarshaller, callProps, metadata, clientConfig);
- return RM_CHANNEL.send(reqMessage, rmMetadata);
- }
- else
- {
- Client client = new Client(locator, "jbossws", clientConfig);
- client.connect();
-
- client.setMarshaller(marshaller);
-
- if (oneway == false)
- client.setUnMarshaller(unmarshaller);
-
- if (log.isDebugEnabled())
- log.debug("Remoting metadata: " + metadata);
-
- // debug the outgoing message
- MessageTrace.traceMessage("Outgoing Request Message", reqMessage);
-
- MessageAbstraction resMessage = null;
-
- if (oneway == true)
- {
- client.invokeOneway(reqMessage, metadata, false);
- }
- else
- {
- resMessage = (MessageAbstraction)client.invoke(reqMessage, metadata);
- }
-
- // Disconnect the remoting client
- client.disconnect();
-
- callProps.clear();
- callProps.putAll(metadata);
-
- // trace the incomming response message
- MessageTrace.traceMessage("Incoming Response Message", resMessage);
-
- return resMessage;
- }
- }
- catch (Throwable th)
- {
- if (timeout != null && (th.getCause() instanceof SocketTimeoutException))
- {
- throw new WSTimeoutException("Timeout after: " + timeout + "ms", new Long(timeout.toString()));
- }
-
- IOException io = new IOException("Could not transmit message");
- io.initCause(th);
- throw io;
- }
- }
-
- private String addURLParameter(String urlStr, String key, String value) throws MalformedURLException
- {
- URL url = new URL(urlStr);
- urlStr += (url.getQuery() == null ? "?" : "&") + key + "=" + value;
- return urlStr;
- }
-
- private String getRemotingVersion()
- {
- String version = null;
- try
- {
- // Access the constant dynamically, otherwise it will be the compile time value
- Field field = Version.class.getDeclaredField("VERSION");
- version = (String)field.get(null);
- }
- catch (Exception ex)
- {
- throw new RuntimeException("Cannot obtain remoting version", ex);
- }
-
- if (version == null)
- {
- URL codeURL = Version.class.getProtectionDomain().getCodeSource().getLocation();
- throw new RuntimeException("Cannot obtain remoting version from: " + codeURL);
- }
- return version;
- }
-
- protected abstract UnMarshaller getUnmarshaller();
-
- protected abstract Marshaller getMarshaller();
-
- private Map<String, Object> createRemotingMetaData(MessageAbstraction reqMessage, Map callProps)
- {
- CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
-
- Map<String, Object> metadata = new HashMap<String, Object>();
-
- // We need to unmarshall faults (HTTP 500)
- // metadata.put(HTTPMetadataConstants.NO_THROW_ON_ERROR, "true"); // since 2.0.0.GA
- metadata.put("NoThrowOnError", "true");
-
- if (reqMessage != null)
- {
- populateHeaders(reqMessage, metadata);
-
- // Enable chunked encoding. This is the default size.
- clientConfig.put("chunkedLength", "1024");
-
- // May be overridden through endpoint config
- if (msgContext != null)
- {
- Properties epmdProps = msgContext.getEndpointMetaData().getProperties();
-
- // chunksize settings
- String chunkSizeValue = epmdProps.getProperty(EndpointProperty.CHUNKED_ENCODING_SIZE);
- int chunkSize = chunkSizeValue != null ? Integer.valueOf(chunkSizeValue) : -1;
- if (chunkSize > 0)
- {
- clientConfig.put(EndpointProperty.CHUNKED_ENCODING_SIZE, chunkSizeValue);
- }
- else
- {
- clientConfig.remove("chunkedLength");
- }
- }
- }
- else
- {
- metadata.put("TYPE", "GET");
- }
-
- if (callProps != null)
- {
- Iterator it = callProps.entrySet().iterator();
-
- // Get authentication type, default to BASIC authetication
- String authType = (String)callProps.get(StubExt.PROPERTY_AUTH_TYPE);
- if (authType == null)
- authType = StubExt.PROPERTY_AUTH_TYPE_BASIC;
-
- while (it.hasNext())
- {
- Map.Entry entry = (Map.Entry)it.next();
- String key = (String)entry.getKey();
- Object val = entry.getValue();
-
- // pass properties to remoting meta data
- if (metadataMap.containsKey(key))
- {
- String remotingKey = metadataMap.get(key);
- if ("http.basic.username".equals(remotingKey) || "http.basic.password".equals(remotingKey))
- {
- if (authType.equals(StubExt.PROPERTY_AUTH_TYPE_BASIC))
- {
- metadata.put(remotingKey, val);
- }
- else
- {
- log.warn("Ignore '" + key + "' with auth typy: " + authType);
- }
- }
- else
- {
- metadata.put(remotingKey, val);
- }
- }
-
- // pass properties to remoting client config
- if (configMap.containsKey(key))
- {
- String remotingKey = configMap.get(key);
- clientConfig.put(remotingKey, val);
- }
- }
- }
-
- return metadata;
- }
-
- protected void populateHeaders(MessageAbstraction reqMessage, Map<String, Object> metadata)
- {
- MimeHeaders mimeHeaders = reqMessage.getMimeHeaders();
-
- Properties props = new Properties();
- metadata.put("HEADER", props);
-
- Iterator i = mimeHeaders.getAllHeaders();
- while (i.hasNext())
- {
- MimeHeader header = (MimeHeader)i.next();
- String currentValue = props.getProperty(header.getName());
-
- /*
- * Coalesce multiple headers into one
- *
- * From HTTP/1.1 RFC 2616:
- *
- * Multiple message-header fields with the same field-name MAY be
- * present in a message if and only if the entire field-value for that
- * header field is defined as a comma-separated list [i.e., #(values)].
- * It MUST be possible to combine the multiple header fields into one
- * "field-name: field-value" pair, without changing the semantics of
- * the message, by appending each subsequent field-value to the first,
- * each separated by a comma.
- */
- if (currentValue != null)
- {
- props.put(header.getName(), currentValue + "," + header.getValue());
- }
- else
- {
- props.put(header.getName(), header.getValue());
- }
- }
- }
-}
Added: stack/native/trunk/src/main/java/org/jboss/ws/core/client/SOAPProtocolConnectionHTTP.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/core/client/SOAPProtocolConnectionHTTP.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/core/client/SOAPProtocolConnectionHTTP.java 2008-01-10 14:16:57 UTC (rev 5456)
@@ -0,0 +1,120 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.client;
+
+// $Id$
+
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Properties;
+
+import javax.xml.soap.MimeHeader;
+import javax.xml.soap.MimeHeaders;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+
+import org.jboss.remoting.marshal.Marshaller;
+import org.jboss.remoting.marshal.UnMarshaller;
+import org.jboss.ws.WSException;
+import org.jboss.ws.core.MessageAbstraction;
+import org.jboss.ws.core.soap.SOAPMessageMarshaller;
+import org.jboss.ws.core.soap.SOAPMessageUnMarshallerHTTP;
+import org.jboss.ws.extensions.xop.XOPContext;
+
+/**
+ * SOAPConnection implementation
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @author <a href="mailto:jason@stacksmash.com">Jason T. Greene</a>
+ *
+ * @since 02-Apr-2007
+ */
+public class SOAPProtocolConnectionHTTP extends HTTPRemotingConnection
+{
+ public UnMarshaller getUnmarshaller()
+ {
+ return new SOAPMessageUnMarshallerHTTP();
+ }
+
+ public Marshaller getMarshaller()
+ {
+ return new SOAPMessageMarshaller();
+ }
+
+ public MessageAbstraction invoke(MessageAbstraction reqMessage, Object endpoint, boolean oneway) throws IOException
+ {
+ try
+ {
+ // enforce xop transitions
+ // TODO: there should be a clear transition to an immutable object model
+ XOPContext.eagerlyCreateAttachments();
+
+ // save object model changes
+ SOAPMessage soapMessage = (SOAPMessage)reqMessage;
+ if (reqMessage != null && soapMessage.saveRequired())
+ soapMessage.saveChanges();
+
+ return super.invoke(reqMessage, endpoint, oneway);
+ }
+ catch (SOAPException ex)
+ {
+ IOException io = new IOException();
+ io.initCause(ex);
+ throw io;
+ }
+ }
+
+ protected void populateHeaders(MessageAbstraction reqMessage, Map<String, Object> metadata)
+ {
+ super.populateHeaders(reqMessage, metadata);
+
+ Properties props = (Properties)metadata.get("HEADER");
+
+ // R2744 A HTTP request MESSAGE MUST contain a SOAPAction HTTP header field
+ // with a quoted value equal to the value of the soapAction attribute of
+ // soapbind:operation, if present in the corresponding WSDL description.
+
+ // R2745 A HTTP request MESSAGE MUST contain a SOAPAction HTTP header field
+ // with a quoted empty string value, if in the corresponding WSDL description,
+ // the soapAction attribute of soapbind:operation is either not present, or
+ // present with an empty string as its value.
+
+ MimeHeaders mimeHeaders = reqMessage.getMimeHeaders();
+ String[] action = mimeHeaders.getHeader("SOAPAction");
+ if (action != null && action.length > 0)
+ {
+ String soapAction = action[0];
+
+ // R1109 The value of the SOAPAction HTTP header field in a HTTP request MESSAGE MUST be a quoted string.
+ if (soapAction.startsWith("\"") == false || soapAction.endsWith("\"") == false)
+ soapAction = "\"" + soapAction + "\"";
+
+ props.put("SOAPAction", soapAction);
+ }
+ else
+ {
+ props.put("SOAPAction", "\"\"");
+ }
+
+ }
+}
Property changes on: stack/native/trunk/src/main/java/org/jboss/ws/core/client/SOAPProtocolConnectionHTTP.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: stack/native/trunk/src/main/java/org/jboss/ws/core/client/SOAPProtocolConnectionJMS.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/core/client/SOAPProtocolConnectionJMS.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/core/client/SOAPProtocolConnectionJMS.java 2008-01-10 14:16:57 UTC (rev 5456)
@@ -0,0 +1,205 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.client;
+
+// $Id$
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.net.URI;
+import java.util.StringTokenizer;
+
+import javax.jms.BytesMessage;
+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.InitialContext;
+import javax.xml.ws.addressing.EndpointReference;
+
+import org.jboss.remoting.marshal.Marshaller;
+import org.jboss.remoting.marshal.UnMarshaller;
+import org.jboss.ws.core.MessageAbstraction;
+import org.jboss.ws.core.soap.SOAPMessageMarshaller;
+import org.jboss.ws.core.soap.SOAPMessageUnMarshaller;
+
+/**
+ * A SOAPConnection over JMS
+ *
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 10-Jan-2008
+ */
+public class SOAPProtocolConnectionJMS implements RemoteConnection
+{
+ private boolean waitForResponse;
+
+ public UnMarshaller getUnmarshaller()
+ {
+ return new SOAPMessageUnMarshaller();
+ }
+
+ public Marshaller getMarshaller()
+ {
+ return new SOAPMessageMarshaller();
+ }
+
+ public MessageAbstraction invoke(MessageAbstraction reqMessage, Object endpoint, boolean oneway) throws IOException
+ {
+ if (endpoint == null)
+ throw new IllegalArgumentException("Given endpoint cannot be null");
+
+ // Get target address
+ String targetAddress;
+ if (endpoint instanceof EndpointInfo)
+ {
+ EndpointInfo epInfo = (EndpointInfo)endpoint;
+ targetAddress = epInfo.getTargetAddress();
+ }
+ else if (endpoint instanceof EndpointReference)
+ {
+ EndpointReference epr = (EndpointReference)endpoint;
+ targetAddress = epr.getAddress().toString();
+ }
+ else
+ {
+ targetAddress = endpoint.toString();
+ }
+
+ try
+ {
+ URI jmsURI = new URI(targetAddress);
+ String uriHost = jmsURI.getHost();
+ String uriPath = jmsURI.getPath();
+
+ String reqQueueName = getURLProperty(jmsURI, "destinationName");
+ if (reqQueueName == null)
+ {
+ reqQueueName = uriHost;
+ if (uriPath != null && uriPath.length() > 0)
+ reqQueueName += uriPath;
+ }
+
+ InitialContext context = new InitialContext();
+ QueueConnectionFactory connectionFactory = (QueueConnectionFactory)context.lookup("ConnectionFactory");
+ Queue reqQueue = (Queue)context.lookup(reqQueueName);
+
+ QueueConnection con = connectionFactory.createQueueConnection();
+ QueueSession session = con.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
+ con.start();
+
+ ByteArrayOutputStream output = new ByteArrayOutputStream();
+ getMarshaller().write(reqMessage, output);
+ BytesMessage message = session.createBytesMessage();
+ message.writeBytes(output.toByteArray());
+
+ ResponseListener responseListener = null;
+ if (oneway == false)
+ {
+ String resQueueName = getURLProperty(jmsURI, "replyToName");
+ Queue resQueue = (Queue)context.lookup(resQueueName);
+ QueueReceiver receiver = session.createReceiver(resQueue);
+ responseListener = new ResponseListener();
+ receiver.setMessageListener(responseListener);
+ message.setJMSReplyTo(resQueue);
+ waitForResponse = true;
+ }
+
+ QueueSender sender = session.createSender(reqQueue);
+ sender.send(message);
+ sender.close();
+
+ MessageAbstraction resMessage = null;
+ if (responseListener != null)
+ {
+ int timeout = 5000;
+ while (waitForResponse && timeout > 0)
+ {
+ Thread.sleep(100);
+ timeout -= 100;
+ }
+
+ ByteArrayInputStream bais = new ByteArrayInputStream(responseListener.resMessage.getBytes());
+ resMessage = (MessageAbstraction)getUnmarshaller().read(bais, null);
+ }
+
+ con.stop();
+ session.close();
+ con.close();
+
+ return resMessage;
+ }
+ catch (RuntimeException ex)
+ {
+ throw ex;
+ }
+ catch (Exception ex)
+ {
+ IOException ioex = new IOException(ex.getMessage());
+ ioex.initCause(ex);
+ throw ioex;
+ }
+ }
+
+ private String getURLProperty(URI uri, String key)
+ {
+ String retValue = null;
+ String query = uri.getQuery();
+ if (query != null)
+ {
+ StringTokenizer st = new StringTokenizer(query, "?:=");
+ while (retValue == null && st.hasMoreTokens())
+ {
+ String propName = st.nextToken();
+ String propValue = st.nextToken();
+ if (propName.equals(key))
+ retValue = propValue;
+ }
+ }
+ return retValue;
+ }
+
+ public 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();
+ }
+ }
+ }
+}
Property changes on: stack/native/trunk/src/main/java/org/jboss/ws/core/client/SOAPProtocolConnectionJMS.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Deleted: stack/native/trunk/src/main/java/org/jboss/ws/core/client/SOAPRemotingConnection.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/core/client/SOAPRemotingConnection.java 2008-01-10 12:21:02 UTC (rev 5455)
+++ stack/native/trunk/src/main/java/org/jboss/ws/core/client/SOAPRemotingConnection.java 2008-01-10 14:16:57 UTC (rev 5456)
@@ -1,120 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.client;
-
-// $Id$
-
-import java.io.IOException;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Properties;
-
-import javax.xml.soap.MimeHeader;
-import javax.xml.soap.MimeHeaders;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPMessage;
-
-import org.jboss.remoting.marshal.Marshaller;
-import org.jboss.remoting.marshal.UnMarshaller;
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.MessageAbstraction;
-import org.jboss.ws.core.soap.SOAPMessageMarshaller;
-import org.jboss.ws.core.soap.SOAPMessageUnMarshaller;
-import org.jboss.ws.extensions.xop.XOPContext;
-
-/**
- * SOAPConnection implementation
- *
- * @author Thomas.Diesler(a)jboss.org
- * @author <a href="mailto:jason@stacksmash.com">Jason T. Greene</a>
- *
- * @since 02-Apr-2007
- */
-public class SOAPRemotingConnection extends RemotingConnectionImpl
-{
- protected UnMarshaller getUnmarshaller()
- {
- return new SOAPMessageUnMarshaller();
- }
-
- protected Marshaller getMarshaller()
- {
- return new SOAPMessageMarshaller();
- }
-
- public MessageAbstraction invoke(MessageAbstraction reqMessage, Object endpoint, boolean oneway) throws IOException
- {
- try
- {
- // enforce xop transitions
- // TODO: there should be a clear transition to an immutable object model
- XOPContext.eagerlyCreateAttachments();
-
- // save object model changes
- SOAPMessage soapMessage = (SOAPMessage)reqMessage;
- if (reqMessage != null && soapMessage.saveRequired())
- soapMessage.saveChanges();
-
- return super.invoke(reqMessage, endpoint, oneway);
- }
- catch (SOAPException ex)
- {
- IOException io = new IOException();
- io.initCause(ex);
- throw io;
- }
- }
-
- protected void populateHeaders(MessageAbstraction reqMessage, Map<String, Object> metadata)
- {
- super.populateHeaders(reqMessage, metadata);
-
- Properties props = (Properties)metadata.get("HEADER");
-
- // R2744 A HTTP request MESSAGE MUST contain a SOAPAction HTTP header field
- // with a quoted value equal to the value of the soapAction attribute of
- // soapbind:operation, if present in the corresponding WSDL description.
-
- // R2745 A HTTP request MESSAGE MUST contain a SOAPAction HTTP header field
- // with a quoted empty string value, if in the corresponding WSDL description,
- // the soapAction attribute of soapbind:operation is either not present, or
- // present with an empty string as its value.
-
- MimeHeaders mimeHeaders = reqMessage.getMimeHeaders();
- String[] action = mimeHeaders.getHeader("SOAPAction");
- if (action != null && action.length > 0)
- {
- String soapAction = action[0];
-
- // R1109 The value of the SOAPAction HTTP header field in a HTTP request MESSAGE MUST be a quoted string.
- if (soapAction.startsWith("\"") == false || soapAction.endsWith("\"") == false)
- soapAction = "\"" + soapAction + "\"";
-
- props.put("SOAPAction", soapAction);
- }
- else
- {
- props.put("SOAPAction", "\"\"");
- }
-
- }
-}
Modified: stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws/client/DispatchImpl.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws/client/DispatchImpl.java 2008-01-10 12:21:02 UTC (rev 5455)
+++ stack/native/trunk/src/main/java/org/jboss/ws/core/jaxws/client/DispatchImpl.java 2008-01-10 14:16:57 UTC (rev 5456)
@@ -60,9 +60,9 @@
import org.jboss.ws.core.ConfigProvider;
import org.jboss.ws.core.MessageAbstraction;
import org.jboss.ws.core.client.EndpointInfo;
-import org.jboss.ws.core.client.HTTPRemotingConnection;
-import org.jboss.ws.core.client.RemotingConnection;
-import org.jboss.ws.core.client.SOAPRemotingConnection;
+import org.jboss.ws.core.client.HTTPProtocolConnection;
+import org.jboss.ws.core.client.RemoteConnection;
+import org.jboss.ws.core.client.SOAPProtocolConnectionHTTP;
import org.jboss.ws.core.jaxws.binding.BindingExt;
import org.jboss.ws.core.jaxws.binding.BindingProviderImpl;
import org.jboss.ws.core.jaxws.handler.HandlerChainExecutor;
@@ -280,20 +280,20 @@
return retObj;
}
- private RemotingConnection getRemotingConnection()
+ private RemoteConnection getRemotingConnection()
{
String bindingID = ((Binding21)bindingProvider.getBinding()).getBindingID();
if (EndpointMetaData.SUPPORTED_BINDINGS.contains(bindingID) == false)
throw new IllegalStateException("Unsupported binding: " + bindingID);
- RemotingConnection remotingConnection;
+ RemoteConnection remotingConnection;
if (HTTPBinding.HTTP_BINDING.equals(bindingID))
{
- remotingConnection = new HTTPRemotingConnection();
+ remotingConnection = new HTTPProtocolConnection();
}
else
{
- remotingConnection = new SOAPRemotingConnection();
+ remotingConnection = new SOAPProtocolConnectionHTTP();
}
return remotingConnection;
}
Modified: stack/native/trunk/src/main/java/org/jboss/ws/core/soap/SOAPConnectionImpl.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/core/soap/SOAPConnectionImpl.java 2008-01-10 12:21:02 UTC (rev 5455)
+++ stack/native/trunk/src/main/java/org/jboss/ws/core/soap/SOAPConnectionImpl.java 2008-01-10 14:16:57 UTC (rev 5456)
@@ -23,16 +23,14 @@
// $Id$
-import java.io.IOException;
-
import javax.xml.soap.SOAPConnection;
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPMessage;
import org.jboss.logging.Logger;
import org.jboss.ws.core.MessageAbstraction;
-import org.jboss.ws.core.client.RemotingConnectionImpl;
-import org.jboss.ws.core.client.SOAPRemotingConnection;
+import org.jboss.ws.core.client.HTTPRemotingConnection;
+import org.jboss.ws.core.client.SOAPProtocolConnectionHTTP;
/**
* SOAPConnection implementation
@@ -47,11 +45,11 @@
// provide logging
private static Logger log = Logger.getLogger(SOAPConnectionImpl.class);
- private RemotingConnectionImpl remotingConnection;
+ private HTTPRemotingConnection remotingConnection;
public SOAPConnectionImpl()
{
- remotingConnection = new SOAPRemotingConnection();
+ remotingConnection = new SOAPProtocolConnectionHTTP();
}
/**
Modified: stack/native/trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageUnMarshaller.java
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageUnMarshaller.java 2008-01-10 12:21:02 UTC (rev 5455)
+++ stack/native/trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageUnMarshaller.java 2008-01-10 14:16:57 UTC (rev 5456)
@@ -25,20 +25,13 @@
import java.io.IOException;
import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
import java.util.Map;
-import javax.servlet.http.HttpServletResponse;
-import javax.xml.soap.MimeHeaders;
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPMessage;
import org.jboss.logging.Logger;
import org.jboss.remoting.marshal.UnMarshaller;
-import org.jboss.remoting.transport.http.HTTPMetadataConstants;
-import org.jboss.ws.WSException;
/**
* @author Thomas.Diesler(a)jboss.org
@@ -49,15 +42,6 @@
// Provide logging
private static Logger log = Logger.getLogger(SOAPMessageUnMarshaller.class);
- private static List validResponseCodes = new ArrayList();
- static
- {
- validResponseCodes.add(HttpServletResponse.SC_OK);
- validResponseCodes.add(HttpServletResponse.SC_ACCEPTED);
- validResponseCodes.add(HttpServletResponse.SC_NO_CONTENT);
- validResponseCodes.add(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
- }
-
public Object read(InputStream inputStream, Map metadata) throws IOException, ClassNotFoundException
{
if (log.isTraceEnabled())
@@ -65,25 +49,8 @@
try
{
- Integer resCode = (Integer)metadata.get(HTTPMetadataConstants.RESPONSE_CODE);
- if (resCode == null)
- {
- log.warn("No HTTP resonse code, assuming: SC_OK");
- resCode = HttpServletResponse.SC_OK;
- }
-
- String resMessage = (String)metadata.get(HTTPMetadataConstants.RESPONSE_CODE_MESSAGE);
- if (validResponseCodes.contains(resCode) == false)
- throw new WSException("Invalid HTTP server response [" + resCode + "] - " + resMessage);
+ SOAPMessage soapMsg = new MessageFactoryImpl().createMessage(null, inputStream, true);
- // [JBWS-859] SOAPMessageUnMarshaller doesn't support HTTP server response [204] - No Content
- SOAPMessage soapMsg = null;
- if (resCode != HttpServletResponse.SC_NO_CONTENT)
- {
- MimeHeaders mimeHeaders = getMimeHeaders(metadata);
- soapMsg = new MessageFactoryImpl().createMessage(mimeHeaders, inputStream, true);
- }
-
return soapMsg;
}
catch (SOAPException e)
@@ -95,42 +62,12 @@
}
}
- /**
- * Set the class loader to use for unmarhsalling. This may
- * be needed when need to have access to class definitions that
- * are not part of this unmarshaller's parent classloader (especially
- * when doing remote classloading).
- *
- * @param classloader
- */
public void setClassLoader(ClassLoader classloader)
{
- //NO OP
}
public UnMarshaller cloneUnMarshaller() throws CloneNotSupportedException
{
return new SOAPMessageUnMarshaller();
}
-
- private MimeHeaders getMimeHeaders(Map metadata)
- {
- log.debug("getMimeHeaders from: " + metadata);
-
- MimeHeaders headers = new MimeHeaders();
- Iterator i = metadata.keySet().iterator();
- while (i.hasNext())
- {
- String key = (String)i.next();
- Object value = metadata.get(key);
- if (key != null && value instanceof List)
- {
- for (Object listValue : (List)value)
- {
- headers.addHeader(key, listValue.toString());
- }
- }
- }
- return headers;
- }
}
Copied: stack/native/trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageUnMarshallerHTTP.java (from rev 5449, stack/native/trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageUnMarshaller.java)
===================================================================
--- stack/native/trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageUnMarshallerHTTP.java (rev 0)
+++ stack/native/trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageUnMarshallerHTTP.java 2008-01-10 14:16:57 UTC (rev 5456)
@@ -0,0 +1,136 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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;
+
+// $Id$
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletResponse;
+import javax.xml.soap.MimeHeaders;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+
+import org.jboss.logging.Logger;
+import org.jboss.remoting.marshal.UnMarshaller;
+import org.jboss.remoting.transport.http.HTTPMetadataConstants;
+import org.jboss.ws.WSException;
+
+/**
+ * @author Thomas.Diesler(a)jboss.org
+ * @since 25-Nov-2004
+ */
+public class SOAPMessageUnMarshallerHTTP implements UnMarshaller
+{
+ // Provide logging
+ private static Logger log = Logger.getLogger(SOAPMessageUnMarshallerHTTP.class);
+
+ private static List validResponseCodes = new ArrayList();
+ static
+ {
+ validResponseCodes.add(HttpServletResponse.SC_OK);
+ validResponseCodes.add(HttpServletResponse.SC_ACCEPTED);
+ validResponseCodes.add(HttpServletResponse.SC_NO_CONTENT);
+ validResponseCodes.add(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+ }
+
+ public Object read(InputStream inputStream, Map metadata) throws IOException, ClassNotFoundException
+ {
+ if (log.isTraceEnabled())
+ log.trace("Read input stream with metadata=" + metadata);
+
+ try
+ {
+ Integer resCode = (Integer)metadata.get(HTTPMetadataConstants.RESPONSE_CODE);
+ if (resCode == null)
+ {
+ log.warn("No HTTP resonse code, assuming: SC_OK");
+ resCode = HttpServletResponse.SC_OK;
+ }
+
+ String resMessage = (String)metadata.get(HTTPMetadataConstants.RESPONSE_CODE_MESSAGE);
+ if (validResponseCodes.contains(resCode) == false)
+ throw new WSException("Invalid HTTP server response [" + resCode + "] - " + resMessage);
+
+ // [JBWS-859] SOAPMessageUnMarshaller doesn't support HTTP server response [204] - No Content
+ SOAPMessage soapMsg = null;
+ if (resCode != HttpServletResponse.SC_NO_CONTENT)
+ {
+ MimeHeaders mimeHeaders = getMimeHeaders(metadata);
+ soapMsg = new MessageFactoryImpl().createMessage(mimeHeaders, inputStream, true);
+ }
+
+ return soapMsg;
+ }
+ catch (SOAPException e)
+ {
+ log.error("Cannot unmarshall SOAPMessage", e);
+ IOException e2 = new IOException(e.toString());
+ e2.initCause(e);
+ throw e2;
+ }
+ }
+
+ /**
+ * Set the class loader to use for unmarhsalling. This may
+ * be needed when need to have access to class definitions that
+ * are not part of this unmarshaller's parent classloader (especially
+ * when doing remote classloading).
+ *
+ * @param classloader
+ */
+ public void setClassLoader(ClassLoader classloader)
+ {
+ //NO OP
+ }
+
+ public UnMarshaller cloneUnMarshaller() throws CloneNotSupportedException
+ {
+ return new SOAPMessageUnMarshallerHTTP();
+ }
+
+ private MimeHeaders getMimeHeaders(Map metadata)
+ {
+ log.debug("getMimeHeaders from: " + metadata);
+
+ MimeHeaders headers = new MimeHeaders();
+ Iterator i = metadata.keySet().iterator();
+ while (i.hasNext())
+ {
+ String key = (String)i.next();
+ Object value = metadata.get(key);
+ if (key != null && value instanceof List)
+ {
+ for (Object listValue : (List)value)
+ {
+ headers.addHeader(key, listValue.toString());
+ }
+ }
+ }
+ return headers;
+ }
+}
Added: stack/native/trunk/src/main/resources/jbossws-core.jar/META-INF/services/org.jboss.ws.core.client.RemoteConnection.http
===================================================================
--- stack/native/trunk/src/main/resources/jbossws-core.jar/META-INF/services/org.jboss.ws.core.client.RemoteConnection.http (rev 0)
+++ stack/native/trunk/src/main/resources/jbossws-core.jar/META-INF/services/org.jboss.ws.core.client.RemoteConnection.http 2008-01-10 14:16:57 UTC (rev 5456)
@@ -0,0 +1 @@
+org.jboss.ws.core.client.SOAPProtocolConnectionHTTP
\ No newline at end of file
Added: stack/native/trunk/src/main/resources/jbossws-core.jar/META-INF/services/org.jboss.ws.core.client.RemoteConnection.jms
===================================================================
--- stack/native/trunk/src/main/resources/jbossws-core.jar/META-INF/services/org.jboss.ws.core.client.RemoteConnection.jms (rev 0)
+++ stack/native/trunk/src/main/resources/jbossws-core.jar/META-INF/services/org.jboss.ws.core.client.RemoteConnection.jms 2008-01-10 14:16:57 UTC (rev 5456)
@@ -0,0 +1 @@
+org.jboss.ws.core.client.SOAPProtocolConnectionJMS
\ No newline at end of file
Modified: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/jmstransport/JMSTransportTestCase.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/jmstransport/JMSTransportTestCase.java 2008-01-10 12:21:02 UTC (rev 5455)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/jmstransport/JMSTransportTestCase.java 2008-01-10 14:16:57 UTC (rev 5456)
@@ -8,6 +8,9 @@
// $Id$
+import java.io.File;
+import java.net.URL;
+
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.Queue;
@@ -19,6 +22,8 @@
import javax.jms.Session;
import javax.jms.TextMessage;
import javax.naming.InitialContext;
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
import org.jboss.wsf.test.JBossWSTest;
import org.jboss.wsf.test.JBossWSTestSetup;
@@ -42,11 +47,34 @@
return new JBossWSTestSetup(JMSTransportTestCase.class, "jaxws-samples-jmstransport.sar");
}
- /**
- * Send the message to the specified queue
- */
- public void testSOAPMessageToEndpointQueue() throws Exception
+ public void testJMSEndpointPort() throws Exception
{
+ URL wsdlURL = new File("resources/jaxws/samples/jmstransport/jmsservice.wsdl").toURL();
+ QName serviceName = new QName("http://org.jboss.ws/samples/jmstransport", "OrganizationJMSEndpointService");
+ QName portName = new QName("http://org.jboss.ws/samples/jmstransport", "JMSEndpointPort");
+
+ Service service = Service.create(wsdlURL, serviceName);
+ Organization port = service.getPort(portName, Organization.class);
+
+ String res = port.getContactInfo("mafia");
+ assertEquals("The 'mafia' boss is currently out of office, please call again.", res);
+ }
+
+ public void testHTTPEndpointPort() throws Exception
+ {
+ URL wsdlURL = new File("resources/jaxws/samples/jmstransport/jmsservice.wsdl").toURL();
+ QName serviceName = new QName("http://org.jboss.ws/samples/jmstransport", "OrganizationJMSEndpointService");
+ QName portName = new QName("http://org.jboss.ws/samples/jmstransport", "HTTPEndpointPort");
+
+ Service service = Service.create(wsdlURL, serviceName);
+ Organization port = service.getPort(portName, Organization.class);
+
+ String res = port.getContactInfo("mafia");
+ assertEquals("The 'mafia' boss is currently out of office, please call again.", res);
+ }
+
+ public void testMessagingClient() throws Exception
+ {
String reqMessage =
"<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>" +
"<env:Body>" +
Modified: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/jmstransport/Organization.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/jmstransport/Organization.java 2008-01-10 12:21:02 UTC (rev 5455)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/jmstransport/Organization.java 2008-01-10 14:16:57 UTC (rev 5456)
@@ -1,34 +1,32 @@
/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt 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.
- */
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.test.ws.jaxws.samples.jmstransport;
-import java.rmi.Remote;
-
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
@WebService
@SOAPBinding(style = SOAPBinding.Style.RPC)
-public interface Organization extends Remote
+public interface Organization
{
String getContactInfo(String organization);
}
Modified: stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/jmstransport/OrganizationJMSEndpoint.java
===================================================================
--- stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/jmstransport/OrganizationJMSEndpoint.java 2008-01-10 12:21:02 UTC (rev 5455)
+++ stack/native/trunk/src/test/java/org/jboss/test/ws/jaxws/samples/jmstransport/OrganizationJMSEndpoint.java 2008-01-10 14:16:57 UTC (rev 5456)
@@ -12,12 +12,14 @@
import javax.ejb.ActivationConfigProperty;
import javax.ejb.MessageDriven;
+import javax.jms.Message;
import javax.jws.WebMethod;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
import org.jboss.logging.Logger;
import org.jboss.ws.core.transport.jms.JMSTransportSupportEJB3;
+import org.jboss.wsf.spi.annotation.WebContext;
/**
* An example of a MDB acting as a web service endpoint.
@@ -26,6 +28,7 @@
* @since 09-Jan-2008
*/
@WebService (targetNamespace = "http://org.jboss.ws/samples/jmstransport")
+@WebContext (contextRoot = "/jaxws-samples-jmstransport")
@SOAPBinding(style = SOAPBinding.Style.RPC)
@MessageDriven(activationConfig = {
@@ -42,4 +45,11 @@
log.info("getContactInfo: " + organization);
return "The '" + organization + "' boss is currently out of office, please call again.";
}
+
+ @Override
+ public void onMessage(Message message)
+ {
+ log.info("onMessage: " + message);
+ super.onMessage(message);
+ }
}
Added: stack/native/trunk/src/test/resources/jaxws/samples/jmstransport/jmsservice.wsdl
===================================================================
--- stack/native/trunk/src/test/resources/jaxws/samples/jmstransport/jmsservice.wsdl (rev 0)
+++ stack/native/trunk/src/test/resources/jaxws/samples/jmstransport/jmsservice.wsdl 2008-01-10 14:16:57 UTC (rev 5456)
@@ -0,0 +1,55 @@
+<definitions name='OrganizationJMSEndpointService' targetNamespace='http://org.jboss.ws/samples/jmstransport' xmlns='http://schemas.xmlsoap.org/wsdl/'
+ xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' xmlns:tns='http://org.jboss.ws/samples/jmstransport' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
+
+ <types></types>
+
+ <message name='OrganizationJMSEndpoint_getContactInfoResponse'>
+ <part name='return' type='xsd:string'></part>
+ </message>
+ <message name='OrganizationJMSEndpoint_getContactInfo'>
+ <part name='arg0' type='xsd:string'></part>
+ </message>
+
+ <portType name='OrganizationJMSEndpoint'>
+ <operation name='getContactInfo' parameterOrder='arg0'>
+ <input message='tns:OrganizationJMSEndpoint_getContactInfo'></input>
+ <output message='tns:OrganizationJMSEndpoint_getContactInfoResponse'></output>
+ </operation>
+ </portType>
+
+ <binding name='HTTPBinding' type='tns:OrganizationJMSEndpoint'>
+ <soap:binding style='rpc' transport='http://schemas.xmlsoap.org/soap/http'/>
+ <operation name='getContactInfo'>
+ <soap:operation soapAction=''/>
+ <input>
+ <soap:body namespace='http://org.jboss.ws/samples/jmstransport' use='literal'/>
+ </input>
+ <output>
+ <soap:body namespace='http://org.jboss.ws/samples/jmstransport' use='literal'/>
+ </output>
+ </operation>
+ </binding>
+
+ <binding name='JMSBinding' type='tns:OrganizationJMSEndpoint'>
+ <soap:binding style='rpc' transport='http://www.example.org/2006/06/soap/bindings/JMS/'/>
+ <operation name='getContactInfo'>
+ <soap:operation soapAction=''/>
+ <input>
+ <soap:body namespace='http://org.jboss.ws/samples/jmstransport' use='literal'/>
+ </input>
+ <output>
+ <soap:body namespace='http://org.jboss.ws/samples/jmstransport' use='literal'/>
+ </output>
+ </operation>
+ </binding>
+
+ <service name='OrganizationJMSEndpointService'>
+ <port binding='tns:HTTPBinding' name='HTTPEndpointPort'>
+ <soap:address location='http://@jboss.bind.address@:8080/jaxws-samples-jmstransport/OrganizationJMSEndpoint'/>
+ </port>
+ <port binding='tns:JMSBinding' name='JMSEndpointPort'>
+ <soap:address location='jms://queue/RequestQueue?replyToName=queue/ResponseQueue'/>
+ </port>
+ </service>
+
+</definitions>
\ No newline at end of file
Property changes on: stack/native/trunk/src/test/resources/jaxws/samples/jmstransport/jmsservice.wsdl
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
16 years, 12 months