cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r948292 - /cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/ServiceWSDLBuilder.java
Date Wed, 26 May 2010 02:15:07 GMT
Author: dkulp
Date: Wed May 26 02:15:07 2010
New Revision: 948292

URL: http://svn.apache.org/viewvc?rev=948292&view=rev
Log:
Fix failing tests by porting more stuff from 2.2

Modified:
    cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/ServiceWSDLBuilder.java

Modified: cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/ServiceWSDLBuilder.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/ServiceWSDLBuilder.java?rev=948292&r1=948291&r2=948292&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/ServiceWSDLBuilder.java
(original)
+++ cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/wsdl11/ServiceWSDLBuilder.java
Wed May 26 02:15:07 2010
@@ -48,6 +48,7 @@ import javax.wsdl.WSDLException;
 import javax.wsdl.extensions.AttributeExtensible;
 import javax.wsdl.extensions.ElementExtensible;
 import javax.wsdl.extensions.ExtensibilityElement;
+import javax.wsdl.extensions.UnknownExtensibilityElement;
 import javax.xml.namespace.QName;
 import javax.xml.parsers.ParserConfigurationException;
 
@@ -166,7 +167,7 @@ public class ServiceWSDLBuilder {
             ServiceInfo si = services.get(0);
             definition = newDefinition(si.getName(), si.getTargetNamespace());
             addNamespace(WSDLConstants.CONVENTIONAL_TNS_PREFIX, si.getTargetNamespace(),
definition);
-            addExtensibilityElements(definition, getWSDL11Extensors(si));
+            addExtensibilityElements(definition, getWSDL11Extensors(si.getDescription()));
 
             Collection<PortType> portTypes = new HashSet<PortType>();
             for (ServiceInfo service : services) {
@@ -217,6 +218,9 @@ public class ServiceWSDLBuilder {
      * @return the extensibility elements.
      */
     public List<ExtensibilityElement> getWSDL11Extensors(AbstractPropertiesHolder holder)
{
+        if (holder == null) {
+            return null;
+        }
         return holder.getExtensors(ExtensibilityElement.class);
     }
     
@@ -224,8 +228,14 @@ public class ServiceWSDLBuilder {
         List<ExtensibilityElement> extensibilityElements) {
         if (extensibilityElements != null) {
             for (ExtensibilityElement element : extensibilityElements) {
-                QName qn = element.getElementType();
-                addNamespace(qn.getNamespaceURI());
+                if (element instanceof UnknownExtensibilityElement) {
+                    UnknownExtensibilityElement uee = (UnknownExtensibilityElement)element;
+                    String pfx = uee.getElement().getPrefix();
+                    addNamespace(pfx, element.getElementType().getNamespaceURI());
+                } else {
+                    QName qn = element.getElementType();
+                    addNamespace(qn.getNamespaceURI());
+                }
                 elementExtensible.addExtensibilityElement(element);
             }
         }
@@ -405,6 +415,7 @@ public class ServiceWSDLBuilder {
         Service serv = definition.createService();
         serv.setQName(serviceInfo.getName());
         addNamespace(serviceInfo.getName().getNamespaceURI());
+        addExtensibilityElements(serv, getWSDL11Extensors(serviceInfo));
         definition.addService(serv);
 
         for (EndpointInfo ei : serviceInfo.getEndpoints()) {
@@ -429,6 +440,7 @@ public class ServiceWSDLBuilder {
             portType = def.createPortType();
             portType.setQName(intf.getName());
             addNamespace(intf.getName().getNamespaceURI(), def);
+            addExtensibilityElements(portType, getWSDL11Extensors(intf));
             addExtensibilityAttributes(portType, intf.getExtensionAttributes());
             portType.setUndefined(false);
             buildPortTypeOperation(portType, intf.getOperations(), def);
@@ -490,12 +502,13 @@ public class ServiceWSDLBuilder {
                 if (operationInfo.isOneWay()) {
                     operation.setStyle(OperationType.ONE_WAY);
                 }
-                this.addExtensibilityElements(operation, getWSDL11Extensors(operationInfo));
+                addExtensibilityElements(operation, getWSDL11Extensors(operationInfo));
                 Input input = def.createInput();
                 input.setName(operationInfo.getInputName());
                 Message message = def.createMessage();
                 buildMessage(message, operationInfo.getInput(), def);
                 this.addExtensibilityAttributes(input, getInputExtensionAttributes(operationInfo));
+                this.addExtensibilityElements(input, getWSDL11Extensors(operationInfo.getInput()));
                 input.setMessage(message);
                 operation.setInput(input);
                 operation.setParameterOrdering(operationInfo.getParameterOrdering());
@@ -506,6 +519,7 @@ public class ServiceWSDLBuilder {
                     message = def.createMessage();
                     buildMessage(message, operationInfo.getOutput(), def);
                     this.addExtensibilityAttributes(output, getOutputExtensionAttributes(operationInfo));
+                    this.addExtensibilityElements(output, getWSDL11Extensors(operationInfo.getOutput()));
                     output.setMessage(message);
                     operation.setOutput(output);
                 }
@@ -518,6 +532,7 @@ public class ServiceWSDLBuilder {
                     message = def.createMessage();
                     buildMessage(message, faultInfo, def);
                     this.addExtensibilityAttributes(fault, faultInfo.getExtensionAttributes());
+                    this.addExtensibilityElements(fault, getWSDL11Extensors(faultInfo));
                     fault.setMessage(message);
                     operation.addFault(fault);
                 }



Mime
View raw message