cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r526923 - in /incubator/cxf/trunk/rt: bindings/soap/src/main/java/org/apache/cxf/binding/soap/ bindings/soap/src/main/java/org/apache/cxf/binding/soap/model/ core/src/main/java/org/apache/cxf/interceptor/ frontend/jaxws/src/main/java/org/ap...
Date Mon, 09 Apr 2007 21:16:56 GMT
Author: dkulp
Date: Mon Apr  9 14:16:44 2007
New Revision: 526923

URL: http://svn.apache.org/viewvc?view=rev&rev=526923
Log:
Better support for code first cases that have headers or are "bare"


Modified:
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingInfoConfigBean.java
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/model/SoapHeaderInfo.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractInDatabindingInterceptor.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/DocLiteralInInterceptor.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/HeaderTest.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/JaxWsClientTest.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/header/HeaderClientServerTest.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBeanTest.java
    incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingInfoConfigBean.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingInfoConfigBean.java?view=diff&rev=526923&r1=526922&r2=526923
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingInfoConfigBean.java
(original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapBindingInfoConfigBean.java
Mon Apr  9 14:16:44 2007
@@ -31,7 +31,9 @@
     private boolean mtomEnabled;
     
 
-
+    public SoapBindingInfoConfigBean() {
+        
+    }
 
     protected boolean isHeader(BindingOperationInfo op, MessagePartInfo part) {
         return false;

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/model/SoapHeaderInfo.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/model/SoapHeaderInfo.java?view=diff&rev=526923&r1=526922&r2=526923
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/model/SoapHeaderInfo.java
(original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/model/SoapHeaderInfo.java
Mon Apr  9 14:16:44 2007
@@ -25,6 +25,10 @@
     
     private MessagePartInfo part;
     private String use;
+    
+    public SoapHeaderInfo() {
+        
+    }
 
     public MessagePartInfo getPart() {
         return part;

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractInDatabindingInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractInDatabindingInterceptor.java?view=diff&rev=526923&r1=526922&r2=526923
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractInDatabindingInterceptor.java
(original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractInDatabindingInterceptor.java
Mon Apr  9 14:16:44 2007
@@ -162,20 +162,21 @@
      * @param client
      * @return
      */
-    protected BindingOperationInfo getBindingOperationInfoForWrapped(Exchange exchange, QName
name,
-                                                                     boolean client) {
+    protected BindingOperationInfo getBindingOperationInfo(Exchange exchange, QName name,
+                                                              boolean client) {
         String local = name.getLocalPart();
         if (client && local.endsWith("Response")) {
             local = local.substring(0, local.length() - 8);
         }
 
         // TODO: Allow overridden methods.
-        BindingOperationInfo operation = ServiceModelUtil.getOperation(exchange, local);
-        if (operation != null && operation.isUnwrappedCapable()) {
-            return operation;
+        BindingOperationInfo bop = ServiceModelUtil.getOperation(exchange, local);
+        
+        if (bop != null) {
+            exchange.put(BindingOperationInfo.class, bop);
+            exchange.put(OperationInfo.class, bop.getOperationInfo());
         }
-
-        return null;
+        return bop;
     }
     
     protected MessageInfo getMessageInfo(Message message, BindingOperationInfo operation)
{

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/DocLiteralInInterceptor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/DocLiteralInInterceptor.java?view=diff&rev=526923&r1=526922&r2=526923
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/DocLiteralInInterceptor.java
(original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/interceptor/DocLiteralInInterceptor.java
Mon Apr  9 14:16:44 2007
@@ -87,7 +87,7 @@
 
         if (bop == null) {
             QName startQName = xmlReader.getName();
-            bop = getBindingOperationInfoForWrapped(exchange, startQName, client);
+            bop = getBindingOperationInfo(exchange, startQName, client);
         }
 
         if (bop != null && bop.isUnwrappedCapable()) {
@@ -132,7 +132,6 @@
                 } else {
                     msgInfo = bop.getInput();
                 }
-
             }
 
             Collection<OperationInfo> operations = null;

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java?view=diff&rev=526923&r1=526922&r2=526923
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java
Mon Apr  9 14:16:44 2007
@@ -425,6 +425,7 @@
         if (!getServiceFactory().isWrapped()) {
             return Boolean.FALSE;
         }
+        m = getDeclaredMethod(m);
 
         SOAPBinding ann = m.getAnnotation(SOAPBinding.class);
         if (ann != null) {

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/HeaderTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/HeaderTest.java?view=diff&rev=526923&r1=526922&r2=526923
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/HeaderTest.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/HeaderTest.java
Mon Apr  9 14:16:44 2007
@@ -26,9 +26,9 @@
 
 import org.apache.cxf.Bus;
 import org.apache.cxf.frontend.ServerFactoryBean;
+import org.apache.cxf.jaxws.binding.soap.JaxWsSoapBindingInfoConfigBean;
 import org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean;
 import org.apache.cxf.service.Service;
-import org.apache.cxf.service.factory.ReflectionServiceFactoryBean;
 import org.apache.cxf.service.model.MessagePartInfo;
 import org.apache.cxf.service.model.OperationInfo;
 import org.apache.cxf.transport.local.LocalTransportFactory;
@@ -41,7 +41,7 @@
     
     @Test
     public void testInvocation() throws Exception {
-        ReflectionServiceFactoryBean bean = new JaxWsServiceFactoryBean();
+        JaxWsServiceFactoryBean bean = new JaxWsServiceFactoryBean();
 
         Bus bus = getBus();
         bean.setBus(bus);
@@ -76,6 +76,8 @@
         ServerFactoryBean svr = new ServerFactoryBean();
         svr.setBus(bus);
         svr.setServiceFactory(bean);
+        svr.setAddress("http://localhost:9104/SoapHeaderContext/SoapHeaderPort");
+        svr.setBindingConfig(new JaxWsSoapBindingInfoConfigBean(bean));
         
         svr.create();
         

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/JaxWsClientTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/JaxWsClientTest.java?view=diff&rev=526923&r1=526922&r2=526923
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/JaxWsClientTest.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/JaxWsClientTest.java
Mon Apr  9 14:16:44 2007
@@ -84,8 +84,9 @@
     
     @Test
     public void testRequestContext() throws Exception {
+        URL url = getClass().getResource("/wsdl/hello_world.wsdl");
         javax.xml.ws.Service s = javax.xml.ws.Service
-            .create(serviceName);
+            .create(url, serviceName);
         Greeter greeter = s.getPort(portName, Greeter.class);
         InvocationHandler handler  = Proxy.getInvocationHandler(greeter);
         BindingProvider  bp = null;

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/header/HeaderClientServerTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/header/HeaderClientServerTest.java?view=diff&rev=526923&r1=526922&r2=526923
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/header/HeaderClientServerTest.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/header/HeaderClientServerTest.java
Mon Apr  9 14:16:44 2007
@@ -78,7 +78,6 @@
         e = (EndpointImpl)Endpoint.publish(address, implementor);        
         e.getServer().getEndpoint().getInInterceptors().add(new LoggingInInterceptor());
         e.getServer().getEndpoint().getOutInterceptors().add(new LoggingOutInterceptor());
-        
     }
 
     @Test
@@ -317,4 +316,5 @@
   //         proxy.sendReceiveAnyType(simpleAll, new SimpleChoice());    
   
   //     }
+   
 }

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBeanTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBeanTest.java?view=diff&rev=526923&r1=526922&r2=526923
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBeanTest.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/support/JaxWsServiceFactoryBeanTest.java
Mon Apr  9 14:16:44 2007
@@ -27,7 +27,6 @@
 
 import org.apache.cxf.Bus;
 import org.apache.cxf.jaxws.AbstractJaxWsTest;
-import org.apache.cxf.mime.types.XopType;
 import org.apache.cxf.mtom_xop.TestMtomImpl;
 import org.apache.cxf.service.Service;
 import org.apache.cxf.service.factory.ReflectionServiceFactoryBean;
@@ -102,13 +101,22 @@
             new QName("http://cxf.apache.org/mime", "testXop"));
         assertNotNull(op);
         
-        // test setup of input parts
+        
         Iterator<MessagePartInfo> itr = op.getInput().getMessageParts().iterator();
         assertTrue(itr.hasNext());
         MessagePartInfo part = itr.next();
-        assertEquals("data", part.getName().getLocalPart());
-        assertEquals(XopType.class, part.getTypeClass());
-
+        assertEquals("testXop", part.getElementQName().getLocalPart());
+        
+        op = op.getUnwrappedOperation();
+        assertNotNull(op);
+        
+        // test setup of input parts
+        itr = op.getInput().getMessageParts().iterator();
+        assertTrue(itr.hasNext());
+        part = itr.next();
+        assertEquals("name", part.getName().getLocalPart());
+        assertEquals(String.class, part.getTypeClass());
+        
         /*
          * revisit, try to use other wsdl operation rewrite test in future 
         assertTrue(itr.hasNext());
@@ -125,6 +133,5 @@
         part = itr.next();
         assertEquals(Boolean.TRUE, part.getProperty(JaxWsServiceFactoryBean.MODE_INOUT));
         */
-        assertFalse(itr.hasNext());
     }
 }

Modified: incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java?view=diff&rev=526923&r1=526922&r2=526923
==============================================================================
--- incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
(original)
+++ incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
Mon Apr  9 14:16:44 2007
@@ -434,8 +434,9 @@
 
         for (int j = 0; j < paramClasses.length; j++) {
             if (isInParam(method, j)) {
-                final QName q = getInParameterName(op, method, j);                
-                MessagePartInfo part = inMsg.addMessagePart(q);
+                final QName q = getInParameterName(op, method, j);
+                final QName q2 = getInPartName(op, method, j);
+                MessagePartInfo part = inMsg.addMessagePart(q2);
                 initializeParameter(part, paramClasses[j], method.getGenericParameterTypes()[j]);
                 //TODO - RPC vs DOC (type vs element)
                 if (isHeader(method, j)) {
@@ -452,7 +453,7 @@
 
             final Class<?> returnType = method.getReturnType();
             if (!returnType.isAssignableFrom(void.class)) {
-                final QName q = getOutParameterName(op, method, -1);                
+                final QName q = getOutPartName(op, method, -1);                
                 MessagePartInfo part = outMsg.addMessagePart(q);
                 initializeParameter(part, method.getReturnType(), method.getGenericReturnType());
                 part.setIndex(-1);
@@ -460,7 +461,8 @@
 
             for (int j = 0; j < paramClasses.length; j++) {
                 if (isOutParam(method, j)) {
-                    final QName q = getInParameterName(op, method, j);
+                    final QName q = getOutPartName(op, method, j);
+                    final QName q2 = getOutParameterName(op, method, j);
                     MessagePartInfo part = outMsg.addMessagePart(q);
                     initializeParameter(part, paramClasses[j], method.getGenericParameterTypes()[j]);
                     part.setIndex(j);
@@ -469,7 +471,7 @@
                         part.setProperty(MODE_INOUT, Boolean.TRUE);
                     }
                     if (isHeader(method, j)) {
-                        part.setElementQName(q);
+                        part.setElementQName(q2);
                     }
                 }
             }



Mime
View raw message