cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r474229 - in /incubator/cxf/trunk: distribution/src/main/release/etc/ distribution/src/main/release/samples/hello_world/ distribution/src/main/release/samples/hello_world_RPCLit/ distribution/src/main/release/samples/hello_world_xml_bare/ d...
Date Mon, 13 Nov 2006 10:19:41 GMT
Author: ningjiang
Date: Mon Nov 13 02:19:40 2006
New Revision: 474229

URL: http://svn.apache.org/viewvc?view=rev&rev=474229
Log:
Got Servelt sample to work now
Changed the JAXWSMethodInvoker to extends FactoryInvoker for different scope bean create

Added:
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/JAXWSMethodInvokerTest.java
  (with props)
Modified:
    incubator/cxf/trunk/distribution/src/main/release/etc/web.xml
    incubator/cxf/trunk/distribution/src/main/release/samples/hello_world/build.xml
    incubator/cxf/trunk/distribution/src/main/release/samples/hello_world_RPCLit/build.xml
    incubator/cxf/trunk/distribution/src/main/release/samples/hello_world_xml_bare/build.xml
    incubator/cxf/trunk/distribution/src/main/release/samples/hello_world_xml_wrapped/build.xml
    incubator/cxf/trunk/distribution/src/main/release/samples/soap12/build.xml
    incubator/cxf/trunk/distribution/src/main/release/samples/soap_header/build.xml
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JAXWSMethodInvoker.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/servlet/CXFServlet.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/servlet/ServletController.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/servlet/ServletDestination.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/HolderTest.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/servlet/ExternalServicesServletTest.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/servlet/web-external.xml
    incubator/cxf/trunk/testutils/src/main/java/org/apache/cxf/mtom_xop/HelloImpl.java

Modified: incubator/cxf/trunk/distribution/src/main/release/etc/web.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/etc/web.xml?view=diff&rev=474229&r1=474228&r2=474229
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/etc/web.xml (original)
+++ incubator/cxf/trunk/distribution/src/main/release/etc/web.xml Mon Nov 13 02:19:40 2006
@@ -31,7 +31,7 @@
     </servlet>
     <servlet-mapping>
         <servlet-name>cxf</servlet-name>
-        <url-pattern>/cxf/*</url-pattern>
+        <url-pattern>/services/*</url-pattern>
     </servlet-mapping>
     <session-config>
         <session-timeout>60</session-timeout>

Modified: incubator/cxf/trunk/distribution/src/main/release/samples/hello_world/build.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/hello_world/build.xml?view=diff&rev=474229&r1=474228&r2=474229
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/hello_world/build.xml (original)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/hello_world/build.xml Mon Nov
13 02:19:40 2006
@@ -45,6 +45,6 @@
 
     <target name="client-servlet" description="run demo client hitting servlet" depends="build">
         <property name="param" value=""/>
-        <cxfrun classname="demo.hw.client.Client" param1="${base.url}/helloworld/cxf/hello_world"
param2="${op}" param3="${param}"/>
+        <cxfrun classname="demo.hw.client.Client" param1="${base.url}/helloworld/services/hello_world?wsdl"
param2="${op}" param3="${param}"/>
     </target> 
 </project>

Modified: incubator/cxf/trunk/distribution/src/main/release/samples/hello_world_RPCLit/build.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/hello_world_RPCLit/build.xml?view=diff&rev=474229&r1=474228&r2=474229
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/hello_world_RPCLit/build.xml
(original)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/hello_world_RPCLit/build.xml
Mon Nov 13 02:19:40 2006
@@ -45,6 +45,6 @@
 
     <target name="client-servlet" description="run demo client hitting servlet" depends="build">
         <property name="param" value=""/>
-        <cxfrun classname="demo.hwRPCLit.client.Client" param1="${base.url}/helloworld/cxf/hello_world"
param2="${op}" param3="${param}"/>
+        <cxfrun classname="demo.hwRPCLit.client.Client" param1="${base.url}/helloworld/services/hello_world?wsdl"
param2="${op}" param3="${param}"/>
     </target> 
 </project>

Modified: incubator/cxf/trunk/distribution/src/main/release/samples/hello_world_xml_bare/build.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/hello_world_xml_bare/build.xml?view=diff&rev=474229&r1=474228&r2=474229
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/hello_world_xml_bare/build.xml
(original)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/hello_world_xml_bare/build.xml
Mon Nov 13 02:19:40 2006
@@ -45,6 +45,6 @@
 
     <target name="client-servlet" description="run demo client hitting servlet" depends="build">
         <property name="param" value=""/>
-        <cxfrun classname="demo.hw.client.Client" param1="${base.url}/helloworld/cxf/hello_world"
param2="${op}" param3="${param}"/>
+        <cxfrun classname="demo.hw.client.Client" param1="${base.url}/helloworld/services/hello_world?wsdl"
param2="${op}" param3="${param}"/>
     </target> 
 </project>

Modified: incubator/cxf/trunk/distribution/src/main/release/samples/hello_world_xml_wrapped/build.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/hello_world_xml_wrapped/build.xml?view=diff&rev=474229&r1=474228&r2=474229
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/hello_world_xml_wrapped/build.xml
(original)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/hello_world_xml_wrapped/build.xml
Mon Nov 13 02:19:40 2006
@@ -45,6 +45,6 @@
 
     <target name="client-servlet" description="run demo client hitting servlet" depends="build">
         <property name="param" value=""/>
-        <cxfrun classname="demo.hw.client.Client" param1="${base.url}/helloworld/cxf/hello_world"
param2="${op}" param3="${param}"/>
+        <cxfrun classname="demo.hw.client.Client" param1="${base.url}/helloworld/services/hello_world?wsdl"
param2="${op}" param3="${param}"/>
     </target> 
 </project>

Modified: incubator/cxf/trunk/distribution/src/main/release/samples/soap12/build.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/soap12/build.xml?view=diff&rev=474229&r1=474228&r2=474229
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/soap12/build.xml (original)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/soap12/build.xml Mon Nov 13
02:19:40 2006
@@ -53,6 +53,6 @@
 
     <target name="client-servlet" description="run demo client hitting servlet" depends="build">
         <property name="param" value=""/>
-        <cxfrun classname="demo.hw.client.Client" param1="${base.url}/helloworld/cxf/hello_world"
param2="${op}" param3="${param}"/>
+        <cxfrun classname="demo.hw.client.Client" param1="${base.url}/helloworld/services/hello_world?wsdl"
param2="${op}" param3="${param}"/>
     </target> 
 </project>

Modified: incubator/cxf/trunk/distribution/src/main/release/samples/soap_header/build.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/distribution/src/main/release/samples/soap_header/build.xml?view=diff&rev=474229&r1=474228&r2=474229
==============================================================================
--- incubator/cxf/trunk/distribution/src/main/release/samples/soap_header/build.xml (original)
+++ incubator/cxf/trunk/distribution/src/main/release/samples/soap_header/build.xml Mon Nov
13 02:19:40 2006
@@ -42,7 +42,7 @@
 
     <target name="client-servlet" description="run demo client hitting servlet" depends="build">
         <property name="param" value=""/>
-        <cxfrun classname="demo.soap_header.client.Client" param1="${base.url}/soapheader/cxf/soap_header"
param2="${op}" param3="${param}"/>
+        <cxfrun classname="demo.soap_header.client.Client" param1="${base.url}/soapheader/services/soap_header?wsdl"
param2="${op}" param3="${param}"/>
     </target>     
     
 </project>

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JAXWSMethodInvoker.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JAXWSMethodInvoker.java?view=diff&rev=474229&r1=474228&r2=474229
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JAXWSMethodInvoker.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/JAXWSMethodInvoker.java
Mon Nov 13 02:19:40 2006
@@ -33,17 +33,35 @@
 import javax.xml.ws.handler.MessageContext;
 
 import org.apache.cxf.binding.soap.model.SoapHeaderInfo;
+import org.apache.cxf.common.util.factory.Factory;
 import org.apache.cxf.jaxws.context.WebServiceContextImpl;
 import org.apache.cxf.jaxws.support.ContextPropertiesMapping;
 import org.apache.cxf.message.Exchange;
-import org.apache.cxf.service.invoker.BeanInvoker;
+import org.apache.cxf.service.invoker.ApplicationScopePolicy;
+import org.apache.cxf.service.invoker.FactoryInvoker;
+import org.apache.cxf.service.invoker.ScopePolicy;
 import org.apache.cxf.service.model.BindingMessageInfo;
 import org.apache.cxf.service.model.BindingOperationInfo;
 
-public class JAXWSMethodInvoker extends BeanInvoker {
+public class JAXWSMethodInvoker extends FactoryInvoker {
 
-    public JAXWSMethodInvoker(Object bean) {
-        super(bean);
+    public JAXWSMethodInvoker(final Object bean) {
+        super(
+            new Factory() {
+                public Object create() {
+                    return bean;
+                }
+            },
+            ApplicationScopePolicy.instance());
+        
+    }
+    
+    public JAXWSMethodInvoker(Factory factory) {
+        super(factory, ApplicationScopePolicy.instance());
+    }
+    
+    public JAXWSMethodInvoker(Factory factory, ScopePolicy scope) {
+        super(factory, scope);
     }
 
     @SuppressWarnings("unchecked")

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/servlet/CXFServlet.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/servlet/CXFServlet.java?view=diff&rev=474229&r1=474228&r2=474229
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/servlet/CXFServlet.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/servlet/CXFServlet.java
Mon Nov 13 02:19:40 2006
@@ -215,9 +215,11 @@
             Object impl = cls.newInstance();
 
             EndpointImpl ep = new EndpointImpl(bus, impl, (String)null);
-
-            // doesn't really matter what URL is used here
-            ep.publish("http://localhost" + (urlPat.charAt(0) == '/' ? "" : "/") + urlPat);
+            LOG.info("publish the servcie to {context}/ " + (urlPat.charAt(0) == '/' ? ""
: "/") + urlPat);
+            
+            // TODO we may need to get the url-pattern from servlet context
+            ep.publish("http://localhost/services" + (urlPat.charAt(0) == '/' ? "" : "/")
+ urlPat);
+            
         } catch (ClassNotFoundException ex) {
             throw new ServletException(ex);
         } catch (InstantiationException ex) {

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/servlet/ServletController.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/servlet/ServletController.java?view=diff&rev=474229&r1=474228&r2=474229
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/servlet/ServletController.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/servlet/ServletController.java
Mon Nov 13 02:19:40 2006
@@ -65,9 +65,13 @@
         try {
             EndpointInfo ei = new EndpointInfo();
             ei.setAddress("http://localhost" + request.getServletPath() + request.getPathInfo());
+            
             ServletDestination d = (ServletDestination)transport.getDestination(ei);
 
             if (d.getMessageObserver() == null) {
+                LOG.warning("Can't find the the request for" 
+                         + "http://localhost" + request.getServletPath() 
+                         + request.getPathInfo() + " 's Observer ");
                 generateNotFound(request, res);
             } else if (wsdl) {
                 generateWSDL(request, res, d);

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/servlet/ServletDestination.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/servlet/ServletDestination.java?view=diff&rev=474229&r1=474228&r2=474229
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/servlet/ServletDestination.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/servlet/ServletDestination.java
Mon Nov 13 02:19:40 2006
@@ -151,6 +151,7 @@
      * @param observer the observer to notify on receipt of incoming
      */
     public synchronized void setMessageObserver(MessageObserver observer) {
+        LOG.info("!!! set the observer for address " + getAddress().getAddress().getValue());
         incomingObserver = observer;
     }
     
@@ -365,13 +366,7 @@
             Integer i = (Integer)outMessage.get(Message.RESPONSE_CODE);
             if (i != null) {
                 int status = i.intValue();
-                if (status == HttpURLConnection.HTTP_INTERNAL_ERROR) {
-                    response.sendError(status, "Fault Occurred");
-                } else if (status == HttpURLConnection.HTTP_ACCEPTED) {
-                    response.setStatus(HttpServletResponse.SC_ACCEPTED);
-                } else {
-                    response.setStatus(status);
-                }
+                response.setStatus(status);                
             } else {
                 response.setStatus(HttpURLConnection.HTTP_OK);
             }

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/HolderTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/HolderTest.java?view=diff&rev=474229&r1=474228&r2=474229
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/HolderTest.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/HolderTest.java
Mon Nov 13 02:19:40 2006
@@ -18,11 +18,15 @@
  */
 package org.apache.cxf.jaxws;
 
+import org.w3c.dom.Node;
 import org.apache.cxf.Bus;
 import org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean;
 import org.apache.cxf.mtom_xop.HelloImpl;
 import org.apache.cxf.service.Service;
 import org.apache.cxf.service.factory.ServerFactoryBean;
+import org.apache.cxf.transport.local.LocalTransportFactory;
+
+
 
 public class HolderTest extends AbstractJaxWsTest {
     public void testInvocation() throws Exception {
@@ -38,14 +42,16 @@
         ServerFactoryBean svr = new ServerFactoryBean();
         svr.setBus(bus);
         svr.setServiceFactory(bean);
-        
         svr.create();
 
-//        Node response = invoke("http://localhost:9036/mime-test",
-//                               LocalTransportFactory.TRANSPORT_ID, 
-//                               "echoData.xml");
-//
-//        assertNotNull(response);
-
+        Node response = invoke("http://localhost:9036/mime-test",
+                               LocalTransportFactory.TRANSPORT_ID, 
+                               "echoData.xml");
+        addNamespace("h", "http://cxf.apache.org/mime");        
+        
+        assertValid("//h:data", response);        
+        assertValid("/s:Envelope/s:Body", response); 
+        assertNotNull(response);
+        assertNoFault(response);
     }
 }

Added: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/JAXWSMethodInvokerTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/JAXWSMethodInvokerTest.java?view=auto&rev=474229
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/JAXWSMethodInvokerTest.java
(added)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/JAXWSMethodInvokerTest.java
Mon Nov 13 02:19:40 2006
@@ -0,0 +1,47 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.jaxws;
+
+import junit.framework.TestCase;
+
+import org.apache.cxf.common.util.factory.Factory;
+import org.apache.cxf.message.Exchange;
+import org.apache.cxf.mime.Hello;
+import org.apache.cxf.service.invoker.ScopePolicy;
+import org.easymock.classextension.EasyMock;
+
+public class JAXWSMethodInvokerTest extends TestCase {
+    Factory factory = EasyMock.createMock(Factory.class);
+    Object target = EasyMock.createMock(Hello.class);
+    ScopePolicy scope = EasyMock.createMock(ScopePolicy.class);
+           
+    public void testFactoryBeans() throws Throwable {
+        EasyMock.reset(factory);
+        factory.create();
+        EasyMock.expectLastCall().andReturn(target);
+        EasyMock.replay(factory);
+        JAXWSMethodInvoker jaxwsMethodInvoker = new JAXWSMethodInvoker(factory);
+        Exchange ex = EasyMock.createMock(Exchange.class);               
+        Object object = jaxwsMethodInvoker.getServiceObject(ex);
+        assertEquals("the target object and service object should be equal ", object, target);
+        EasyMock.verify(factory);
+    }
+        
+
+}

Propchange: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/JAXWSMethodInvokerTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/JAXWSMethodInvokerTest.java
------------------------------------------------------------------------------
    svn:keywords = svn:eol-style

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/servlet/ExternalServicesServletTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/servlet/ExternalServicesServletTest.java?view=diff&rev=474229&r1=474228&r2=474229
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/servlet/ExternalServicesServletTest.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/servlet/ExternalServicesServletTest.java
Mon Nov 13 02:19:40 2006
@@ -36,7 +36,7 @@
     public void testPostInvokeServices() throws Exception {
         newClient();
         
-        WebRequest req = new PostMethodWebRequest("http://localhost/greeter1",
+        WebRequest req = new PostMethodWebRequest("http://localhost/services/greeter1",
                 getClass().getResourceAsStream("/org/apache/cxf/jaxws/GreeterMessage.xml"),
                 "text/xml; charset=UTF-8");
         

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/servlet/web-external.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/servlet/web-external.xml?view=diff&rev=474229&r1=474228&r2=474229
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/servlet/web-external.xml
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/servlet/web-external.xml
Mon Nov 13 02:19:40 2006
@@ -39,7 +39,7 @@
 
   <servlet-mapping>
     <servlet-name>CXFServlet</servlet-name>
-    <url-pattern>/*</url-pattern>
+    <url-pattern>/services/*</url-pattern>
   </servlet-mapping>
 
 

Modified: incubator/cxf/trunk/testutils/src/main/java/org/apache/cxf/mtom_xop/HelloImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/testutils/src/main/java/org/apache/cxf/mtom_xop/HelloImpl.java?view=diff&rev=474229&r1=474228&r2=474229
==============================================================================
--- incubator/cxf/trunk/testutils/src/main/java/org/apache/cxf/mtom_xop/HelloImpl.java (original)
+++ incubator/cxf/trunk/testutils/src/main/java/org/apache/cxf/mtom_xop/HelloImpl.java Mon
Nov 13 02:19:40 2006
@@ -40,7 +40,12 @@
         name.value = "return detail + " + name.value;        
     }
 
-    public void echoData(String body, Holder<byte[]> data) {
+    public void echoData(String body, Holder<byte[]> data) {        
+        String echo = new String("echo!");
+        byte[] returnData = new byte[data.value.length + 10];
+        System.arraycopy(data.value, 0, returnData, 0, data.value.length);
+        System.arraycopy(echo.getBytes(), 0, returnData, data.value.length, echo.getBytes().length);
+        data.value = returnData;        
     }
 
     public void echoDataWithEnableMIMEContent(String body, Holder<byte[]> data) {



Mime
View raw message