cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r681060 - /cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ParameterProcessor.java
Date Wed, 30 Jul 2008 14:13:40 GMT
Author: dkulp
Date: Wed Jul 30 07:13:38 2008
New Revision: 681060

URL: http://svn.apache.org/viewvc?rev=681060&view=rev
Log:
Double check that we really can map all the wrapped parameters to classes.   If not, fallback
to bare mode.

Modified:
    cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ParameterProcessor.java

Modified: cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ParameterProcessor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ParameterProcessor.java?rev=681060&r1=681059&r2=681060&view=diff
==============================================================================
--- cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ParameterProcessor.java
(original)
+++ cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ParameterProcessor.java
Wed Jul 30 07:13:38 2008
@@ -489,6 +489,48 @@
     private void buildParamModelsWithoutOrdering(JavaMethod method,
                                                  MessageInfo inputMessage,
                                                  MessageInfo outputMessage) throws ToolException
{
+        boolean wrapped = method.isWrapperStyle();
+        if (wrapped) {
+            //check if really can be wrapper style....
+            List<MessagePartInfo> outputParts = outputMessage.getMessageParts();
+            List<MessagePartInfo> inputParts = inputMessage.getMessageParts();
+
+            MessagePartInfo inputPart = inputParts.size() > 0 ? inputParts.iterator().next()
: null;
+            MessagePartInfo outputPart = outputParts.size() > 0 ? outputParts.iterator().next()
: null;
+
+            List<QName> inputWrapElement = null;
+            List<QName> outputWrapElement = null;
+
+            if (inputPart != null) {
+                inputWrapElement = ProcessorUtil.getWrappedElementQNames(context, 
+                                                                         inputPart.getElementQName());
+            }
+            if (outputPart != null) {
+                outputWrapElement = ProcessorUtil.getWrappedElementQNames(context, 
+                                                                          outputPart.getElementQName());
+            }
+            for (QName item : inputWrapElement) {
+                String fullJavaName = this.dataBinding.getWrappedElementType(inputPart.getElementQName(),
+                                                                             item);
+                if (StringUtils.isEmpty(fullJavaName)) {
+                    wrapped = false;
+                    break;
+                }
+            }
+            for (QName item : outputWrapElement) {
+                String fullJavaName = this.dataBinding.getWrappedElementType(outputPart.getElementQName(),
+                                                                             item);
+                if (StringUtils.isEmpty(fullJavaName)) {
+                    wrapped = false;
+                    break;
+                }
+            }
+            if (!wrapped) {
+                //could not map one of the parameters to a java type, need to drop down to
bare style
+                method.setWrapperStyle(false);
+            }
+        }
+        
         if (inputMessage != null) {
             if (method.isWrapperStyle()) {
                 processWrappedInput(method, inputMessage);



Mime
View raw message