servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r798353 - in /servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-cxf-se/src/test: java/org/apache/servicemix/cxfse/ resources/org/apache/servicemix/cxfse/proxytarget/
Date Tue, 28 Jul 2009 01:20:35 GMT
Author: ffang
Date: Tue Jul 28 01:20:35 2009
New Revision: 798353

URL: http://svn.apache.org/viewvc?rev=798353&view=rev
Log:
[SMXCOMP-601]cxf client proxy in smx should be able to use jaxws way to get/set properties
from/to underlying JBI normalized message

Modified:
    servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-cxf-se/src/test/java/org/apache/servicemix/cxfse/CxfSeClientProxyTest.java
    servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-cxf-se/src/test/java/org/apache/servicemix/cxfse/GreeterImplForClientProxy.java
    servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-cxf-se/src/test/java/org/apache/servicemix/cxfse/TestMtomImpl.java
    servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-cxf-se/src/test/resources/org/apache/servicemix/cxfse/proxytarget/xbean.xml

Modified: servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-cxf-se/src/test/java/org/apache/servicemix/cxfse/CxfSeClientProxyTest.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-cxf-se/src/test/java/org/apache/servicemix/cxfse/CxfSeClientProxyTest.java?rev=798353&r1=798352&r2=798353&view=diff
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-cxf-se/src/test/java/org/apache/servicemix/cxfse/CxfSeClientProxyTest.java
(original)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-cxf-se/src/test/java/org/apache/servicemix/cxfse/CxfSeClientProxyTest.java
Tue Jul 28 01:20:35 2009
@@ -130,6 +130,26 @@
         assertTrue(new SourceTransformer().contentToString(
                 io.getOutMessage()).indexOf("Hello ffang 3") > 0);
         client.done(io);
+   
+        client = new DefaultServiceMixClient(container);
+        io = client.createInOutExchange();
+        io.setService(new QName("http://apache.org/hello_world_soap_http", "SOAPService"));
+        io.setInterfaceName(new QName("http://apache.org/hello_world_soap_http", "Greeter"));
+        io.setOperation(new QName("http://apache.org/hello_world_soap_http", "greetMe"));
+        LOG.info("test property get/set");
+        io.getInMessage().setContent(new StringSource(
+                "<message xmlns='http://java.sun.com/xml/ns/jbi/wsdl-11-wrapper'>"
+              + "<part> "
+              + "<greetMe xmlns='http://apache.org/hello_world_soap_http/types'><requestType>"
+              + "property"
+              + "</requestType></greetMe>"
+              + "</part> "
+              + "</message>"));
+        client.sendSync(io);
+        assertTrue(new SourceTransformer().contentToString(
+                io.getOutMessage()).indexOf("Hello ffang") > 0);
+        client.done(io);
+        
     }
     
     protected void tearDown() throws Exception {

Modified: servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-cxf-se/src/test/java/org/apache/servicemix/cxfse/GreeterImplForClientProxy.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-cxf-se/src/test/java/org/apache/servicemix/cxfse/GreeterImplForClientProxy.java?rev=798353&r1=798352&r2=798353&view=diff
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-cxf-se/src/test/java/org/apache/servicemix/cxfse/GreeterImplForClientProxy.java
(original)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-cxf-se/src/test/java/org/apache/servicemix/cxfse/GreeterImplForClientProxy.java
Tue Jul 28 01:20:35 2009
@@ -24,6 +24,7 @@
 import javax.jws.WebService;
 import javax.mail.util.ByteArrayDataSource;
 import javax.xml.ws.AsyncHandler;
+import javax.xml.ws.BindingProvider;
 import javax.xml.ws.Holder;
 import javax.xml.ws.Response;
 
@@ -71,6 +72,14 @@
             } else if ("payload".equals(me)) {
                 ret = getCalculatorPayload().add(1, 2);
                 return "Hello " + me  + " " + ret;
+            } else if ("property".equals(me)) {
+                ((BindingProvider)mtom).getRequestContext().put("test-property", "Hello ");
+                Holder<DataHandler> param = new Holder<DataHandler>();
+                param.value = new DataHandler(new ByteArrayDataSource("foobar".getBytes(),

+                    "application/octet-stream"));
+                Holder<String> name = new Holder<String>("property");
+                mtom.testXop(name, param);
+                return (String) ((BindingProvider)mtom).getResponseContext().get("test-property");
             }
                         
         } catch (Exception e) {

Modified: servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-cxf-se/src/test/java/org/apache/servicemix/cxfse/TestMtomImpl.java
URL: http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-cxf-se/src/test/java/org/apache/servicemix/cxfse/TestMtomImpl.java?rev=798353&r1=798352&r2=798353&view=diff
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-cxf-se/src/test/java/org/apache/servicemix/cxfse/TestMtomImpl.java
(original)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-cxf-se/src/test/java/org/apache/servicemix/cxfse/TestMtomImpl.java
Tue Jul 28 01:20:35 2009
@@ -21,10 +21,15 @@
 import java.io.InputStream;
 
 import javax.activation.DataHandler;
+import javax.annotation.Resource;
 import javax.jws.WebService;
 import javax.mail.util.ByteArrayDataSource;
 import javax.xml.ws.Holder;
+import javax.xml.ws.WebServiceContext;
+import javax.xml.ws.handler.MessageContext;
 
+import org.apache.cxf.jaxws.context.WrappedMessageContext;
+import org.apache.cxf.message.Message;
 import org.apache.cxf.mime.TestMtom;
 
 @WebService(serviceName = "TestMtomService", 
@@ -33,11 +38,19 @@
         endpointInterface = "org.apache.cxf.mime.TestMtom",
             wsdlLocation = "testutils/mtom_xop.wsdl")
 public class TestMtomImpl implements TestMtom {
+    @Resource
+    private WebServiceContext wsContext;
     public void testXop(Holder<String> name, Holder<DataHandler> attachinfo)
{
         
         try {
             if ("runtime exception".equals(name.value)) {
                 throw new RuntimeException("throw runtime exception");
+            } else if ("property".equals(name.value)) {
+                MessageContext ctx = wsContext.getMessageContext();
+                Message message = ((WrappedMessageContext) ctx).getWrappedMessage();
+                String testProperty = (String) message.get("test-property");
+                message.put("test-property", testProperty + "ffang");
+                return;
             }
             InputStream bis = attachinfo.value.getDataSource().getInputStream();
             byte b[] = new byte[6];

Modified: servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-cxf-se/src/test/resources/org/apache/servicemix/cxfse/proxytarget/xbean.xml
URL: http://svn.apache.org/viewvc/servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-cxf-se/src/test/resources/org/apache/servicemix/cxfse/proxytarget/xbean.xml?rev=798353&r1=798352&r2=798353&view=diff
==============================================================================
--- servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-cxf-se/src/test/resources/org/apache/servicemix/cxfse/proxytarget/xbean.xml
(original)
+++ servicemix/smx3/branches/servicemix-3.2/deployables/serviceengines/servicemix-cxf-se/src/test/resources/org/apache/servicemix/cxfse/proxytarget/xbean.xml
Tue Jul 28 01:20:35 2009
@@ -47,5 +47,22 @@
           <bean class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
         </cxfse:outFaultInterceptors>
       </cxfse:endpoint>
-    
+      <cxfse:endpoint mtomEnabled="true">
+        <cxfse:pojo>
+          <bean class="org.apache.servicemix.cxfse.TestMtomImpl" />
+        </cxfse:pojo>
+        <cxfse:inInterceptors>
+          <bean class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
+        </cxfse:inInterceptors>
+        <cxfse:outInterceptors>
+          <bean class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
+        </cxfse:outInterceptors>
+        <cxfse:inFaultInterceptors>
+          <bean class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
+        </cxfse:inFaultInterceptors>
+        <cxfse:outFaultInterceptors>
+          <bean class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
+        </cxfse:outFaultInterceptors>
+      </cxfse:endpoint>
+ 
 </beans>



Mime
View raw message