[jboss-svn-commits] JBL Code SVN: r14934 - in labs/jbossesb/workspace/webservice_mtom_qs: src and 15 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Fri Sep 7 08:03:26 EDT 2007


Author: tfennelly
Date: 2007-09-07 08:03:25 -0400 (Fri, 07 Sep 2007)
New Revision: 14934

Added:
   labs/jbossesb/workspace/webservice_mtom_qs/build.xml
   labs/jbossesb/workspace/webservice_mtom_qs/deployment.xml
   labs/jbossesb/workspace/webservice_mtom_qs/jbm-queue-service.xml
   labs/jbossesb/workspace/webservice_mtom_qs/jbmq-queue-service.xml
   labs/jbossesb/workspace/webservice_mtom_qs/jboss-esb.xml
   labs/jbossesb/workspace/webservice_mtom_qs/jndi.properties
   labs/jbossesb/workspace/webservice_mtom_qs/lib/
   labs/jbossesb/workspace/webservice_mtom_qs/log4j.xml
   labs/jbossesb/workspace/webservice_mtom_qs/readme.txt
   labs/jbossesb/workspace/webservice_mtom_qs/src/
   labs/jbossesb/workspace/webservice_mtom_qs/src/META-INF/
   labs/jbossesb/workspace/webservice_mtom_qs/src/META-INF/standard-jaxws-client-config.xml
   labs/jbossesb/workspace/webservice_mtom_qs/src/org/
   labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/
   labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/
   labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/
   labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/
   labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/
   labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/
   labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/test/
   labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/test/SendMessage.java
   labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/test/soap_message_01.xml
   labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/test/soap_message_02.xml
   labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/
   labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/DHRequest.java
   labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/DHResponse.java
   labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/ImageRequest.java
   labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/ImageResponse.java
   labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/MTOMEndpoint.java
   labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/MTOMEndpointBean.java
   labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/MTOMProtocolHandler.java
   labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/SourceRequest.java
   labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/SourceResponse.java
   labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/XOPSupport.java
   labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/client/
   labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/client/MTOMClient.java
   labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/client/jboss.png
   labs/jbossesb/workspace/webservice_mtom_qs/war/
   labs/jbossesb/workspace/webservice_mtom_qs/war/resources/
   labs/jbossesb/workspace/webservice_mtom_qs/war/resources/WEB-INF/
   labs/jbossesb/workspace/webservice_mtom_qs/war/resources/WEB-INF/web.xml
   labs/jbossesb/workspace/webservice_mtom_qs/war/view/
   labs/jbossesb/workspace/webservice_mtom_qs/war/view/index.jsp
Log:
added

Added: labs/jbossesb/workspace/webservice_mtom_qs/build.xml
===================================================================
--- labs/jbossesb/workspace/webservice_mtom_qs/build.xml	                        (rev 0)
+++ labs/jbossesb/workspace/webservice_mtom_qs/build.xml	2007-09-07 12:03:25 UTC (rev 14934)
@@ -0,0 +1,30 @@
+<project name="Quickstart_webservice_mtom" default="deploy" basedir=".">
+	
+	<description> 
+		${ant.project.name}
+		${line.separator}
+	</description>
+			
+	<!-- Import the base Ant build script... -->
+	<import file="../conf/base-build.xml"/>
+
+    <target name="quickstart-specific-dependencies" depends="assert-ws-available">
+        <path id="quickstart-dependencies-classpath">
+            <fileset dir="${org.jboss.esb.server.home}/client" includes="jbossws-client.jar,jboss-remoting.jar" />
+        </path>
+    </target>
+	
+    <target name="quickstart-specific-assemblies">
+        <!-- Overriden from the target of the same name in base-build.xml. -->
+        <!-- Called by the "deploy" target.  Don't call directly!! -->
+
+        <!-- Build the webservice... -->
+        <war warfile="build/${ant.project.name}.war"
+             webxml="${basedir}/war/resources/WEB-INF/web.xml">
+            <fileset dir="${basedir}/war/view">
+                <include name="**/*"/>
+            </fileset>
+        </war>
+    </target>
+
+</project>


Property changes on: labs/jbossesb/workspace/webservice_mtom_qs/build.xml
___________________________________________________________________
Name: svn:mime-type
   + text/xml
Name: svn:eol-style
   + native

Added: labs/jbossesb/workspace/webservice_mtom_qs/deployment.xml
===================================================================
--- labs/jbossesb/workspace/webservice_mtom_qs/deployment.xml	                        (rev 0)
+++ labs/jbossesb/workspace/webservice_mtom_qs/deployment.xml	2007-09-07 12:03:25 UTC (rev 14934)
@@ -0,0 +1,6 @@
+<jbossesb-deployment>
+    <depends>jboss.esb:deployment=soap.esb</depends>
+    <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_webservice_mtom_esb</depends>
+    <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_webservice_mtom_esb_reply
+    </depends>
+</jbossesb-deployment>


Property changes on: labs/jbossesb/workspace/webservice_mtom_qs/deployment.xml
___________________________________________________________________
Name: svn:mime-type
   + text/xml
Name: svn:eol-style
   + native

Added: labs/jbossesb/workspace/webservice_mtom_qs/jbm-queue-service.xml
===================================================================
--- labs/jbossesb/workspace/webservice_mtom_qs/jbm-queue-service.xml	                        (rev 0)
+++ labs/jbossesb/workspace/webservice_mtom_qs/jbm-queue-service.xml	2007-09-07 12:03:25 UTC (rev 14934)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+    <mbean code="org.jboss.jms.server.destination.QueueService"
+           name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_webservice_mtom_esb"
+           xmbean-dd="xmdesc/Queue-xmbean.xml">
+        <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+        <depends>jboss.messaging:service=PostOffice</depends>
+    </mbean>
+    <mbean code="org.jboss.jms.server.destination.QueueService"
+           name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_webservice_mtom_esb_reply"
+           xmbean-dd="xmdesc/Queue-xmbean.xml">
+        <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+        <depends>jboss.messaging:service=PostOffice</depends>
+    </mbean>
+</server>


Property changes on: labs/jbossesb/workspace/webservice_mtom_qs/jbm-queue-service.xml
___________________________________________________________________
Name: svn:mime-type
   + text/xml
Name: svn:eol-style
   + native

Added: labs/jbossesb/workspace/webservice_mtom_qs/jbmq-queue-service.xml
===================================================================
--- labs/jbossesb/workspace/webservice_mtom_qs/jbmq-queue-service.xml	                        (rev 0)
+++ labs/jbossesb/workspace/webservice_mtom_qs/jbmq-queue-service.xml	2007-09-07 12:03:25 UTC (rev 14934)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+    <mbean code="org.jboss.mq.server.jmx.Queue"
+           name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_webservice_mtom_esb">
+        <depends optional-attribute-name="DestinationManager">
+            jboss.mq:service=DestinationManager
+        </depends>
+    </mbean>
+    <mbean code="org.jboss.mq.server.jmx.Queue"
+           name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_webservice_mtom_esb_reply">
+        <depends optional-attribute-name="DestinationManager">
+            jboss.mq:service=DestinationManager
+        </depends>
+    </mbean>
+</server>


Property changes on: labs/jbossesb/workspace/webservice_mtom_qs/jbmq-queue-service.xml
___________________________________________________________________
Name: svn:mime-type
   + text/xml
Name: svn:eol-style
   + native

Added: labs/jbossesb/workspace/webservice_mtom_qs/jboss-esb.xml
===================================================================
--- labs/jbossesb/workspace/webservice_mtom_qs/jboss-esb.xml	                        (rev 0)
+++ labs/jbossesb/workspace/webservice_mtom_qs/jboss-esb.xml	2007-09-07 12:03:25 UTC (rev 14934)
@@ -0,0 +1,47 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb
+        xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd"
+        parameterReloadSecs="5">
+
+    <providers>
+        <jms-provider name="JBossMQ" connection-factory="ConnectionFactory"
+                      jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
+                      jndi-URL="localhost">
+            <jms-bus busid="quickstartEsbChannel">
+                <jms-message-filter dest-type="QUEUE" dest-name="queue/quickstart_webservice_mtom_esb"/>
+            </jms-bus>
+        </jms-provider>
+
+        <jbr-provider name="JBR-Http" protocol="http" host="localhost">
+            <jbr-bus busid="Http-1" port="8765" />
+        </jbr-provider>
+
+    </providers>
+
+    <services>
+
+        <service category="MyServiceCategory" name="MyMTOMService" description="WS Frontend speaks natively to the ESB">
+
+            <listeners>
+                <jbr-listener name="Http-Gateway" busidref="Http-1" is-gateway="true" maxThreads="1"/>
+
+                <jms-listener name="JMS-ESBListener" busidref="quickstartEsbChannel" maxThreads="1"/>
+            </listeners>
+            <actions>
+                <action name="print-before" class="org.jboss.soa.esb.actions.SystemPrintln">
+                    <property name="message"
+                              value="[Quickstart_webservice_producer] Message before invoking jbossws endpoint"/>
+                </action>
+                <action name="JBossWSAdapter" class="org.jboss.soa.esb.actions.soap.SOAPProcessor">
+                    <property name="jbossws-endpoint" value="MTOMEndpoint"/>
+                </action>
+                <action name="print-after" class="org.jboss.soa.esb.actions.SystemPrintln">
+                    <property name="message"
+                              value="[Quickstart_webservice_producer] Message after invoking jbossws endpoint"/>
+                </action>
+            </actions>
+        </service>
+
+    </services>
+
+</jbossesb>


Property changes on: labs/jbossesb/workspace/webservice_mtom_qs/jboss-esb.xml
___________________________________________________________________
Name: svn:mime-type
   + text/xml
Name: svn:eol-style
   + native

Added: labs/jbossesb/workspace/webservice_mtom_qs/jndi.properties
===================================================================
--- labs/jbossesb/workspace/webservice_mtom_qs/jndi.properties	                        (rev 0)
+++ labs/jbossesb/workspace/webservice_mtom_qs/jndi.properties	2007-09-07 12:03:25 UTC (rev 14934)
@@ -0,0 +1,5 @@
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming
+java.naming.factory.url.pkgs=org.jnp.interfaces
+


Property changes on: labs/jbossesb/workspace/webservice_mtom_qs/jndi.properties
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:eol-style
   + native

Added: labs/jbossesb/workspace/webservice_mtom_qs/log4j.xml
===================================================================
--- labs/jbossesb/workspace/webservice_mtom_qs/log4j.xml	                        (rev 0)
+++ labs/jbossesb/workspace/webservice_mtom_qs/log4j.xml	2007-09-07 12:03:25 UTC (rev 14934)
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- ===================================================================== -->
+<!--                                                                       -->
+<!--  Log4j Configuration                                                  -->
+<!--                                                                       -->
+<!-- ===================================================================== -->
+
+<!-- $Id: log4j.xml,v 1.26.2.5 2005/09/15 09:31:02 dimitris Exp $ -->
+
+<!--
+   | For more configuration infromation and examples see the Jakarta Log4j
+   | owebsite: http://jakarta.apache.org/log4j
+ -->
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+   <!-- ============================== -->
+   <!-- Append messages to the console -->
+   <!-- ============================== -->
+
+   <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+      <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+      <param name="Target" value="System.out"/>
+
+      <layout class="org.apache.log4j.PatternLayout">
+         <!-- The default pattern: Date Priority [Category] Message\n -->
+         <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%t][%c{1}] %m%n"/>
+      </layout>
+   </appender>
+
+   <!-- ================================= -->
+   <!-- Preserve messages in a local file -->
+   <!-- ================================= -->
+
+   <!-- A size based file rolling appender -->
+   <appender name="FILE" class="org.jboss.logging.appender.RollingFileAppender">
+     <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+     <param name="File" value="./listener.log"/>
+     <param name="Append" value="false"/>
+     <param name="MaxFileSize" value="500KB"/>
+     <param name="MaxBackupIndex" value="1"/>
+
+     <layout class="org.apache.log4j.PatternLayout">
+       <param name="ConversionPattern" value="%d %-5p [%t][%c] %m%n"/>
+     </layout>	    
+   </appender>
+
+   <!-- ================ -->
+   <!-- Limit categories -->
+   <!-- ================ -->
+
+   <category name="org.jboss">
+      <priority value="WARN"/>
+   </category>
+   <category name="org.jboss.soa.esb">
+      <priority value="ERROR"/>
+   </category>
+   <category name="org.jboss.internal.soa.esb">
+      <priority value="ERROR"/>
+   </category>
+   <category name="org.apache">
+      <priority value="ERROR"/>
+   </category>
+   <category name="quickstart">
+      <priority value="INFO"/>
+   </category>
+   <!-- ======================= -->
+   <!-- Setup the Root category -->
+   <!-- ======================= -->
+
+   <root>
+      <appender-ref ref="CONSOLE"/>
+      <appender-ref ref="FILE"/>
+   </root>
+
+</log4j:configuration>


Property changes on: labs/jbossesb/workspace/webservice_mtom_qs/log4j.xml
___________________________________________________________________
Name: svn:mime-type
   + text/xml
Name: svn:eol-style
   + native

Added: labs/jbossesb/workspace/webservice_mtom_qs/readme.txt
===================================================================
--- labs/jbossesb/workspace/webservice_mtom_qs/readme.txt	                        (rev 0)
+++ labs/jbossesb/workspace/webservice_mtom_qs/readme.txt	2007-09-07 12:03:25 UTC (rev 14934)
@@ -0,0 +1,21 @@
+Overview:
+=========
+  This sample demonstrates how to deploy a JSR181 Webservice endpoint on
+  JBossESB using the SOAPProcessor action.  
+
+Running this quickstart:
+========================
+  Please refer to 'ant help-quickstarts' for prerequisites about the quickstarts
+  and a more detailed descripton of the different ways to run the quickstarts.
+
+  Note, this quickstart requires an ESB and JBossWS installation into
+  JBoss AS 4.2.0.GA.  Installation instructions for both can be found in the
+  install/readme.txt.
+
+To Run:
+=======
+  1. In a command terminal window in this folder ("Window1"), type 'ant deploy'.
+  2. Open another command terminal window in this folder ("Window2"), type
+     'ant runtest'.
+  3. Switch back to Application Server console to see the output from the ESB
+  4. In this folder ("Window1"), type 'ant undeploy'.

Added: labs/jbossesb/workspace/webservice_mtom_qs/src/META-INF/standard-jaxws-client-config.xml
===================================================================
--- labs/jbossesb/workspace/webservice_mtom_qs/src/META-INF/standard-jaxws-client-config.xml	                        (rev 0)
+++ labs/jbossesb/workspace/webservice_mtom_qs/src/META-INF/standard-jaxws-client-config.xml	2007-09-07 12:03:25 UTC (rev 14934)
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- $Id: standard-jaxws-client-config.xml 3797 2007-07-04 11:33:22Z thomas.diesler at jboss.com $ -->
+
+<jaxws-config xmlns="urn:jboss:jaxws-config:2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:javaee="http://java.sun.com/xml/ns/javaee"
+  xsi:schemaLocation="urn:jboss:jaxws-config:2.0 jaxws-config_2_0.xsd">
+  
+  <client-config>
+    <config-name>Standard Client</config-name>
+    <feature>http://org.jboss.ws/dispatch/validate</feature>
+    <property>
+      <property-name>http://org.jboss.ws/http#chunksize</property-name>
+      <property-value>2048</property-value>
+    </property>
+  </client-config>
+  
+  <client-config>
+    <config-name>HTTP 1.0 Client</config-name>
+    <feature>http://org.jboss.ws/dispatch/validate</feature>
+  </client-config>
+  
+  <client-config>
+    <config-name>Standard WSAddressing Client</config-name>
+    <post-handler-chains>
+      <javaee:handler-chain>
+        <javaee:protocol-bindings>##SOAP11_HTTP</javaee:protocol-bindings>
+        <javaee:handler>
+          <javaee:handler-name>WSAddressing Handler</javaee:handler-name>
+          <javaee:handler-class>org.jboss.ws.extensions.addressing.jaxws.WSAddressingClientHandler</javaee:handler-class>
+        </javaee:handler>
+      </javaee:handler-chain>
+    </post-handler-chains>
+  </client-config>
+  
+  <client-config>
+    <config-name>Standard WSSecurity Client</config-name>
+    <post-handler-chains>
+      <javaee:handler-chain>
+        <javaee:protocol-bindings>##SOAP11_HTTP</javaee:protocol-bindings>
+        <javaee:handler>
+          <javaee:handler-name>WSSecurityHandlerOutbound</javaee:handler-name>
+          <javaee:handler-class>org.jboss.ws.extensions.security.jaxws.WSSecurityHandlerClient</javaee:handler-class>
+        </javaee:handler>
+      </javaee:handler-chain>
+    </post-handler-chains>
+  </client-config>
+  
+</jaxws-config>


Property changes on: labs/jbossesb/workspace/webservice_mtom_qs/src/META-INF/standard-jaxws-client-config.xml
___________________________________________________________________
Name: svn:mime-type
   + text/xml
Name: svn:eol-style
   + native

Added: labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/test/SendMessage.java
===================================================================
--- labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/test/SendMessage.java	                        (rev 0)
+++ labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/test/SendMessage.java	2007-09-07 12:03:25 UTC (rev 14934)
@@ -0,0 +1,115 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated 
+ * by the @authors tag. All rights reserved. 
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors. 
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A 
+ * 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,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * MA  02110-1301, USA.
+ * 
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+package org.jboss.soa.esb.samples.quickstart.webservicemtom.test;
+
+import org.jboss.internal.soa.esb.util.StreamUtils;
+import org.jboss.remoting.InvokerLocator;
+import org.jboss.remoting.Client;
+
+import javax.jms.JMSException;
+import javax.jms.ObjectMessage;
+import javax.jms.Queue;
+import javax.jms.QueueConnection;
+import javax.jms.QueueConnectionFactory;
+import javax.jms.QueueSender;
+import javax.jms.QueueSession;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+public class SendMessage {
+    QueueConnection conn;
+    QueueSession session;
+    Queue que;
+
+    public void sendMessageOverJMS(String message) throws JMSException, NamingException {
+        QueueSender sender = null;
+
+    	setupJMSConnection();
+        try {
+            ObjectMessage tm = null;
+
+            sender = session.createSender(que);
+            tm = session.createObjectMessage(message);
+            sender.send(tm);
+        } finally {
+            if(sender != null) {
+                sender.close();
+            }
+            cleanupJMSConnection();
+        }
+    }
+
+    private void sendMessageToJBRListener(String protocol, int port, String message) throws Throwable {
+        String locatorURI = protocol + "://localhost:" + port;
+        InvokerLocator locator = new InvokerLocator(locatorURI);
+        System.out.println("Calling JBoss Remoting Listener using locator URI: " + locatorURI);
+
+        Client remotingClient = null;
+        try {
+            remotingClient = new Client(locator);
+            remotingClient.connect();
+
+            // Deliver the message to the listener...
+            Object response = remotingClient.invoke(message);
+            System.out.println("Response from JBoss Remoting Listener '" + locatorURI + "' was '" + response + "'.");
+        } finally {
+            if(remotingClient != null) {
+                remotingClient.disconnect();
+            }
+        }
+    }
+
+    public void setupJMSConnection() throws JMSException, NamingException
+    {
+    	InitialContext iniCtx = new InitialContext();
+    	Object tmp = iniCtx.lookup("ConnectionFactory");
+    	QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
+    	conn = qcf.createQueueConnection();
+    	que = (Queue) iniCtx.lookup("queue/quickstart_webservice_producer_gw");
+    	session = conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
+    	conn.start();
+    }
+
+    public void cleanupJMSConnection() throws JMSException
+    {
+        conn.stop();
+        session.close();
+        conn.close();
+    }
+
+    private static String getMessage(String messageNum) {
+        String msg = new String(StreamUtils.readStream(SendMessage.class.getResourceAsStream("soap_message_" + messageNum + ".xml")));
+        return msg;
+    }
+
+    public static void main(String args[]) throws Throwable
+    {        	    	
+    	SendMessage sm = new SendMessage();
+        String msg = getMessage("01");
+
+        String protocol = args[0];
+        if(protocol.equals("jms")) {
+            sm.sendMessageOverJMS(msg);
+        } else {
+            sm.sendMessageToJBRListener(protocol, Integer.parseInt(args[1]), msg);
+        }
+    }
+}
\ No newline at end of file


Property changes on: labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/test/SendMessage.java
___________________________________________________________________
Name: svn:eol-style
   + native

Added: labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/test/soap_message_01.xml
===================================================================
--- labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/test/soap_message_01.xml	                        (rev 0)
+++ labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/test/soap_message_01.xml	2007-09-07 12:03:25 UTC (rev 14934)
@@ -0,0 +1,8 @@
+<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:good="http://webservice_producer/goodbyeworld">
+   <soapenv:Header/>
+   <soapenv:Body>
+      <good:sayGoodbye>
+         <message>Goodbye!!</message>
+      </good:sayGoodbye>
+   </soapenv:Body>
+</soapenv:Envelope>
\ No newline at end of file


Property changes on: labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/test/soap_message_01.xml
___________________________________________________________________
Name: svn:mime-type
   + text/xml
Name: svn:eol-style
   + native

Added: labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/test/soap_message_02.xml
===================================================================
--- labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/test/soap_message_02.xml	                        (rev 0)
+++ labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/test/soap_message_02.xml	2007-09-07 12:03:25 UTC (rev 14934)
@@ -0,0 +1,8 @@
+<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:good="http://webservice_producer/goodbyeworld">
+   <soapenv:Header/>
+   <soapenv:Body>
+      <good:sayGoodbyeWithoutResponse>
+         <message>Goodbye!!</message>
+      </good:sayGoodbyeWithoutResponse>
+   </soapenv:Body>
+</soapenv:Envelope>
\ No newline at end of file


Property changes on: labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/test/soap_message_02.xml
___________________________________________________________________
Name: svn:mime-type
   + text/xml
Name: svn:eol-style
   + native

Added: labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/DHRequest.java
===================================================================
--- labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/DHRequest.java	                        (rev 0)
+++ labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/DHRequest.java	2007-09-07 12:03:25 UTC (rev 14934)
@@ -0,0 +1,52 @@
+/*
+ * 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.soa.esb.samples.quickstart.webservicemtom.webservice;
+
+import javax.activation.DataHandler;
+import javax.xml.bind.annotation.XmlMimeType;
+import javax.xml.bind.annotation.XmlType;
+
+ at XmlType(name = "dataRequest", namespace = "http://org.jboss.ws/xop/doclit")
+public class DHRequest
+{
+   private DataHandler dataHandler;
+
+   public DHRequest()
+   {
+   }
+
+   public DHRequest(DataHandler dataHandler)
+   {
+      this.dataHandler = dataHandler;
+   }
+
+   @XmlMimeType("image/x-png")
+   public DataHandler getDataHandler()
+   {
+      return dataHandler;
+   }
+
+   public void setDataHandler(DataHandler dataHandler)
+   {
+      this.dataHandler = dataHandler;
+   }
+}


Property changes on: labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/DHRequest.java
___________________________________________________________________
Name: svn:eol-style
   + native

Added: labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/DHResponse.java
===================================================================
--- labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/DHResponse.java	                        (rev 0)
+++ labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/DHResponse.java	2007-09-07 12:03:25 UTC (rev 14934)
@@ -0,0 +1,50 @@
+/*
+* 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.soa.esb.samples.quickstart.webservicemtom.webservice;
+
+import javax.activation.DataHandler;
+import javax.xml.bind.annotation.XmlMimeType;
+import javax.xml.bind.annotation.XmlType;
+
+ at XmlType(name="dataResponse", namespace = "http://org.jboss.ws/xop/doclit")
+public class DHResponse {
+
+
+   private DataHandler dataHandler;
+
+
+   public DHResponse() {
+   }
+
+   public DHResponse(DataHandler dataHandler) {
+      this.dataHandler = dataHandler;
+   }
+
+   @XmlMimeType("text/plain")
+   public DataHandler getDataHandler() {
+      return dataHandler;
+   }
+
+   public void setDataHandler(DataHandler dataHandler) {
+      this.dataHandler = dataHandler;
+   }
+}


Property changes on: labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/DHResponse.java
___________________________________________________________________
Name: svn:eol-style
   + native

Added: labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/ImageRequest.java
===================================================================
--- labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/ImageRequest.java	                        (rev 0)
+++ labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/ImageRequest.java	2007-09-07 12:03:25 UTC (rev 14934)
@@ -0,0 +1,43 @@
+/*
+* 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.soa.esb.samples.quickstart.webservicemtom.webservice;
+
+import java.awt.Image;
+
+import javax.xml.bind.annotation.XmlType;
+
+ at XmlType(name="imageRequest", namespace = "http://org.jboss.ws/xop/doclit")
+public class ImageRequest {
+
+   private Image data;
+
+
+   public Image getData()
+   {
+      return data;
+   }
+
+   public void setData(Image data)
+   {
+      this.data = data;
+   }
+}


Property changes on: labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/ImageRequest.java
___________________________________________________________________
Name: svn:eol-style
   + native

Added: labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/ImageResponse.java
===================================================================
--- labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/ImageResponse.java	                        (rev 0)
+++ labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/ImageResponse.java	2007-09-07 12:03:25 UTC (rev 14934)
@@ -0,0 +1,52 @@
+/*
+* 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.soa.esb.samples.quickstart.webservicemtom.webservice;
+
+import java.awt.Image;
+
+import javax.xml.bind.annotation.XmlType;
+
+ at XmlType(name="imageResponse", namespace = "http://org.jboss.ws/xop/doclit")
+public class ImageResponse {
+
+   private Image data;
+
+
+   public ImageResponse()
+   {
+   }
+
+   public ImageResponse(Image data)
+   {
+      this.data = data;
+   }
+
+   public Image getData()
+   {
+      return data;
+   }
+
+   public void setData(Image data)
+   {
+      this.data = data;
+   }
+}


Property changes on: labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/ImageResponse.java
___________________________________________________________________
Name: svn:eol-style
   + native

Added: labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/MTOMEndpoint.java
===================================================================
--- labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/MTOMEndpoint.java	                        (rev 0)
+++ labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/MTOMEndpoint.java	2007-09-07 12:03:25 UTC (rev 14934)
@@ -0,0 +1,34 @@
+/*
+ * 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.soa.esb.samples.quickstart.webservicemtom.webservice;
+
+import javax.jws.WebService;
+import javax.jws.soap.SOAPBinding;
+import javax.xml.ws.BindingType;
+
+ at WebService(targetNamespace = "http://org.jboss.ws/xop/doclit")
+ at SOAPBinding(style = SOAPBinding.Style.DOCUMENT, parameterStyle = SOAPBinding.ParameterStyle.BARE)
+ at BindingType(value = "http://schemas.xmlsoap.org/wsdl/soap/http?mtom=true")
+public interface MTOMEndpoint
+{
+   public ImageResponse echoImage(ImageRequest request);
+}


Property changes on: labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/MTOMEndpoint.java
___________________________________________________________________
Name: svn:eol-style
   + native

Added: labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/MTOMEndpointBean.java
===================================================================
--- labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/MTOMEndpointBean.java	                        (rev 0)
+++ labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/MTOMEndpointBean.java	2007-09-07 12:03:25 UTC (rev 14934)
@@ -0,0 +1,43 @@
+/*
+ * 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.soa.esb.samples.quickstart.webservicemtom.webservice;
+
+import org.apache.log4j.Logger;
+
+import java.io.IOException;
+import java.awt.*;
+
+import javax.activation.DataHandler;
+import javax.jws.WebService;
+import javax.xml.ws.WebServiceException;
+
+ at WebService(name = "MTOMEndpoint", serviceName = "MTOMService", endpointInterface = "org.jboss.soa.esb.samples.quickstart.webservicemtom.webservice.MTOMEndpoint")
+public class MTOMEndpointBean implements MTOMEndpoint {
+
+    public ImageResponse echoImage(ImageRequest request) {
+        Image image = request.getData();
+        System.out.println("*** Recieved Image: " + image);
+        //System.out.println("*** Image attached to ESB Message: " + image);
+        
+        return new ImageResponse(image);
+    }
+}


Property changes on: labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/MTOMEndpointBean.java
___________________________________________________________________
Name: svn:eol-style
   + native

Added: labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/MTOMProtocolHandler.java
===================================================================
--- labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/MTOMProtocolHandler.java	                        (rev 0)
+++ labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/MTOMProtocolHandler.java	2007-09-07 12:03:25 UTC (rev 14934)
@@ -0,0 +1,96 @@
+/*
+ * 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.soa.esb.samples.quickstart.webservicemtom.webservice;
+
+import org.jboss.logging.Logger;
+import org.jboss.wsf.spi.jaxws.handler.GenericSOAPHandler;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+import javax.xml.soap.SOAPBody;
+import javax.xml.soap.SOAPEnvelope;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.handler.MessageContext;
+import javax.xml.ws.handler.soap.SOAPMessageContext;
+
+/**
+ * A MTOM handler should see the conceptual payload,
+ * which means an inlined representation of the binary data.
+ * It checks existence of the xop:Include element.
+ */
+public class MTOMProtocolHandler extends GenericSOAPHandler
+{
+   private Logger log = Logger.getLogger(MTOMProtocolHandler.class);
+
+   protected boolean handleOutbound(MessageContext msgContext)
+   {
+      return verifyXOPPackage(msgContext);
+   }
+
+   protected boolean handleInbound(MessageContext msgContext)
+   {
+      return verifyXOPPackage(msgContext);
+   }
+
+   private boolean verifyXOPPackage(MessageContext context)
+   {
+      try
+      {
+         SOAPMessageContext msgContext = (SOAPMessageContext)context;
+         SOAPMessage soapMsg = msgContext.getMessage();
+         SOAPEnvelope soapEnv = soapMsg.getSOAPPart().getEnvelope();
+         SOAPBody body = soapEnv.getBody();
+         boolean found = scanNodes(body.getChildNodes());
+
+         if(found) throw new IllegalStateException("XOP request not properly inlined");
+                  
+      }
+      catch (SOAPException ex)
+      {
+         throw new WebServiceException(ex);
+      }
+
+      return true;
+   }
+
+   private boolean scanNodes(NodeList nodes)
+   {
+      boolean found = false;
+      for(int i = 0; i<nodes.getLength(); i++)
+      {
+         Node n = nodes.item(i);
+         if("Include".equals(n.getLocalName()))
+         {
+            found = true;
+            break;
+         }
+         else
+         {
+            found = scanNodes(n.getChildNodes());
+         }
+      }
+
+      return found;
+   }
+}
\ No newline at end of file


Property changes on: labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/MTOMProtocolHandler.java
___________________________________________________________________
Name: svn:eol-style
   + native

Added: labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/SourceRequest.java
===================================================================
--- labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/SourceRequest.java	                        (rev 0)
+++ labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/SourceRequest.java	2007-09-07 12:03:25 UTC (rev 14934)
@@ -0,0 +1,41 @@
+/*
+* 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.soa.esb.samples.quickstart.webservicemtom.webservice;
+
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.transform.Source;
+
+ at XmlType(name="sourceRequest", namespace = "http://org.jboss.ws/xop/doclit")
+public class SourceRequest {
+
+   Source data;
+
+   public Source getData()
+   {
+      return data;
+   }
+
+   public void setData(Source data)
+   {
+      this.data = data;
+   }
+}


Property changes on: labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/SourceRequest.java
___________________________________________________________________
Name: svn:eol-style
   + native

Added: labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/SourceResponse.java
===================================================================
--- labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/SourceResponse.java	                        (rev 0)
+++ labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/SourceResponse.java	2007-09-07 12:03:25 UTC (rev 14934)
@@ -0,0 +1,50 @@
+/*
+* 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.soa.esb.samples.quickstart.webservicemtom.webservice;
+
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.transform.Source;
+
+ at XmlType(name="sourceResponse", namespace = "http://org.jboss.ws/xop/doclit")
+public class SourceResponse {
+
+   private Source data;
+
+   public SourceResponse()
+   {
+   }
+
+   public SourceResponse(Source data)
+   {
+      this.data = data;
+   }
+
+   public Source getData()
+   {
+      return data;
+   }
+
+   public void setData(Source data)
+   {
+      this.data = data;
+   }
+}


Property changes on: labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/SourceResponse.java
___________________________________________________________________
Name: svn:eol-style
   + native

Added: labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/XOPSupport.java
===================================================================
--- labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/XOPSupport.java	                        (rev 0)
+++ labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/XOPSupport.java	2007-09-07 12:03:25 UTC (rev 14934)
@@ -0,0 +1,103 @@
+/*
+ * 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.soa.esb.samples.quickstart.webservicemtom.webservice;
+
+import java.awt.Image;
+import java.awt.Toolkit;
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import javax.activation.DataHandler;
+import javax.xml.transform.stream.StreamSource;
+
+/**
+ * @author Heiko Braun <heiko.braun at jboss.com>
+ * @since 22-Sep-2006
+ */
+public class XOPSupport {
+
+   public static byte[] getBytesFromFile(File file) throws IOException
+   {
+      InputStream is = new FileInputStream(file);
+
+      long length = file.length();
+      byte[] bytes = new byte[(int)length];
+
+      int offset = 0;
+      int numRead = 0;
+      while (offset < bytes.length && (numRead = is.read(bytes, offset, bytes.length - offset)) >= 0)
+      {
+         offset += numRead;
+      }
+
+      is.close();
+      return bytes;
+   }
+
+   public static Image createTestImage(File imgFile)
+   {
+      Image image = null;
+      try
+      {
+         URL url = imgFile.toURL();
+
+         image = null;
+         try
+         {
+            image = Toolkit.getDefaultToolkit().createImage(url);
+         }
+         catch (Throwable th)
+         {
+            //log.warn("Cannot create Image: " + th);
+         }
+      }
+      catch (MalformedURLException e)
+      {
+         throw new RuntimeException(e);
+      }
+
+      return image;
+   }
+
+   public static StreamSource createTestSource()
+   {
+      return new StreamSource(new ByteArrayInputStream("<some><nestedXml/></some>".getBytes()));
+   }
+
+   public static DataHandler createDataHandler(File imgFile)
+   {
+      try
+      {
+         URL url = imgFile.toURL();
+         return new DataHandler(url);
+      }
+      catch (MalformedURLException e)
+      {
+         throw new RuntimeException(e);
+      }
+   }
+}


Property changes on: labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/XOPSupport.java
___________________________________________________________________
Name: svn:eol-style
   + native

Added: labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/client/MTOMClient.java
===================================================================
--- labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/client/MTOMClient.java	                        (rev 0)
+++ labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/client/MTOMClient.java	2007-09-07 12:03:25 UTC (rev 14934)
@@ -0,0 +1,103 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * 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,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * (C) 2005-2006, JBoss Inc.
+ */
+package org.jboss.soa.esb.samples.quickstart.webservicemtom.webservice.client;
+
+import org.jboss.soa.esb.samples.quickstart.webservicemtom.webservice.*;
+import org.jboss.internal.soa.esb.util.StreamUtils;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.Service;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.handler.Handler;
+import javax.xml.ws.soap.SOAPBinding;
+import java.net.URL;
+import java.net.MalformedURLException;
+import java.util.List;
+import java.util.ArrayList;
+import java.awt.*;
+import java.awt.image.BufferedImage;
+
+import sun.awt.image.ToolkitImage;
+
+/**
+ * MTOM Client.
+ * <p/>
+ * The basis of this code was lifted from JBossWS test code.  Thanks guys :-)
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class MTOMClient {
+    
+    public static void main(String[] args) throws MalformedURLException {
+        MTOMEndpoint mtomEndpoint;
+
+        // Get the client endpoint port...
+        mtomEndpoint = getEndpointPort();
+
+        // Create the Image request and send it to the MTOM endpoint...
+        byte[] imageBytes = StreamUtils.readStream(MTOMClient.class.getResourceAsStream("jboss.png"));
+        Image img = Toolkit.getDefaultToolkit().createImage(imageBytes);
+        if (img == null) {
+            throw new IllegalStateException("Failed to load the 'jboss.gif' image from the classpath!");
+        }
+        ImageRequest request = new ImageRequest();
+        request.setData(img);
+        ImageResponse response = mtomEndpoint.echoImage(request);
+
+        // Check the response...
+        assertImagesEqual(request, response);
+    }
+
+    private static MTOMEndpoint getEndpointPort() throws MalformedURLException {
+        MTOMEndpoint mtomEndpoint;
+        QName serviceName = new QName("http://webservice.webservicemtom.quickstart.samples.esb.soa.jboss.org/", "MTOMService");
+        URL wsdlURL = new URL("http://localhost:8080/contract/contract.jsp?serviceCat=MyServiceCategory&serviceName=MyMTOMService&protocol=http");
+        //URL wsdlURL = new URL("http://127.0.0.1:8080/Quickstart_webservice_mtom/MTOMService?wsdl");
+
+        Service service = Service.create(wsdlURL, serviceName);
+        mtomEndpoint = service.getPort(MTOMEndpoint.class);
+
+        // enable MTOM
+        SOAPBinding binding = (SOAPBinding)((BindingProvider)mtomEndpoint).getBinding();
+        binding.setMTOMEnabled(true);
+
+        List<Handler> handlerChain = new ArrayList<Handler>();
+        handlerChain.addAll(binding.getHandlerChain());
+        handlerChain.add(new MTOMProtocolHandler());
+        binding.setHandlerChain(handlerChain);
+        return mtomEndpoint;
+    }
+
+    private static void assertImagesEqual(ImageRequest request, ImageResponse response) {
+        ToolkitImage reqImage = (ToolkitImage) request.getData();
+        BufferedImage resImage = (BufferedImage) response.getData();
+
+        assertEquals("Image heights don't match.", reqImage.getHeight(), resImage.getHeight());
+        assertEquals("Image widths don't match.", reqImage.getWidth(), resImage.getWidth());
+
+        System.out.println("Successfully sent image data (binary) to MTOM Service endpoint, which echoed it back!");
+    }
+
+    private static void assertEquals(String failureMessage, Object obj1, Object obj2) {
+        if(!obj1.equals(obj2)) {
+            throw new RuntimeException(failureMessage + "  Expected '" + obj1 + "', actual '" + obj2 + "'.");
+        }
+    }
+}


Property changes on: labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/client/MTOMClient.java
___________________________________________________________________
Name: svn:eol-style
   + native

Added: labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/client/jboss.png
===================================================================
(Binary files differ)


Property changes on: labs/jbossesb/workspace/webservice_mtom_qs/src/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/client/jboss.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossesb/workspace/webservice_mtom_qs/war/resources/WEB-INF/web.xml
===================================================================
--- labs/jbossesb/workspace/webservice_mtom_qs/war/resources/WEB-INF/web.xml	                        (rev 0)
+++ labs/jbossesb/workspace/webservice_mtom_qs/war/resources/WEB-INF/web.xml	2007-09-07 12:03:25 UTC (rev 14934)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+         version="2.4">
+
+    <servlet>
+        <servlet-name>MTOMEndpoint</servlet-name>
+        <servlet-class>org.jboss.soa.esb.samples.quickstart.webservicemtom.webservice.MTOMEndpointBean</servlet-class>
+    </servlet>
+
+    <servlet-mapping>
+        <servlet-name>MTOMEndpoint</servlet-name>
+        <url-pattern>/MTOMService</url-pattern>
+    </servlet-mapping>
+
+</web-app>


Property changes on: labs/jbossesb/workspace/webservice_mtom_qs/war/resources/WEB-INF/web.xml
___________________________________________________________________
Name: svn:mime-type
   + text/xml
Name: svn:eol-style
   + native

Added: labs/jbossesb/workspace/webservice_mtom_qs/war/view/index.jsp
===================================================================
--- labs/jbossesb/workspace/webservice_mtom_qs/war/view/index.jsp	                        (rev 0)
+++ labs/jbossesb/workspace/webservice_mtom_qs/war/view/index.jsp	2007-09-07 12:03:25 UTC (rev 14934)
@@ -0,0 +1,9 @@
+<html>
+	<body>
+		This is just a place holder.<br>
+		Verify the that the WS has been deployed by hitting 
+			<a href="http://localhost:8080/jbossws">
+				http://localhost:8080/jbossws
+			</a>
+  </body>
+</html>	
\ No newline at end of file




More information about the jboss-svn-commits mailing list