[jboss-svn-commits] JBL Code SVN: r26219 - in labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom: src_as5 and 11 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Thu Apr 23 05:42:30 EDT 2009


Author: beve
Date: 2009-04-23 05:42:30 -0400 (Thu, 23 Apr 2009)
New Revision: 26219

Added:
   labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/src_as5/
   labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/src_as5/META-INF/
   labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/src_as5/META-INF/standard-jaxws-client-config.xml
   labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/src_as5/org/
   labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/src_as5/org/jboss/
   labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/src_as5/org/jboss/soa/
   labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/src_as5/org/jboss/soa/esb/
   labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/src_as5/org/jboss/soa/esb/samples/
   labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/src_as5/org/jboss/soa/esb/samples/quickstart/
   labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/src_as5/org/jboss/soa/esb/samples/quickstart/webservicemtom/
   labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/src_as5/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/
   labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/src_as5/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/.MTOMProtocolHandler.java.swp
   labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/src_as5/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/DHRequest.java
   labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/src_as5/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/DHResponse.java
   labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/src_as5/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/ImageRequest.java
   labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/src_as5/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/ImageResponse.java
   labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/src_as5/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/MTOMEndpoint.java
   labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/src_as5/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/MTOMEndpointBean.java
   labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/src_as5/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/MTOMProtocolHandler.java
   labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/src_as5/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/SourceRequest.java
   labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/src_as5/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/SourceResponse.java
   labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/src_as5/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/XOPSupport.java
   labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/src_as5/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/client/
   labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/src_as5/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/client/MTOMClient.java
   labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/src_as5/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/client/jboss.png
   labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/war/resources/WEB-INF/jboss-web.xml
Modified:
   labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/build.xml
Log:
Changes made to suite AS 5 and new version of JBossWS. 


Modified: labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/build.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/build.xml	2009-04-23 09:41:31 UTC (rev 26218)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/build.xml	2009-04-23 09:42:30 UTC (rev 26219)
@@ -8,8 +8,17 @@
 	<!-- Import the base Ant build script... -->
 	<import file="../conf/base-build.xml"/>
 
-    <target name="quickstart-specific-checks" depends="assert-ws-available,assert-jbossremoting-version"/>
+    <target name="quickstart-specific-checks" depends="assert-ws-available,assert-jbossremoting-version, check-src-dir" />
 
+	<target name="check-src-dir">
+		<condition property="quickstart.src.dir" value="src_as5" else="src">
+			<and>
+				<available classname="org.jboss.wsf.common.handler.GenericSOAPHandler" classpathref="compile-classpath"/>
+			</and>
+		</condition>
+		<echo message="Set src dir to : ${quickstart.src.dir}"/>
+	</target>
+
     <target name="quickstart-specific-dependencies">
         <path id="quickstart-dependencies-classpath">
             <fileset dir="${org.jboss.esb.server.home}/client" includes="jbossws-client.jar,jboss-remoting.jar" />
@@ -23,6 +32,9 @@
         <!-- Build the webservice... -->
         <war warfile="build/${ant.project.name}.war"
              webxml="${basedir}/war/resources/WEB-INF/web.xml">
+			<webinf dir="${basedir}/war/resources/WEB-INF">
+                <include name="jboss-web.xml"/>
+            </webinf>
             <fileset dir="${basedir}/war/view">
                 <include name="**/*"/>
             </fileset>

Added: labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/src_as5/META-INF/standard-jaxws-client-config.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/src_as5/META-INF/standard-jaxws-client-config.xml	                        (rev 0)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/src_as5/META-INF/standard-jaxws-client-config.xml	2009-04-23 09:42:30 UTC (rev 26219)
@@ -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>

Added: labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/src_as5/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/.MTOMProtocolHandler.java.swp
===================================================================
(Binary files differ)


Property changes on: labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/src_as5/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/.MTOMProtocolHandler.java.swp
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/src_as5/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/DHRequest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/src_as5/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/DHRequest.java	                        (rev 0)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/src_as5/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/DHRequest.java	2009-04-23 09:42:30 UTC (rev 26219)
@@ -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;
+   }
+}

Added: labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/src_as5/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/DHResponse.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/src_as5/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/DHResponse.java	                        (rev 0)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/src_as5/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/DHResponse.java	2009-04-23 09:42:30 UTC (rev 26219)
@@ -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;
+   }
+}

Added: labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/src_as5/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/ImageRequest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/src_as5/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/ImageRequest.java	                        (rev 0)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/src_as5/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/ImageRequest.java	2009-04-23 09:42:30 UTC (rev 26219)
@@ -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;
+   }
+}

Added: labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/src_as5/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/ImageResponse.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/src_as5/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/ImageResponse.java	                        (rev 0)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/src_as5/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/ImageResponse.java	2009-04-23 09:42:30 UTC (rev 26219)
@@ -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;
+   }
+}

Added: labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/src_as5/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/MTOMEndpoint.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/src_as5/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/MTOMEndpoint.java	                        (rev 0)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/src_as5/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/MTOMEndpoint.java	2009-04-23 09:42:30 UTC (rev 26219)
@@ -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);
+}

Added: labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/src_as5/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/MTOMEndpointBean.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/src_as5/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/MTOMEndpointBean.java	                        (rev 0)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/src_as5/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/MTOMEndpointBean.java	2009-04-23 09:42:30 UTC (rev 26219)
@@ -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("*** Received Image: " + image);
+        //System.out.println("*** Image attached to ESB Message: " + image);
+        
+        return new ImageResponse(image);
+    }
+}

Added: labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/src_as5/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/MTOMProtocolHandler.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/src_as5/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/MTOMProtocolHandler.java	                        (rev 0)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/src_as5/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/MTOMProtocolHandler.java	2009-04-23 09:42:30 UTC (rev 26219)
@@ -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.common.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;
+   }
+}

Added: labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/src_as5/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/SourceRequest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/src_as5/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/SourceRequest.java	                        (rev 0)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/src_as5/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/SourceRequest.java	2009-04-23 09:42:30 UTC (rev 26219)
@@ -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;
+   }
+}

Added: labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/src_as5/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/SourceResponse.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/src_as5/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/SourceResponse.java	                        (rev 0)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/src_as5/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/SourceResponse.java	2009-04-23 09:42:30 UTC (rev 26219)
@@ -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;
+   }
+}

Added: labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/src_as5/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/XOPSupport.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/src_as5/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/XOPSupport.java	                        (rev 0)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/src_as5/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/XOPSupport.java	2009-04-23 09:42:30 UTC (rev 26219)
@@ -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);
+      }
+   }
+}

Added: labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/src_as5/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/client/MTOMClient.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/src_as5/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/client/MTOMClient.java	                        (rev 0)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/src_as5/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/client/MTOMClient.java	2009-04-23 09:42:30 UTC (rev 26219)
@@ -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 + "'.");
+        }
+    }
+}

Added: labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/src_as5/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/client/jboss.png
===================================================================
(Binary files differ)


Property changes on: labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/src_as5/org/jboss/soa/esb/samples/quickstart/webservicemtom/webservice/client/jboss.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/war/resources/WEB-INF/jboss-web.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/war/resources/WEB-INF/jboss-web.xml	                        (rev 0)
+++ labs/jbossesb/workspace/dbevenius/jbossas5/product/samples/quickstarts/webservice_mtom/war/resources/WEB-INF/jboss-web.xml	2009-04-23 09:42:30 UTC (rev 26219)
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jboss-web>
+	<context-root>/Quickstart_webservice_mtom</context-root>
+</jboss-web>
+




More information about the jboss-svn-commits mailing list