cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r834570 - in /cxf/branches/2.1.x-fixes: ./ rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/soap/ tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/ tools/wsdlto/frontend/jaxws/src/main/java/org/a...
Date Tue, 10 Nov 2009 18:07:25 GMT
Author: dkulp
Date: Tue Nov 10 18:07:24 2009
New Revision: 834570

URL: http://svn.apache.org/viewvc?rev=834570&view=rev
Log:
Merged revisions 833109 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/branches/2.2.x-fixes

................
  r833109 | dkulp | 2009-11-05 13:13:39 -0500 (Thu, 05 Nov 2009) | 10 lines
  
  Merged revisions 833079 via svnmerge from 
  https://svn.apache.org/repos/asf/cxf/trunk
  
  ........
    r833079 | dkulp | 2009-11-05 11:53:26 -0500 (Thu, 05 Nov 2009) | 2 lines
    
    [CXF-2522] wsdl2java not honoring jaxws:parameter extension for wrapped
    elements
  ........
................

Modified:
    cxf/branches/2.1.x-fixes/   (props changed)
    cxf/branches/2.1.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/soap/RMSoapInterceptorTest.java
    cxf/branches/2.1.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java
    cxf/branches/2.1.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/JAXWSBinding.java
    cxf/branches/2.1.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/JAXWSBindingParser.java
    cxf/branches/2.1.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/JAXWSParameter.java
    cxf/branches/2.1.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ParameterProcessor.java
    cxf/branches/2.1.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ServiceProcessor.java
    cxf/branches/2.1.x-fixes/tools/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/JAXWSDefinitionBuilderTest.java

Propchange: cxf/branches/2.1.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.1.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/soap/RMSoapInterceptorTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/soap/RMSoapInterceptorTest.java?rev=834570&r1=834569&r2=834570&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/soap/RMSoapInterceptorTest.java
(original)
+++ cxf/branches/2.1.x-fixes/rt/ws/rm/src/test/java/org/apache/cxf/ws/rm/soap/RMSoapInterceptorTest.java
Tue Nov 10 18:07:24 2009
@@ -406,6 +406,7 @@
     private SoapMessage setUpInboundMessage(String resource) throws XMLStreamException {
         Message message = new MessageImpl();
         SoapMessage soapMessage = new SoapMessage(message);
+        message.put(Message.SCHEMA_VALIDATION_ENABLED, false);
         InputStream is = RMSoapInterceptorTest.class.getResourceAsStream(resource);
         assertNotNull(is);
         XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(is);

Modified: cxf/branches/2.1.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java?rev=834570&r1=834569&r2=834570&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java
(original)
+++ cxf/branches/2.1.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java
Tue Nov 10 18:07:24 2009
@@ -658,8 +658,8 @@
                 binding1.setJaxwsClass(binding2.getJaxwsClass());
             }
 
-            if (binding2.getJaxwsPara() != null) {
-                binding1.setJaxwsPara(binding2.getJaxwsPara());
+            if (binding2.getJaxwsParas() != null) {
+                binding1.setJaxwsParas(binding2.getJaxwsParas());
             }
             return binding1;
         }

Modified: cxf/branches/2.1.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/JAXWSBinding.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/JAXWSBinding.java?rev=834570&r1=834569&r2=834570&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/JAXWSBinding.java
(original)
+++ cxf/branches/2.1.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/JAXWSBinding.java
Tue Nov 10 18:07:24 2009
@@ -20,6 +20,8 @@
 package org.apache.cxf.tools.wsdlto.frontend.jaxws.customization;
 
 import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
 
 import javax.wsdl.extensions.ExtensibilityElement;
 import javax.xml.namespace.QName;
@@ -49,7 +51,7 @@
     
     private String classJavaDoc;
 
-    private JAXWSParameter jaxwsPara;
+    private List<JAXWSParameter> jaxwsPara;
 
     private JAXWSClass jaxwsClass;
 
@@ -123,11 +125,17 @@
         return this.packageName;
     }
 
-    public void setJaxwsPara(JAXWSParameter para) {
-        jaxwsPara = para;
+    public void addJaxwsPara(JAXWSParameter para) {
+        if (jaxwsPara == null) {
+            jaxwsPara = new ArrayList<JAXWSParameter>();
+        }
+        jaxwsPara.add(para);
     }
 
-    public JAXWSParameter getJaxwsPara() {
+    public void setJaxwsParas(List<JAXWSParameter> p) {
+        jaxwsPara = new ArrayList<JAXWSParameter>(p);
+    }
+    public List<JAXWSParameter> getJaxwsParas() {
         return jaxwsPara;
     }
 

Modified: cxf/branches/2.1.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/JAXWSBindingParser.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/JAXWSBindingParser.java?rev=834570&r1=834569&r2=834570&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/JAXWSBindingParser.java
(original)
+++ cxf/branches/2.1.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/JAXWSBindingParser.java
Tue Nov 10 18:07:24 2009
@@ -25,6 +25,7 @@
 import javax.wsdl.WSDLException;
 import javax.wsdl.extensions.ExtensionRegistry;
 import javax.xml.namespace.NamespaceContext;
+import javax.xml.namespace.QName;
 import javax.xml.xpath.XPath;
 import javax.xml.xpath.XPathConstants;
 import javax.xml.xpath.XPathExpressionException;
@@ -36,6 +37,7 @@
 
 import org.apache.cxf.common.i18n.Message;
 import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.helpers.DOMUtils;
 import org.apache.cxf.tools.common.ToolConstants;
 import org.apache.cxf.tools.common.ToolException;
@@ -105,7 +107,9 @@
                     String partPath = "//" +  childElement.getAttribute("part");
                     Node node = queryXPathNode(element.getOwnerDocument().getDocumentElement(),
partPath);
                     String messageName = "";
+                    String partName = "";
                     if (node != null) {
+                        partName = ((Element)node).getAttribute("name");
                         Node messageNode = node.getParentNode();
                         if (messageNode != null) {
                             Element messageEle = (Element)messageNode;
@@ -114,9 +118,20 @@
                     }
 
                     String name = childElement.getAttribute("name");
-                    String elementName = childElement.getAttribute("childElementName");
-                    JAXWSParameter jpara = new JAXWSParameter(messageName, elementName, name);
-                    jaxwsBinding.setJaxwsPara(jpara);
+                    String elementNameString = childElement.getAttribute("childElementName");
+                    QName elementName = null;
+                    if (!StringUtils.isEmpty(elementNameString)) {
+                        String ns = "";
+                        if (elementNameString.indexOf(':') != -1) {
+                            ns = elementNameString.substring(0, elementNameString.indexOf(':'));
+                            ns = childElement.lookupNamespaceURI(ns);
+                            elementNameString = elementNameString
+                                .substring(elementNameString.indexOf(':') + 1);
+                        }
+                        elementName = new QName(ns, elementNameString);
+                    }
+                    JAXWSParameter jpara = new JAXWSParameter(messageName, partName, elementName,
name);
+                    jaxwsBinding.addJaxwsPara(jpara);
                 } else if (isJAXWSClass(child)) {
                     Element childElement = (Element)child;
                     String clzName = childElement.getAttribute("name");

Modified: cxf/branches/2.1.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/JAXWSParameter.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/JAXWSParameter.java?rev=834570&r1=834569&r2=834570&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/JAXWSParameter.java
(original)
+++ cxf/branches/2.1.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/JAXWSParameter.java
Tue Nov 10 18:07:24 2009
@@ -18,13 +18,17 @@
  */
 package org.apache.cxf.tools.wsdlto.frontend.jaxws.customization;
 
+import javax.xml.namespace.QName;
+
 public class JAXWSParameter {
     private String name;
-    private String eleName;
+    private String part;
+    private QName eleName;
     private String messageName;
 
-    public JAXWSParameter(String msgName , String elementName, String name) {
+    public JAXWSParameter(String msgName, String part, QName elementName, String name) {
         this.messageName = msgName;
+        this.setPart(part);
         this.eleName = elementName;
         this.name = name;
     }
@@ -37,11 +41,19 @@
         return name;
     }
 
-    public void setElementName(String elementName) {
+    public void setPart(String part) {
+        this.part = part;
+    }
+
+    public String getPart() {
+        return part;
+    }
+
+    public void setElementName(QName elementName) {
         this.eleName = elementName;
     }
 
-    public String getElementName() {
+    public QName getElementName() {
         return eleName;
     }
 

Modified: cxf/branches/2.1.x-fixes/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/branches/2.1.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ParameterProcessor.java?rev=834570&r1=834569&r2=834570&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ParameterProcessor.java
(original)
+++ cxf/branches/2.1.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ParameterProcessor.java
Tue Nov 10 18:07:24 2009
@@ -43,6 +43,8 @@
 import org.apache.cxf.tools.common.model.JavaReturn;
 import org.apache.cxf.tools.common.model.JavaType;
 import org.apache.cxf.tools.wsdlto.core.DataBindingProfile;
+import org.apache.cxf.tools.wsdlto.frontend.jaxws.customization.JAXWSBinding;
+import org.apache.cxf.tools.wsdlto.frontend.jaxws.customization.JAXWSParameter;
 import org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.annotator.WebParamAnnotator;
 import org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.annotator.XmlJavaTypeAdapterAnnotator;
 import org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.annotator.XmlListAnotator;
@@ -203,11 +205,20 @@
             }
         }
 
+        JAXWSBinding mBinding = inputMessage.getOperation().getExtensor(JAXWSBinding.class);
         for (MessagePartInfo part : inputMessage.getMessageParts()) {
             if (isOutOfBandHeader(part) && !requireOutOfBandHeader()) {
                 continue;
             }
-            addParameter(method, getParameterFromPart(method, part, JavaType.Style.IN));
+            JavaParameter param = getParameterFromPart(method, part, JavaType.Style.IN);
+            if (mBinding != null && mBinding.getJaxwsParas() != null) {
+                for (JAXWSParameter jwp : mBinding.getJaxwsParas()) {
+                    if (part.getName().getLocalPart().equals(jwp.getPart())) {
+                        param.setName(jwp.getName());
+                    }
+                }
+            }
+            addParameter(method, param);
         }
     }
 
@@ -227,9 +238,17 @@
             && countOutOfBandHeader(inputMessage) == 0) {
             return;
         }
+        JAXWSBinding mBinding = inputMessage.getOperation().getExtensor(JAXWSBinding.class);
         for (QName item : wrappedElements) {
             JavaParameter jp = getParameterFromQName(part.getElementQName(),
                                   item, JavaType.Style.IN, part);
+            if (mBinding != null && mBinding.getJaxwsParas() != null) {
+                for (JAXWSParameter jwsp : mBinding.getJaxwsParas()) {
+                    if (item.equals(jwsp.getElementName())) {
+                        jp.setName(jwsp.getName());
+                    }
+                }
+            }
             
             if (StringUtils.isEmpty(part.getConcreteName().getNamespaceURI())) { 
                 jp.setTargetNamespace("");
@@ -296,8 +315,19 @@
             } else {
                 processReturn(method, null);
             }
+            JAXWSBinding mBinding = outputMessage.getOperation().getExtensor(JAXWSBinding.class);
             for (MessagePartInfo part : outParts) {
-                addParameter(method, getParameterFromPart(method, part, JavaType.Style.OUT));
+
+                JavaParameter param = getParameterFromPart(method, part, JavaType.Style.OUT);
+                if (mBinding != null && mBinding.getJaxwsParas() != null) {
+                    for (JAXWSParameter jwp : mBinding.getJaxwsParas()) {
+                        if (part.getName().getLocalPart().equals(jwp.getPart())) {
+                            param.setName(jwp.getName());
+                        }
+                    }
+                }
+
+                addParameter(method, param);
             }
         } else {
             processReturn(method, null);
@@ -444,6 +474,16 @@
                 if (!qualified) {
                     jp.setTargetNamespace("");
                 }
+                
+                JAXWSBinding mBinding = outputMessage.getOperation().getExtensor(JAXWSBinding.class);
+                if (mBinding != null && mBinding.getJaxwsParas() != null) {
+                    for (JAXWSParameter jwsp : mBinding.getJaxwsParas()) {
+                        if (outElement.equals(jwsp.getElementName())) {
+                            jp.setName(jwsp.getName());
+                        }
+                    }
+                }
+
                 addParameter(method, jp);
             }
         }

Modified: cxf/branches/2.1.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ServiceProcessor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ServiceProcessor.java?rev=834570&r1=834569&r2=834570&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ServiceProcessor.java
(original)
+++ cxf/branches/2.1.x-fixes/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/processor/internal/ServiceProcessor.java
Tue Nov 10 18:07:24 2009
@@ -315,8 +315,8 @@
 
         if (bopBinding != null && bopBinding.isEnableMime()) {
             enableOpMime = true;
-            if (bopBinding.getJaxwsPara() != null) {
-                jaxwsBinding.setJaxwsPara(bopBinding.getJaxwsPara());
+            if (bopBinding.getJaxwsParas() != null) {
+                jaxwsBinding.setJaxwsParas(bopBinding.getJaxwsParas());
             }
         }
         JavaInterface jf = null;

Modified: cxf/branches/2.1.x-fixes/tools/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/JAXWSDefinitionBuilderTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/tools/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/JAXWSDefinitionBuilderTest.java?rev=834570&r1=834569&r2=834570&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/tools/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/JAXWSDefinitionBuilderTest.java
(original)
+++ cxf/branches/2.1.x-fixes/tools/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/JAXWSDefinitionBuilderTest.java
Tue Nov 10 18:07:24 2009
@@ -82,11 +82,12 @@
         assertEquals("Customized method name does not parsered", "echoMeOneWay", binding.getMethodName());
 
 
-        assertEquals("Customized parameter element name does not parsered", "tns:number1",
binding
-            .getJaxwsPara().getElementName());
+        assertEquals("Customized parameter element name does not parsered", "number1", binding
+            .getJaxwsParas().get(0).getElementName().getLocalPart());
         assertEquals("Customized parameter message name does not parsered", "greetMeOneWayRequest",
binding
-            .getJaxwsPara().getMessageName());
-        assertEquals("customized parameter name does not parsered", "num1", binding.getJaxwsPara().getName());
+            .getJaxwsParas().get(0).getMessageName());
+        assertEquals("customized parameter name does not parsered", "num1",
+                     binding.getJaxwsParas().get(0).getName());
     }
 
 
@@ -129,11 +130,12 @@
         assertEquals("Customized method name does not parsered", "echoMeOneWay", binding.getMethodName());
 
 
-        assertEquals("Customized parameter element name does not parsered", "tns:number1",
binding
-            .getJaxwsPara().getElementName());
+        assertEquals("Customized parameter element name does not parsered", "number1", binding
+            .getJaxwsParas().get(0).getElementName().getLocalPart());
         assertEquals("Customized parameter message name does not parsered", "greetMeOneWayRequest",
binding
-            .getJaxwsPara().getMessageName());
-        assertEquals("customized parameter name does not parsered", "num1", binding.getJaxwsPara().getName());
+            .getJaxwsParas().get(0).getMessageName());
+        assertEquals("customized parameter name does not parsered", "num1",
+                     binding.getJaxwsParas().get(0).getName());
     }
 
     // tests the error case described in JIRA CXF-556



Mime
View raw message