cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r529203 - in /incubator/cxf/trunk: rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/ rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ tools/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/internal/j...
Date Mon, 16 Apr 2007 10:57:48 GMT
Author: ema
Date: Mon Apr 16 03:57:38 2007
New Revision: 529203

URL: http://svn.apache.org/viewvc?view=rev&rev=529203
Log:
Fixed issue CXF-518: corrected the element Qname referenced by a document bare message part
 

Modified:
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsServiceConfiguration.java
    incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/AbstractServiceConfiguration.java
    incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/ReflectionServiceFactoryBean.java
    incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/JaxwsServiceBuilderTest.java

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=529203&r1=529202&r2=529203
==============================================================================
--- 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 16 03:57:38 2007
@@ -182,6 +182,10 @@
         String tns = mi.getName().getNamespaceURI();
         QName ret = null;
         if (param != null) {
+            /*if (param.targetNamespace().length() > 0) {
+                tns = param.targetNamespace();
+            }*/
+
             String local = param.partName();
             if (local.length() == 0) {
                 local = param.name();
@@ -250,7 +254,7 @@
     }
 
     @Override
-    public QName getOutParameterName(OperationInfo op, Method method, int paramNumber) {
+    public QName getOutParameterName(OperationInfo op, Method method, int paramNumber) {
      
         method = getDeclaredMethod(method);
         
         if (paramNumber >= 0) {
@@ -474,7 +478,7 @@
             return webResult != null && webResult.header();
         }
     }
-
+    
     @Override
     public String getStyle() {
         SOAPBinding ann = implInfo.getEndpointClass().getAnnotation(SOAPBinding.class);
@@ -483,5 +487,31 @@
         }
         return "document";
     }
+    
+    
+    
+    @Override
+    public Boolean isRPC(Method method) {
+        SOAPBinding ann = implInfo.getEndpointClass().getAnnotation(SOAPBinding.class);
+        if (ann != null) {
+            return ann.style().equals(SOAPBinding.Style.RPC);
+        }
+        ann = method.getAnnotation(SOAPBinding.class);
+        if (ann != null) {
+            return ann.style().equals(SOAPBinding.Style.RPC);
+        }
+        return Boolean.FALSE;
+    }
+    
+   /* 
+    @Override 
+    public Boolean hasOutMessage(Method method) {
+        Annotation anno = method.getAnnotation(Oneway.class);
+        if (anno != null) {
+            return Boolean.FALSE;
+        }
+        return Boolean.TRUE;
+    }
+    */
     
 }

Modified: incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/AbstractServiceConfiguration.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/AbstractServiceConfiguration.java?view=diff&rev=529203&r1=529202&r2=529203
==============================================================================
--- incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/AbstractServiceConfiguration.java
(original)
+++ incubator/cxf/trunk/rt/frontend/simple/src/main/java/org/apache/cxf/service/factory/AbstractServiceConfiguration.java
Mon Apr 16 03:57:38 2007
@@ -160,4 +160,8 @@
     public Class getRequestWrapper(Method selected) {
         return null;
     }
+    
+    public Boolean isRPC(Method selected) {
+        return null;
+    }
 }

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=529203&r1=529202&r2=529203
==============================================================================
--- 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 16 03:57:38 2007
@@ -257,7 +257,6 @@
         InterfaceInfo intf = getInterfaceInfo();
 
         Map<QName, Method> validMethods = new HashMap<QName, Method>();
-        
         for (Method m : methods) {
             if (isValidMethod(m)) {
                 QName opName = getOperationName(intf, m);
@@ -328,7 +327,6 @@
 
     protected OperationInfo createOperation(ServiceInfo serviceInfo, InterfaceInfo intf,
Method m) {
         OperationInfo op = intf.addOperation(getOperationName(intf, m));
-
         if (isWrapped(m)) {
             UnwrappedOperationInfo uOp = new UnwrappedOperationInfo(op);
             op.setUnwrappedOperation(uOp);
@@ -444,14 +442,18 @@
         final Class[] paramClasses = method.getParameterTypes();
 
         // Setup the input message
-        MessageInfo inMsg = op.createMessage(getInputMessageName(op, method));        
+        MessageInfo inMsg = op.createMessage(this.getInputMessageName(op, method));     
  
         op.setInput(inMsg.getName().getLocalPart(), inMsg);
 
         for (int j = 0; j < paramClasses.length; j++) {
             if (isInParam(method, j)) {
-                final QName q = getInParameterName(op, method, j);
+                final QName q = getInParameterName(op, method, j);                
                 final QName q2 = getInPartName(op, method, j);
                 MessagePartInfo part = inMsg.addMessagePart(q2);
+                //if Docoument ,Bare
+                if (!isRPC(method) && !isWrapped(method) && wrappedStyle
== null) {
+                    part.setElementQName(q);
+                } 
                 initializeParameter(part, paramClasses[j], method.getGenericParameterTypes()[j]);
                 //TODO - RPC vs DOC (type vs element)
                 if (isHeader(method, j)) {
@@ -461,25 +463,34 @@
                 part.setIndex(j);
             }
         }
-
+        
         if (hasOutMessage(method)) {
             // Setup the output message
-            MessageInfo outMsg = op.createMessage(createOutputMessageName(op, method));
+            MessageInfo  outMsg = op.createMessage(createOutputMessageName(op, method));
             op.setOutput(outMsg.getName().getLocalPart(), outMsg);
-
             final Class<?> returnType = method.getReturnType();
             if (!returnType.isAssignableFrom(void.class)) {
-                final QName q = getOutPartName(op, method, -1);                
+                final QName q = getOutPartName(op, method, -1); 
+                QName q2 = getOutParameterName(op, method, -1);
                 MessagePartInfo part = outMsg.addMessagePart(q);
+                if (!isRPC(method) && !isWrapped(method)) {
+                    part.setElementQName(q2);
+                } 
                 initializeParameter(part, method.getReturnType(), method.getGenericReturnType());
                 part.setIndex(-1);
             }
 
             for (int j = 0; j < paramClasses.length; j++) {
                 if (isOutParam(method, j)) {
+                    if (outMsg == null) {
+                        outMsg = op.createMessage(createOutputMessageName(op, method)); 
+                    }
                     final QName q = getOutPartName(op, method, j);
                     final QName q2 = getOutParameterName(op, method, j);
-                    MessagePartInfo part = outMsg.addMessagePart(q);
+                    MessagePartInfo part = outMsg.addMessagePart(q);               
+                    if (!isRPC(method) && !isWrapped(method) && wrappedStyle
== null) {
+                        part.setElementQName(q2);
+                    } 
                     initializeParameter(part, paramClasses[j], method.getGenericParameterTypes()[j]);
                     part.setIndex(j);
                     
@@ -492,11 +503,12 @@
                     }
                 }
             }
+            
         }
 
         initializeFaults(intf, op, method);
     }
-    
+
     protected void createInputWrappedMessageParts(OperationInfo op, Method method, MessageInfo
inMsg) {
         MessagePartInfo part = inMsg.addMessagePart(op.getInputName());
         part.setElement(true);
@@ -830,6 +842,7 @@
             if (q != null) {
                 return q;
             }
+            
         }
         throw new IllegalStateException("ServiceConfiguration must provide a value!");
     }
@@ -986,7 +999,8 @@
         }
         return true;
     }
-
+    
+    
     public String getStyle() {
         for (AbstractServiceConfiguration c : serviceConfigurations) {
             String style = c.getStyle();
@@ -995,6 +1009,16 @@
             }
         }
         return "document";
+    }
+    
+    public boolean isRPC(Method method) {
+        for (AbstractServiceConfiguration c : serviceConfigurations) {
+            Boolean b = c.isRPC(method);
+            if (b != null) {
+                return b.booleanValue();
+            }
+        }
+        return true;
     }
 
     public void setWrapped(boolean style) {

Modified: incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/JaxwsServiceBuilderTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/JaxwsServiceBuilderTest.java?view=diff&rev=529203&r1=529202&r2=529203
==============================================================================
--- incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/JaxwsServiceBuilderTest.java
(original)
+++ incubator/cxf/trunk/tools/javato/src/test/java/org/apache/cxf/tools/java2wsdl/processor/internal/jaxws/JaxwsServiceBuilderTest.java
Mon Apr 16 03:57:38 2007
@@ -101,7 +101,6 @@
 
     // TODO:
     @Test
-    @Ignore
     public void testDocWrapparBare() throws Exception {
 
         builder.setServiceClass(org.apache.hello_world_doc_wrapped_bare.Greeter.class);
@@ -114,7 +113,7 @@
         assertTrue(output.exists());
 
     }
-    
+
     //FIXME: CXF-519, CXF-533
     @Test
     @Ignore
@@ -256,5 +255,5 @@
     private File getOutputFile(String fileName) {
         return new File(output, fileName);
     }
-    
+
 }



Mime
View raw message