[savara-commits] savara SVN: r318 - in trunk/tools: plugins/org.jboss.savara.pi4soa.cdm/src/java/org/jboss/savara/pi4soa/cdm/parser/rules and 2 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Thu Jul 8 09:22:49 EDT 2010


Author: objectiser
Date: 2010-07-08 09:22:47 -0400 (Thu, 08 Jul 2010)
New Revision: 318

Added:
   trunk/tools/plugins/org.jboss.savara.contract.model/src/java/org/jboss/savara/contract/model/Type.java
   trunk/tools/plugins/org.jboss.savara.contract.model/src/java/org/jboss/savara/contract/model/TypeDefinition.java
Modified:
   trunk/tools/plugins/org.jboss.savara.contract.model/src/java/org/jboss/savara/contract/model/Contract.java
   trunk/tools/plugins/org.jboss.savara.contract.model/src/java/org/jboss/savara/contract/model/FaultDetails.java
   trunk/tools/plugins/org.jboss.savara.contract.model/src/java/org/jboss/savara/contract/model/Interface.java
   trunk/tools/plugins/org.jboss.savara.contract.model/src/java/org/jboss/savara/contract/model/MessageExchangePattern.java
   trunk/tools/plugins/org.jboss.savara.contract.model/src/java/org/jboss/savara/contract/model/Namespace.java
   trunk/tools/plugins/org.jboss.savara.contract.model/src/java/org/jboss/savara/contract/model/RequestResponseMEP.java
   trunk/tools/plugins/org.jboss.savara.pi4soa.cdm/src/java/org/jboss/savara/pi4soa/cdm/parser/rules/ConversationConverterRuleImpl.java
   trunk/tools/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/generator/WSDLGenerator.java
   trunk/tools/tests/org.jboss.savara.tools.wsdl.tests/src/java/org/jboss/savara/tools/wsdl/tests/WSDLGeneratorTest.java
Log:
Add Type and TypeDefinition components to contract model, to explicitly model the type information. Updated the CDM and WSDL generation plugins to make use of these new model components.

Modified: trunk/tools/plugins/org.jboss.savara.contract.model/src/java/org/jboss/savara/contract/model/Contract.java
===================================================================
--- trunk/tools/plugins/org.jboss.savara.contract.model/src/java/org/jboss/savara/contract/model/Contract.java	2010-07-08 13:20:56 UTC (rev 317)
+++ trunk/tools/plugins/org.jboss.savara.contract.model/src/java/org/jboss/savara/contract/model/Contract.java	2010-07-08 13:22:47 UTC (rev 318)
@@ -22,6 +22,13 @@
  */
 public class Contract {
 	
+	private String m_name=null;
+	private String m_namespace=null;
+	private java.util.Set<Interface> m_interfaces=
+						new java.util.HashSet<Interface>();
+	private java.util.Set<Namespace> m_namespaces=
+			new java.util.HashSet<Namespace>();
+	
 	/**
 	 * The default constructor.
 	 */
@@ -108,11 +115,4 @@
 	public java.util.Set<Namespace> getNamespaces() {
 		return(m_namespaces);
 	}
-	
-	private String m_name=null;
-	private String m_namespace=null;
-	private java.util.Set<Interface> m_interfaces=
-						new java.util.HashSet<Interface>();
-	private java.util.Set<Namespace> m_namespaces=
-			new java.util.HashSet<Namespace>();
 }

Modified: trunk/tools/plugins/org.jboss.savara.contract.model/src/java/org/jboss/savara/contract/model/FaultDetails.java
===================================================================
--- trunk/tools/plugins/org.jboss.savara.contract.model/src/java/org/jboss/savara/contract/model/FaultDetails.java	2010-07-08 13:20:56 UTC (rev 317)
+++ trunk/tools/plugins/org.jboss.savara.contract.model/src/java/org/jboss/savara/contract/model/FaultDetails.java	2010-07-08 13:22:47 UTC (rev 318)
@@ -17,13 +17,16 @@
  */
 package org.jboss.savara.contract.model;
 
-import org.scribble.model.TypeReference;
-
 /**
  * This class represents the fault details.
  */
 public class FaultDetails {
 	
+	private String m_name=null;
+	private String m_namespace=null;
+	private java.util.List<Type> m_types=
+						new java.util.Vector<Type>();	
+	
 	/**
 	 * The default constructor.
 	 */
@@ -69,16 +72,11 @@
 	}
 	
 	/**
-	 * This method returns the list of type references.
+	 * This method returns the list of types.
 	 * 
-	 * @return The list of type references
+	 * @return The list of types
 	 */
-	public java.util.List<TypeReference> getTypes() {
+	public java.util.List<Type> getTypes() {
 		return(m_types);
 	}
-	
-	private String m_name=null;
-	private String m_namespace=null;
-	private java.util.List<TypeReference> m_types=
-						new java.util.Vector<TypeReference>();	
 }

Modified: trunk/tools/plugins/org.jboss.savara.contract.model/src/java/org/jboss/savara/contract/model/Interface.java
===================================================================
--- trunk/tools/plugins/org.jboss.savara.contract.model/src/java/org/jboss/savara/contract/model/Interface.java	2010-07-08 13:20:56 UTC (rev 317)
+++ trunk/tools/plugins/org.jboss.savara.contract.model/src/java/org/jboss/savara/contract/model/Interface.java	2010-07-08 13:22:47 UTC (rev 318)
@@ -22,6 +22,11 @@
  *
  */
 public class Interface {
+	
+	private String m_name=null;
+	private String m_namespace=null;
+	private java.util.List<MessageExchangePattern> m_messageExchangePatterns=
+			new java.util.Vector<MessageExchangePattern>();
 
 	/**
 	 * The default constructor.
@@ -75,9 +80,4 @@
 	public java.util.List<MessageExchangePattern> getMessageExchangePatterns() {
 		return(m_messageExchangePatterns);
 	}
-	
-	private String m_name=null;
-	private String m_namespace=null;
-	private java.util.List<MessageExchangePattern> m_messageExchangePatterns=
-			new java.util.Vector<MessageExchangePattern>();
 }

Modified: trunk/tools/plugins/org.jboss.savara.contract.model/src/java/org/jboss/savara/contract/model/MessageExchangePattern.java
===================================================================
--- trunk/tools/plugins/org.jboss.savara.contract.model/src/java/org/jboss/savara/contract/model/MessageExchangePattern.java	2010-07-08 13:20:56 UTC (rev 317)
+++ trunk/tools/plugins/org.jboss.savara.contract.model/src/java/org/jboss/savara/contract/model/MessageExchangePattern.java	2010-07-08 13:22:47 UTC (rev 318)
@@ -17,13 +17,15 @@
  */
 package org.jboss.savara.contract.model;
 
-import org.scribble.model.TypeReference;
-
 /**
  * This class represents the message exchange pattern.
  */
 public abstract class MessageExchangePattern {
 	
+	private String m_operation=null;
+	private java.util.List<Type> m_types=
+			new java.util.Vector<Type>();	
+	
 	/**
 	 * The default constructor.
 	 */
@@ -49,17 +51,13 @@
 	}
 	
 	/**
-	 * This method returns the list of type references. If
-	 * no operation is defined, then only one type reference
+	 * This method returns the list of types. If
+	 * no operation name is defined, then only one type
 	 * should be defined.
 	 * 
-	 * @return The list of type references
+	 * @return The list of types
 	 */
-	public java.util.List<TypeReference> getTypes() {
+	public java.util.List<Type> getTypes() {
 		return(m_types);
 	}
-	
-	private String m_operation=null;
-	private java.util.List<TypeReference> m_types=
-			new java.util.Vector<TypeReference>();	
 }

Modified: trunk/tools/plugins/org.jboss.savara.contract.model/src/java/org/jboss/savara/contract/model/Namespace.java
===================================================================
--- trunk/tools/plugins/org.jboss.savara.contract.model/src/java/org/jboss/savara/contract/model/Namespace.java	2010-07-08 13:20:56 UTC (rev 317)
+++ trunk/tools/plugins/org.jboss.savara.contract.model/src/java/org/jboss/savara/contract/model/Namespace.java	2010-07-08 13:22:47 UTC (rev 318)
@@ -22,6 +22,10 @@
  */
 public class Namespace {
 	
+	private String m_prefix=null;
+	private String m_uri=null;
+	private String m_schemaLocation=null;
+	
 	/**
 	 * The default constructor.
 	 */
@@ -84,8 +88,4 @@
 	public void setSchemaLocation(String schemaLocation) {
 		m_schemaLocation = schemaLocation;
 	}
-	
-	private String m_prefix=null;
-	private String m_uri=null;
-	private String m_schemaLocation=null;
 }

Modified: trunk/tools/plugins/org.jboss.savara.contract.model/src/java/org/jboss/savara/contract/model/RequestResponseMEP.java
===================================================================
--- trunk/tools/plugins/org.jboss.savara.contract.model/src/java/org/jboss/savara/contract/model/RequestResponseMEP.java	2010-07-08 13:20:56 UTC (rev 317)
+++ trunk/tools/plugins/org.jboss.savara.contract.model/src/java/org/jboss/savara/contract/model/RequestResponseMEP.java	2010-07-08 13:22:47 UTC (rev 318)
@@ -17,13 +17,16 @@
  */
 package org.jboss.savara.contract.model;
 
-import org.scribble.model.TypeReference;
-
 /**
  * This class represents the request response message exchange pattern.
  */
 public class RequestResponseMEP extends MessageExchangePattern {
 	
+	private java.util.List<Type> m_responseTypes=
+			new java.util.Vector<Type>();	
+	private java.util.List<FaultDetails> m_faultDetails=
+			new java.util.Vector<FaultDetails>();	
+	
 	/**
 	 * The default constructor.
 	 */
@@ -31,11 +34,11 @@
 	}
 	
 	/**
-	 * This method returns the list of response type references.
+	 * This method returns the list of response types.
 	 * 
-	 * @return The list of response type references
+	 * @return The list of response types
 	 */
-	public java.util.List<TypeReference> getResponseTypes() {
+	public java.util.List<Type> getResponseTypes() {
 		return(m_responseTypes);
 	}
 	
@@ -47,9 +50,4 @@
 	public java.util.List<FaultDetails> getFaultDetails() {
 		return(m_faultDetails);
 	}
-	
-	private java.util.List<TypeReference> m_responseTypes=
-			new java.util.Vector<TypeReference>();	
-	private java.util.List<FaultDetails> m_faultDetails=
-			new java.util.Vector<FaultDetails>();	
 }

Added: trunk/tools/plugins/org.jboss.savara.contract.model/src/java/org/jboss/savara/contract/model/Type.java
===================================================================
--- trunk/tools/plugins/org.jboss.savara.contract.model/src/java/org/jboss/savara/contract/model/Type.java	                        (rev 0)
+++ trunk/tools/plugins/org.jboss.savara.contract.model/src/java/org/jboss/savara/contract/model/Type.java	2010-07-08 13:22:47 UTC (rev 318)
@@ -0,0 +1,62 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ */
+package org.jboss.savara.contract.model;
+
+/**
+ * This class represents a type associated with information passed by the contract.
+ */
+public class Type {
+	
+	private String m_name=null;
+	private java.util.Set<TypeDefinition> m_typeDefinitions=
+		new java.util.HashSet<TypeDefinition>();
+	
+	/**
+	 * The default constructor.
+	 */
+	public Type() {
+	}
+	
+	/**
+	 * This method returns the name associated with the
+	 * type.
+	 * 
+	 * @return The name
+	 */
+	public String getName() {
+		return(m_name);
+	}
+	
+	/**
+	 * This method sets the name of the type.
+	 * 
+	 * @param name The name
+	 */
+	public void setName(String name) {
+		m_name = name;
+	}
+	
+	/**
+	 * This method returns the list of type definitions.
+	 * 
+	 * @return The list of type definitions
+	 */
+	public java.util.Set<TypeDefinition> getTypeDefinitions() {
+		return(m_typeDefinitions);
+	}
+}

Added: trunk/tools/plugins/org.jboss.savara.contract.model/src/java/org/jboss/savara/contract/model/TypeDefinition.java
===================================================================
--- trunk/tools/plugins/org.jboss.savara.contract.model/src/java/org/jboss/savara/contract/model/TypeDefinition.java	                        (rev 0)
+++ trunk/tools/plugins/org.jboss.savara.contract.model/src/java/org/jboss/savara/contract/model/TypeDefinition.java	2010-07-08 13:22:47 UTC (rev 318)
@@ -0,0 +1,95 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ */
+package org.jboss.savara.contract.model;
+
+/**
+ * This class represents a type definition within
+ */
+public class TypeDefinition {
+	
+	public static final String XSD_ELEMENT="##XSDElement";
+	public static final String XSD_TYPE="##XSDType";
+	
+	private String m_name=null;	
+	private String m_namespace=null;
+	private String m_typeSystem=null;
+	
+	/**
+	 * The default constructor.
+	 */
+	public TypeDefinition() {
+	}
+	
+	/**
+	 * This method returns the name associated with the
+	 * type.
+	 * 
+	 * @return The name
+	 */
+	public String getName() {
+		return(m_name);
+	}
+	
+	/**
+	 * This method returns the namespace associated with the
+	 * type definition.
+	 * 
+	 * @return The namespace
+	 */
+	public String getNamespace() {
+		return(m_namespace);
+	}
+	
+	/**
+	 * This method sets the namespace of the type definition.
+	 * 
+	 * @param namespace The namespace
+	 */
+	public void setNamespace(String namespace) {
+		m_namespace = namespace;
+	}
+	
+	/**
+	 * This method sets the name of the type.
+	 * 
+	 * @param name The name
+	 */
+	public void setName(String name) {
+		m_name = name;
+	}
+	
+	/**
+	 * This method returns the type system associated with the
+	 * type definition.
+	 * 
+	 * @return The type system
+	 */
+	public String getTypeSystem() {
+		return(m_typeSystem);
+	}
+	
+	/**
+	 * This method sets the type system associated with the
+	 * type definition.
+	 * 
+	 * @param typeSystem The type system
+	 */
+	public void setTypeSystem(String typeSystem) {
+		m_typeSystem = typeSystem;
+	}
+}

Modified: trunk/tools/plugins/org.jboss.savara.pi4soa.cdm/src/java/org/jboss/savara/pi4soa/cdm/parser/rules/ConversationConverterRuleImpl.java
===================================================================
--- trunk/tools/plugins/org.jboss.savara.pi4soa.cdm/src/java/org/jboss/savara/pi4soa/cdm/parser/rules/ConversationConverterRuleImpl.java	2010-07-08 13:20:56 UTC (rev 317)
+++ trunk/tools/plugins/org.jboss.savara.pi4soa.cdm/src/java/org/jboss/savara/pi4soa/cdm/parser/rules/ConversationConverterRuleImpl.java	2010-07-08 13:22:47 UTC (rev 318)
@@ -691,13 +691,13 @@
 		public void message(MessageDefinition defn) {
 			
 			if (defn.getClassification() == MessageDefinition.INPUT) {
-				m_currentMEP.getTypes().add(createTypeReference(defn));
+				m_currentMEP.getTypes().add(createType(defn));
 				
 			} else if (m_currentMEP instanceof RequestResponseMEP) {
 				RequestResponseMEP mep=(RequestResponseMEP)m_currentMEP;
 				
 				if (defn.getClassification() == MessageDefinition.OUTPUT) {
-					mep.getResponseTypes().add(createTypeReference(defn));
+					mep.getResponseTypes().add(createType(defn));
 					
 				} else if (defn.getClassification() == MessageDefinition.OUTFAULT) {
 					FaultDetails fault=new FaultDetails();
@@ -705,35 +705,39 @@
 					fault.setName(defn.getFaultName());
 					fault.setNamespace(defn.getFaultNamespace());
 					
-					fault.getTypes().add(createTypeReference(defn));
+					fault.getTypes().add(createType(defn));
 					
 					mep.getFaultDetails().add(fault);
 				}
 			}
 		}
 		
-		protected TypeReference createTypeReference(MessageDefinition defn) {
-			TypeReference ret=new TypeReference();
+		protected Type createType(MessageDefinition defn) {
+			Type ret=new Type();
+			TypeDefinition td=new TypeDefinition();
+			ret.getTypeDefinitions().add(td);
 			
 			if (defn.getElement() != null && defn.getElement().trim().length() > 0) {
-				ret.setLocalpart(defn.getElement());
+				td.setName(defn.getElement());
 				
 				if (defn.getElementNamespace() != null) {
-					ret.setNamespace(defn.getElementNamespace());
+					td.setNamespace(defn.getElementNamespace());
 				}
 				
-				ret.setProperty(TypeReference.TYPE_SYSTEM, TypeReference.TS_XSD_ELEMENT);
+				td.setTypeSystem(TypeDefinition.XSD_ELEMENT);
 
 			} else if (defn.getType() != null && defn.getType().trim().length() > 0) {
-				ret.setLocalpart(defn.getType());
+				td.setName(defn.getType());
 				
 				if (defn.getTypeNamespace() != null) {
-					ret.setNamespace(defn.getTypeNamespace());
+					td.setNamespace(defn.getTypeNamespace());
 				}
 				
-				ret.setProperty(TypeReference.TYPE_SYSTEM, TypeReference.TS_XSD_TYPE);
+				td.setTypeSystem(TypeDefinition.XSD_TYPE);
 			}
 			
+			ret.setName(td.getName());
+			
 			return(ret);
 		}
 

Modified: trunk/tools/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/generator/WSDLGenerator.java
===================================================================
--- trunk/tools/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/generator/WSDLGenerator.java	2010-07-08 13:20:56 UTC (rev 317)
+++ trunk/tools/plugins/org.jboss.savara.tools.wsdl/src/java/org/jboss/savara/tools/wsdl/generator/WSDLGenerator.java	2010-07-08 13:22:47 UTC (rev 318)
@@ -26,6 +26,8 @@
 import org.jboss.savara.contract.model.Interface;
 import org.jboss.savara.contract.model.Namespace;
 import org.jboss.savara.contract.model.RequestResponseMEP;
+import org.jboss.savara.contract.model.Type;
+import org.jboss.savara.contract.model.TypeDefinition;
 import org.scribble.model.TypeReference;
 
 /**
@@ -477,7 +479,7 @@
 	public javax.wsdl.Message getMessage(java.util.List<javax.wsdl.Definition> wsdls,
 						org.jboss.savara.contract.model.Contract contract,
 						javax.xml.namespace.QName msgname,
-						java.util.List<TypeReference> types,
+						java.util.List<org.jboss.savara.contract.model.Type> types,
 								WSDLBinding wsdlBinding) {
 		javax.wsdl.Message ret=null;
 		
@@ -486,32 +488,45 @@
 		} else if (types.size() > 1) {
 			throw new UnsupportedOperationException("Currently only supports single type reference");			
 		} else {
-			TypeReference ref=types.get(0);
-			javax.xml.namespace.QName qname=
-						new javax.xml.namespace.QName(ref.getNamespace(),ref.getLocalpart());
-			javax.wsdl.Definition defn=
-				getDefinition(wsdls, contract, msgname.getNamespaceURI(), wsdlBinding);
-					
-			if (defn != null && qname != null &&
-					(ret = defn.getMessage(msgname)) == null) {
-				ret = defn.createMessage();
-				ret.setUndefined(false);
+			Type ref=types.get(0);
+			
+			java.util.Iterator<TypeDefinition> iter=ref.getTypeDefinitions().iterator();
+			boolean f_done=false;
+			
+			while (f_done == false && iter.hasNext()) {
+				TypeDefinition td=iter.next();
 				
-				ret.setQName(msgname);
-				
-				// Create single part for type or element
-				Part part=defn.createPart();
-				part.setName("content");
-				
-				if (TypeReference.TS_XSD_ELEMENT.equals(ref.getProperty(TypeReference.TYPE_SYSTEM))) {
-					part.setElementName(qname);					
-				} else {
-					part.setTypeName(qname);
+				if (TypeDefinition.XSD_ELEMENT.equals(td.getTypeSystem()) ||
+						TypeDefinition.XSD_TYPE.equals(td.getTypeSystem())) {
+					javax.xml.namespace.QName qname=
+						new javax.xml.namespace.QName(td.getNamespace(),td.getName());
+					javax.wsdl.Definition defn=
+						getDefinition(wsdls, contract, msgname.getNamespaceURI(), wsdlBinding);
+							
+					if (defn != null && qname != null &&
+							(ret = defn.getMessage(msgname)) == null) {
+						ret = defn.createMessage();
+						ret.setUndefined(false);
+						
+						ret.setQName(msgname);
+						
+						// Create single part for type or element
+						Part part=defn.createPart();
+						part.setName("content");
+						
+						if (TypeDefinition.XSD_ELEMENT.equals(td.getTypeSystem())) {
+							part.setElementName(qname);					
+						} else {
+							part.setTypeName(qname);
+						}
+						
+						ret.addPart(part);
+						
+						defn.addMessage(ret);
+						
+						f_done = true;
+					}
 				}
-				
-				ret.addPart(part);
-				
-				defn.addMessage(ret);
 			}
 		}
 		

Modified: trunk/tools/tests/org.jboss.savara.tools.wsdl.tests/src/java/org/jboss/savara/tools/wsdl/tests/WSDLGeneratorTest.java
===================================================================
--- trunk/tools/tests/org.jboss.savara.tools.wsdl.tests/src/java/org/jboss/savara/tools/wsdl/tests/WSDLGeneratorTest.java	2010-07-08 13:20:56 UTC (rev 317)
+++ trunk/tools/tests/org.jboss.savara.tools.wsdl.tests/src/java/org/jboss/savara/tools/wsdl/tests/WSDLGeneratorTest.java	2010-07-08 13:22:47 UTC (rev 318)
@@ -22,7 +22,6 @@
 
 import org.jboss.savara.tools.wsdl.generator.WSDLGenerator;
 import org.jboss.savara.contract.model.*;
-import org.scribble.model.TypeReference;
 
 import junit.framework.TestCase;
 
@@ -164,10 +163,13 @@
 		
 		m1.setOperation(TEST_NAME);
 		
-		TypeReference ref1=new TypeReference();
-		ref1.setLocalpart(TEST_TYPE_LP);
+		Type tref1=new Type();
+		TypeDefinition ref1=new TypeDefinition();
+		tref1.getTypeDefinitions().add(ref1);
+		ref1.setName(TEST_TYPE_LP);
 		ref1.setNamespace(TEST_NAME_SPACE);
-		m1.getTypes().add(ref1);
+		ref1.setTypeSystem(TypeDefinition.XSD_TYPE);
+		m1.getTypes().add(tref1);
 		
 		i1.getMessageExchangePatterns().add(m1);
 		
@@ -179,10 +181,13 @@
 		
 		m2.setOperation(TEST_NAME);
 		
-		TypeReference ref2=new TypeReference();
-		ref2.setLocalpart(TEST_TYPE_LP);
+		Type tref2=new Type();
+		TypeDefinition ref2=new TypeDefinition();
+		tref2.getTypeDefinitions().add(ref1);
+		ref2.setName(TEST_TYPE_LP);
 		ref2.setNamespace(TEST_NAME_SPACE);
-		m2.getTypes().add(ref2);
+		ref2.setTypeSystem(TypeDefinition.XSD_TYPE);
+		m2.getTypes().add(tref2);
 		
 		i2.getMessageExchangePatterns().add(m2);
 		
@@ -194,10 +199,13 @@
 		
 		m3.setOperation(TEST_NAME);
 		
-		TypeReference ref3=new TypeReference();
-		ref3.setLocalpart(TEST_TYPE_LP);
+		Type tref3=new Type();
+		TypeDefinition ref3=new TypeDefinition();
+		tref3.getTypeDefinitions().add(ref1);
+		ref3.setName(TEST_TYPE_LP);
 		ref3.setNamespace(TEST_NAME_SPACE);
-		m3.getTypes().add(ref3);
+		ref3.setTypeSystem(TypeDefinition.XSD_TYPE);
+		m3.getTypes().add(tref3);
 		
 		i3.getMessageExchangePatterns().add(m3);
 		
@@ -244,10 +252,14 @@
 		
 		src.setOperation(TEST_NAME);
 		
-		TypeReference ref=new TypeReference();
-		ref.setLocalpart(TEST_TYPE_LP);
+		Type tref=new Type();
+		TypeDefinition ref=new TypeDefinition();
+		tref.getTypeDefinitions().add(ref);
+		ref.setName(TEST_TYPE_LP);
 		ref.setNamespace(TEST_TYPE_NS);
-		src.getTypes().add(ref);
+		ref.setTypeSystem(TypeDefinition.XSD_TYPE);
+		tref.setName(ref.getName());
+		src.getTypes().add(tref);
 		
 		WSDLGenerator gen=new WSDLGenerator();
 		
@@ -298,33 +310,45 @@
 		
 		src.setOperation(TEST_NAME);
 		
-		TypeReference ref1=new TypeReference();
-		ref1.setLocalpart(TEST_TYPE_LP);
+		Type tref1=new Type();
+		TypeDefinition ref1=new TypeDefinition();
+		tref1.getTypeDefinitions().add(ref1);
+		ref1.setName(TEST_TYPE_LP);
 		ref1.setNamespace(TEST_TYPE_NS);
-		src.getTypes().add(ref1);
+		ref1.setTypeSystem(TypeDefinition.XSD_TYPE);
+		src.getTypes().add(tref1);
 		
-		TypeReference ref2=new TypeReference();
-		ref2.setLocalpart(TEST_TYPE_LP);
+		Type tref2=new Type();
+		TypeDefinition ref2=new TypeDefinition();
+		tref2.getTypeDefinitions().add(ref2);
+		ref2.setName(TEST_TYPE_LP);
 		ref2.setNamespace(TEST_TYPE_NS);
-		src.getResponseTypes().add(ref2);
+		ref2.setTypeSystem(TypeDefinition.XSD_TYPE);
+		src.getResponseTypes().add(tref2);
 		
 		FaultDetails fd1=new FaultDetails();
 		fd1.setName("faultName1");
 
-		TypeReference ref3=new TypeReference();
-		ref3.setLocalpart(TEST_TYPE_LP);
+		Type tref3=new Type();
+		TypeDefinition ref3=new TypeDefinition();
+		tref3.getTypeDefinitions().add(ref3);
+		ref3.setName(TEST_TYPE_LP);
 		ref3.setNamespace(TEST_TYPE_NS);
-		fd1.getTypes().add(ref3);
+		ref3.setTypeSystem(TypeDefinition.XSD_TYPE);
+		fd1.getTypes().add(tref3);
 		
 		src.getFaultDetails().add(fd1);
 		
 		FaultDetails fd2=new FaultDetails();
 		fd2.setName("faultName2");
 
-		TypeReference ref4=new TypeReference();
-		ref4.setLocalpart(TEST_TYPE_LP);
+		Type tref4=new Type();
+		TypeDefinition ref4=new TypeDefinition();
+		tref4.getTypeDefinitions().add(ref4);
+		ref4.setName(TEST_TYPE_LP);
 		ref4.setNamespace(TEST_TYPE_NS);
-		fd2.getTypes().add(ref4);
+		ref4.setTypeSystem(TypeDefinition.XSD_TYPE);
+		fd2.getTypes().add(tref4);
 		
 		src.getFaultDetails().add(fd2);
 		
@@ -374,13 +398,17 @@
 			fail("Failed to get definition");
 		}
 		
-		TypeReference src=new TypeReference();
-		src.setLocalpart(TEST_TYPE_LP);
+		TypeDefinition src=new TypeDefinition();
+		src.setName(TEST_TYPE_LP);
 		src.setNamespace(TEST_TYPE_NS);
+		src.setTypeSystem(TypeDefinition.XSD_TYPE);
 		
-		java.util.List<TypeReference> refs=new java.util.Vector<TypeReference>();
-		refs.add(src);
+		Type t=new Type();
+		t.getTypeDefinitions().add(src);
 		
+		java.util.List<Type> refs=new java.util.Vector<Type>();
+		refs.add(t);
+		
 		WSDLGenerator gen=new WSDLGenerator();
 		
 		java.util.List<javax.wsdl.Definition> defns=new java.util.Vector<javax.wsdl.Definition>();
@@ -451,10 +479,13 @@
 		
 		m1.setOperation(TEST_NAME);
 		
-		TypeReference ref1=new TypeReference();
-		ref1.setLocalpart(TEST_TYPE_LP);
+		Type tref1=new Type();
+		TypeDefinition ref1=new TypeDefinition();
+		tref1.getTypeDefinitions().add(ref1);
+		ref1.setName(TEST_TYPE_LP);
 		ref1.setNamespace(TEST_NAME_SPACE);
-		m1.getTypes().add(ref1);
+		ref1.setTypeSystem(TypeDefinition.XSD_TYPE);
+		m1.getTypes().add(tref1);
 		
 		i1.getMessageExchangePatterns().add(m1);
 		
@@ -466,10 +497,13 @@
 		
 		m2.setOperation(TEST_NAME);
 		
-		TypeReference ref2=new TypeReference();
-		ref2.setLocalpart(TEST_TYPE_LP);
+		Type tref2=new Type();
+		TypeDefinition ref2=new TypeDefinition();
+		tref2.getTypeDefinitions().add(ref2);
+		ref2.setName(TEST_TYPE_LP);
 		ref2.setNamespace(TEST_NAME_SPACE2);
-		m2.getTypes().add(ref2);
+		ref2.setTypeSystem(TypeDefinition.XSD_TYPE);
+		m2.getTypes().add(tref2);
 		
 		i2.getMessageExchangePatterns().add(m2);
 		
@@ -481,10 +515,13 @@
 		
 		m3.setOperation(TEST_NAME);
 		
-		TypeReference ref3=new TypeReference();
-		ref3.setLocalpart(TEST_TYPE_LP);
+		Type tref3=new Type();
+		TypeDefinition ref3=new TypeDefinition();
+		tref3.getTypeDefinitions().add(ref3);
+		ref3.setName(TEST_TYPE_LP);
 		ref3.setNamespace(TEST_NAME_SPACE3);
-		m3.getTypes().add(ref3);
+		ref3.setTypeSystem(TypeDefinition.XSD_TYPE);
+		m3.getTypes().add(tref3);
 		
 		i3.getMessageExchangePatterns().add(m3);
 		



More information about the savara-commits mailing list