You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by ch...@apache.org on 2005/05/19 08:08:28 UTC

svn commit: r170879 - in /webservices/axis/trunk/java/modules: core/src/org/apache/axis/description/ wsdl/src/org/apache/axis/wsdl/builder/ wsdl/src/org/apache/axis/wsdl/builder/wsdl4j/ wsdl/src/org/apache/wsdl/ wsdl/src/org/apache/wsdl/impl/

Author: chathura
Date: Wed May 18 23:08:27 2005
New Revision: 170879

URL: http://svn.apache.org/viewcvs?rev=170879&view=rev
Log:
ExtensibleAttribute added to the Component class and the ExtensibilityElement moved to the Component class so that the functionality will be available to all the Component.

Added:
    webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/WSDLExtensibilityAttribute.java
    webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/impl/WSDLExtensibilityAttributeImpl.java
Removed:
    webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/ExtensibilityAttribute.java
    webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/impl/ExtensibilityAttributeImpl.java
Modified:
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/description/AxisDescWSDLComponentFactory.java
    webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/builder/WSDLComponentFactory.java
    webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/builder/wsdl4j/WSDLPump.java
    webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/Component.java
    webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/ExtensibleComponent.java
    webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/impl/ComponentImpl.java
    webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/impl/WSDLDescriptionImpl.java

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/description/AxisDescWSDLComponentFactory.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/description/AxisDescWSDLComponentFactory.java?rev=170879&r1=170878&r2=170879&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/description/AxisDescWSDLComponentFactory.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/description/AxisDescWSDLComponentFactory.java Wed May 18 23:08:27 2005
@@ -1,8 +1,38 @@
 package org.apache.axis.description;
 
 import org.apache.axis.wsdl.builder.WSDLComponentFactory;
-import org.apache.wsdl.*;
-import org.apache.wsdl.impl.*;
+import org.apache.wsdl.MessageReference;
+import org.apache.wsdl.WSDLBinding;
+import org.apache.wsdl.WSDLBindingMessageReference;
+import org.apache.wsdl.WSDLBindingOperation;
+import org.apache.wsdl.WSDLDescription;
+import org.apache.wsdl.WSDLEndpoint;
+import org.apache.wsdl.WSDLExtensibilityAttribute;
+import org.apache.wsdl.WSDLExtensibilityElement;
+import org.apache.wsdl.WSDLFault;
+import org.apache.wsdl.WSDLFeature;
+import org.apache.wsdl.WSDLImport;
+import org.apache.wsdl.WSDLInclude;
+import org.apache.wsdl.WSDLInterface;
+import org.apache.wsdl.WSDLOperation;
+import org.apache.wsdl.WSDLProperty;
+import org.apache.wsdl.WSDLService;
+import org.apache.wsdl.WSDLTypes;
+import org.apache.wsdl.impl.MessageReferenceImpl;
+import org.apache.wsdl.impl.WSDLBindingImpl;
+import org.apache.wsdl.impl.WSDLBindingMessageReferenceImpl;
+import org.apache.wsdl.impl.WSDLBindingOperationImpl;
+import org.apache.wsdl.impl.WSDLDescriptionImpl;
+import org.apache.wsdl.impl.WSDLEndpointImpl;
+import org.apache.wsdl.impl.WSDLExtensibilityAttributeImpl;
+import org.apache.wsdl.impl.WSDLExtensibilityElementImpl;
+import org.apache.wsdl.impl.WSDLFaultImpl;
+import org.apache.wsdl.impl.WSDLFeatureImpl;
+import org.apache.wsdl.impl.WSDLImportImpl;
+import org.apache.wsdl.impl.WSDLIncludeImpl;
+import org.apache.wsdl.impl.WSDLInterfaceImpl;
+import org.apache.wsdl.impl.WSDLPropertyImpl;
+import org.apache.wsdl.impl.WSDLTypesImpl;
 
 /**
  * @author chathura@opensource.lk
@@ -37,7 +67,7 @@
 
 	
 	public WSDLOperation createOperation() {
-		return new WSDLOperationImpl();
+		return new OperationDescription();
 	}
 
 	
@@ -84,6 +114,10 @@
 	
 	public WSDLExtensibilityElement createWSDLExtensibilityElement(){
 		return new WSDLExtensibilityElementImpl();
+	}
+	
+	public WSDLExtensibilityAttribute createWSDLExtensibilityAttribute(){
+		return new WSDLExtensibilityAttributeImpl();
 	}
 
 }

Modified: webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/builder/WSDLComponentFactory.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/builder/WSDLComponentFactory.java?rev=170879&r1=170878&r2=170879&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/builder/WSDLComponentFactory.java (original)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/builder/WSDLComponentFactory.java Wed May 18 23:08:27 2005
@@ -93,5 +93,12 @@
 	 * @return A new instance of <code>WSDLExtensibilityElement</code>
 	 */
 	public WSDLExtensibilityElement createWSDLExtensibilityElement();
+	
+	 
+	/**
+	 * 
+	 * @return A new instance of <code>WSDLExtensibilityAttribute</code>
+	 */
+	public WSDLExtensibilityAttribute createWSDLExtensibilityAttribute();
 
 }

Modified: webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/builder/wsdl4j/WSDLPump.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/builder/wsdl4j/WSDLPump.java?rev=170879&r1=170878&r2=170879&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/builder/wsdl4j/WSDLPump.java (original)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/axis/wsdl/builder/wsdl4j/WSDLPump.java Wed May 18 23:08:27 2005
@@ -15,15 +15,43 @@
  */
 package org.apache.axis.wsdl.builder.wsdl4j;
 
-import org.apache.axis.wsdl.builder.WSDLComponentFactory;
-import org.apache.wsdl.*;
-import org.apache.wsdl.impl.WSDLProcessingException;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
 
-import javax.wsdl.*;
+import javax.wsdl.Binding;
+import javax.wsdl.BindingInput;
+import javax.wsdl.BindingOperation;
+import javax.wsdl.BindingOutput;
+import javax.wsdl.Definition;
+import javax.wsdl.Input;
+import javax.wsdl.Operation;
+import javax.wsdl.Output;
+import javax.wsdl.Part;
+import javax.wsdl.Port;
+import javax.wsdl.PortType;
+import javax.wsdl.Service;
+import javax.wsdl.Types;
 import javax.wsdl.extensions.ExtensibilityElement;
 import javax.wsdl.extensions.UnknownExtensibilityElement;
 import javax.xml.namespace.QName;
-import java.util.Iterator;
+
+import org.apache.axis.wsdl.builder.WSDLComponentFactory;
+import org.apache.wsdl.Component;
+import org.apache.wsdl.MessageReference;
+import org.apache.wsdl.WSDLBinding;
+import org.apache.wsdl.WSDLBindingMessageReference;
+import org.apache.wsdl.WSDLBindingOperation;
+import org.apache.wsdl.WSDLConstants;
+import org.apache.wsdl.WSDLDescription;
+import org.apache.wsdl.WSDLEndpoint;
+import org.apache.wsdl.WSDLExtensibilityAttribute;
+import org.apache.wsdl.WSDLExtensibilityElement;
+import org.apache.wsdl.WSDLInterface;
+import org.apache.wsdl.WSDLOperation;
+import org.apache.wsdl.WSDLService;
+import org.apache.wsdl.WSDLTypes;
+import org.apache.wsdl.impl.WSDLProcessingException;
 
 /**
  * @author chathura@opensource.lk
@@ -350,37 +378,11 @@
 
 		wsdlEndpoint.setBinding(this.womDefinition.getBinding(wsdl4jPort
 				.getBinding().getQName()));
-		///Extesibility elements.
+//		this.copyExtensibilityAttribute(wsdl4jPort.getExtensionAttributes(), wsdlEndpoint);
+//		this.copyExtensibleElements(wsdl4jPort.getExtensibilityElements(), wsdlEndpoint);
 	}
 
-	//    ///////////////////////////Util Methods
-	// ////////////////////////////////////
-	//   
-	//    /**
-	//     * Will return the URI for the MEP. if null will retun the IN_OUT as
-	// default
-	//     * pattern.
-	//     */
-	//    private String getRelaventMEPForTheMessageStyle(OperationType
-	// operationType) {
-	//
-	//        if (null != operationType) {
-	//
-	//            if (operationType.equals(OperationType.REQUEST_RESPONSE))
-	//                return WSDLConstants.MEP_URI_IN_OUT;
-	//
-	//            if (operationType.equals(OperationType.ONE_WAY))
-	//                return WSDLConstants.MEP_URI_IN_ONLY;
-	//
-	//            if (operationType.equals(OperationType.NOTIFICATION))
-	//                return WSDLConstants.MEP_URI_OUT_ONLY;
-	//
-	//            if (operationType.equals(OperationType.SOLICIT_RESPONSE))
-	//                return WSDLConstants.MEP_URI_OUT_IN;
-	//        }
-	//        //TODO
-	//        return WSDLConstants.MEP_URI_OUT_IN;
-	//    }
+	
 
 	/**
 	 * This method will fill up the gap of WSDL 1.1 and WSDL 2.0 w.r.t. the
@@ -428,6 +430,47 @@
 					.addSuperInterface((WSDLInterface) interfaceIterator.next());
 		}
 		return newBoundInterface;
+	}
+	
+	/**
+	 * Get the Extensible elements form wsdl4jExtensibleElements <code>Vector</code>if any and
+	 * copy them to <code>Component</code>
+	 * @param wsdl4jExtensibleElements
+	 * @param womExtensibleElements
+	 */
+	private void copyExtensibleElements(List wsdl4jExtensibleElements, Component component){
+		Iterator iterator = wsdl4jExtensibleElements.iterator();
+		while(iterator.hasNext()){
+			Object obj = iterator.next();
+			if(obj instanceof UnknownExtensibilityElement){
+				UnknownExtensibilityElement temp = (UnknownExtensibilityElement)(obj);
+				WSDLExtensibilityElement extensibilityElement = this.wsdlComponenetFactory.createWSDLExtensibilityElement();
+				extensibilityElement.setElement(temp.getElement());
+				Boolean required = temp.getRequired();
+				if(null != required){
+					extensibilityElement.setRequired(required.booleanValue());
+				}
+				component.addExtensibilityElement(extensibilityElement);
+			}
+		}
+	}
+	
+	/**
+	 * Get the Extensible Attributes from wsdl4jExtensibilityAttribute <code>Map</code> if
+	 * any and copy them to the <code>Component</code>
+	 * @param wsdl4jExtensibilityAttributes
+	 * @param component
+	 */
+	private void copyExtensibilityAttribute(Map wsdl4jExtensibilityAttributes, Component component){
+		Iterator iterator = wsdl4jExtensibilityAttributes.keySet().iterator();
+		while(iterator.hasNext()){
+			QName attributeName = (QName)iterator.next();
+			QName value = (QName)wsdl4jExtensibilityAttributes.get(attributeName);
+			WSDLExtensibilityAttribute attribute = this.wsdlComponenetFactory.createWSDLExtensibilityAttribute();
+			attribute.setKey(attributeName);
+			attribute.setValue(value);
+			component.addExtensibleAttributes(attribute);
+		}
 	}
 
 }

Modified: webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/Component.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/Component.java?rev=170879&r1=170878&r2=170879&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/Component.java (original)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/Component.java Wed May 18 23:08:27 2005
@@ -16,6 +16,7 @@
 package org.apache.wsdl;
 
 import java.util.HashMap;
+import java.util.List;
 
 /**
  * @author chathura@opensource.lk
@@ -50,4 +51,29 @@
      * @return
      */
     public Object getComponentProperty(Object key);
+    
+    /**
+     * Adds the <code>WSDLExtensibilityElement</code> to the Extensible Component.
+     * @param element
+     */
+    public void addExtensibilityElement(WSDLExtensibilityElement element);
+    
+    /**
+     * Returns the Extensibility Elements of the Extensible component;
+     * @return List of <code>Element</code>s
+     */
+    public List getExtensibilityElements();
+    
+    /**
+	 * Returns a <code>List</code> of ExtensibleAttributes of this component.
+	 * @return  <code>List</code> 
+	 */
+	public List getExtensibilityAttributes() ;
+	
+	/**
+	 * Adds the <code>ExtensibilityAttribute</code> as a attrebute of this 
+	 * Component.
+	 * @param attribute <code>ExtensibilityAttribute</code>
+	 */
+	public void addExtensibleAttributes(WSDLExtensibilityAttribute attribute) ;
 }

Modified: webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/ExtensibleComponent.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/ExtensibleComponent.java?rev=170879&r1=170878&r2=170879&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/ExtensibleComponent.java (original)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/ExtensibleComponent.java Wed May 18 23:08:27 2005
@@ -15,8 +15,6 @@
  */
 package org.apache.wsdl;
 
-import org.w3c.dom.Element;
-
 import java.util.List;
 
 /**
@@ -55,16 +53,5 @@
      */
     public List getProperties();
     
-    
-    /**
-     * Adds the <code>Element</code> to the Extensible Component.
-     * @param element
-     */
-    public void addExtensibilityElement(Element element);
-    
-    /**
-     * Returns the Extensibility Elements of the Extensible component;
-     * @return List of <code>Element</code>s
-     */
-    public List getExtensibilityElements();
+        
 }

Added: webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/WSDLExtensibilityAttribute.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/WSDLExtensibilityAttribute.java?rev=170879&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/WSDLExtensibilityAttribute.java (added)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/WSDLExtensibilityAttribute.java Wed May 18 23:08:27 2005
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.wsdl;
+
+import javax.xml.namespace.QName;
+
+/**
+ * @author chathura@opensource.lk
+ *
+ */
+public interface WSDLExtensibilityAttribute {
+	
+	public abstract QName getKey();
+
+	public abstract QName getValue();
+	
+	public void setKey(QName key);
+	
+	public void setValue(QName value);
+}
\ No newline at end of file

Modified: webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/impl/ComponentImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/impl/ComponentImpl.java?rev=170879&r1=170878&r2=170879&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/impl/ComponentImpl.java (original)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/impl/ComponentImpl.java Wed May 18 23:08:27 2005
@@ -15,16 +15,16 @@
  */
 package org.apache.wsdl.impl;
 
-import org.apache.wsdl.Component;
-import org.apache.wsdl.ExtensibilityAttribute;
-import org.apache.wsdl.WSDLConstants;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
 import java.util.HashMap;
 import java.util.LinkedList;
 import java.util.List;
 
+import org.apache.wsdl.Component;
+import org.apache.wsdl.WSDLExtensibilityAttribute;
+import org.apache.wsdl.WSDLConstants;
+import org.apache.wsdl.WSDLExtensibilityElement;
+import org.w3c.dom.Document;
+
 /**
  * @author Chathura Herath
  */
@@ -120,7 +120,7 @@
 	 * 
 	 * @param element
 	 */
-	public void addExtensibilityElement(Element element) {
+	public void addExtensibilityElement(WSDLExtensibilityElement element) {
 		if (null == this.elements) {
 			this.elements = new LinkedList();
 		}
@@ -147,7 +147,7 @@
 	 * Component.
 	 * @param attribute <code>ExtensibilityAttribute</code>
 	 */
-	public void addExtensibleAttributes(ExtensibilityAttribute attribute) {
+	public void addExtensibleAttributes(WSDLExtensibilityAttribute attribute) {
 		if (null == this.attributes) {
 			this.attributes = new LinkedList();
 		}

Modified: webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/impl/WSDLDescriptionImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/impl/WSDLDescriptionImpl.java?rev=170879&r1=170878&r2=170879&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/impl/WSDLDescriptionImpl.java (original)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/impl/WSDLDescriptionImpl.java Wed May 18 23:08:27 2005
@@ -480,4 +480,8 @@
 		}
 		throw new WSDLProcessingException("No Binding Components are available");
 	}
+	
+	public WSDLExtensibilityAttribute createWSDLExtensibilityAttribute(){
+		return new WSDLExtensibilityAttributeImpl();
+	}
 }

Added: webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/impl/WSDLExtensibilityAttributeImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/impl/WSDLExtensibilityAttributeImpl.java?rev=170879&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/impl/WSDLExtensibilityAttributeImpl.java (added)
+++ webservices/axis/trunk/java/modules/wsdl/src/org/apache/wsdl/impl/WSDLExtensibilityAttributeImpl.java Wed May 18 23:08:27 2005
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.wsdl.impl;
+
+import javax.xml.namespace.QName;
+
+import org.apache.wsdl.WSDLExtensibilityAttribute;
+
+/**
+ * @author chathura@opensource.lk
+ *
+ */
+public class WSDLExtensibilityAttributeImpl implements WSDLExtensibilityAttribute {
+	
+	private QName key;
+	
+	private QName value;
+	
+	
+	
+	public WSDLExtensibilityAttributeImpl() {
+		
+	}
+	public QName getKey() {
+		return key;
+	}
+	public QName getValue() {
+		return value;
+	}
+	
+	
+	public void setKey(QName key) {
+		this.key = key;
+	}
+	public void setValue(QName value) {
+		this.value = value;
+	}
+}