You are viewing a plain text version of this content. The canonical link for it is here.
Posted to woden-dev@ws.apache.org by ry...@apache.org on 2006/06/11 02:18:26 UTC

svn commit: r413389 - in /incubator/woden/java: ./ ant-test/test-suite-results.zip src/org/apache/woden/ant/WsdlCm.java

Author: ryman
Date: Sat Jun 10 17:18:25 2006
New Revision: 413389

URL: http://svn.apache.org/viewvc?rev=413389&view=rev
Log:
[WODEN-30] Updated interchange format to latest schema.

Modified:
    incubator/woden/java/   (props changed)
    incubator/woden/java/ant-test/test-suite-results.zip
    incubator/woden/java/src/org/apache/woden/ant/WsdlCm.java

Propchange: incubator/woden/java/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Sat Jun 10 17:18:25 2006
@@ -5,3 +5,4 @@
 getBalance.wsdlcm
 out.wsdlcm
 .settings
+woden-1.0.0M4-test-results.html

Modified: incubator/woden/java/ant-test/test-suite-results.zip
URL: http://svn.apache.org/viewvc/incubator/woden/java/ant-test/test-suite-results.zip?rev=413389&r1=413388&r2=413389&view=diff
==============================================================================
Binary files - no diff available.

Modified: incubator/woden/java/src/org/apache/woden/ant/WsdlCm.java
URL: http://svn.apache.org/viewvc/incubator/woden/java/src/org/apache/woden/ant/WsdlCm.java?rev=413389&r1=413388&r2=413389&view=diff
==============================================================================
--- incubator/woden/java/src/org/apache/woden/ant/WsdlCm.java (original)
+++ incubator/woden/java/src/org/apache/woden/ant/WsdlCm.java Sat Jun 10 17:18:25 2006
@@ -22,13 +22,11 @@
  * instances in a canonical way so that different implementations can be easily
  * compared for interoperability.
  * 
- * The schema for this format is available at the following URL:
+ * The latest schema for this format is available at the following URL:
  * 
- * http://dev.w3.org/cvsweb/~checkout~/2002/ws/desc/test-suite/interchange/wsdlcm.xsd?rev=1.1&content-type=text/xml
+ * http://dev.w3.org/cvsweb/~checkout~/2002/ws/desc/test-suite/interchange/wsdlcm.xsd?content-type=text/xml
  * 
  * @author Arthur Ryman (ryman@ca.ibm.com, arthur-ryman@gmail.com)
- * 
- * TODO: test whttp extension
  */
 
 import java.io.File;
@@ -87,1451 +85,1421 @@
 import org.apache.woden.wsdl20.extensions.soap.SOAPModule;
 import org.apache.woden.wsdl20.xml.DescriptionElement;
 
+/**
+ * <code>WsdlCm</code> writes the component model in the W3C interchange format.
+ * 
+ * @author Arthur Ryman (ryman@ca.ibm.com, arthur-ryman@gmail.com)
+ *
+ */
 public class WsdlCm {
 
-	private PrintWriter out;
-
-	private int indentation = 2;
-
-	private Stack tags = new Stack();
-
-	/** WSDL CM namespaces */
-	private static String WSDLCM_NS = "http://www.w3.org/2002/ws/desc/wsdl/component";
-
-	private static String WSDLCMBASE_PREFIX = "cmbase";
-
-	private static String WSDLCMBASE_NS = "http://www.w3.org/2002/ws/desc/wsdl/component-base";
-
-	private static String WSDLCMEXTENSIONS_PREFIX = "cmextensions";
-
-	private static String WSDLCMEXTENSIONS_NS = "http://www.w3.org/2002/ws/desc/wsdl/component-extensions";
-
-	private static String WSDLCMHTTP_PREFIX = "cmhttp";
-
-	private static String WSDLCMHTTP_NS = "http://www.w3.org/2002/ws/desc/wsdl/component-http";
-
-	private static String WSDLCMRPC_PREFIX = "cmrpc";
-
-	private static String WSDLCMRPC_NS = "http://www.w3.org/2002/ws/desc/wsdl/component-rpc";
-
-	private static String WSDLCMSOAP_PREFIX = "cmsoap";
-
-	private static String WSDLCMSOAP_NS = "http://www.w3.org/2002/ws/desc/wsdl/component-soap";
-
-	/** XML Schema namespace */
-	private static String XSD_NS = "http://www.w3.org/2001/XMLSchema";
-
-	/** build-in simple types */
-	private static String[] XSD_TYPES = { "string", "boolean", "decimal",
-			"float", "double", "duration", "dateTime", "time", "date",
-			"gYearMonth", "gYear", "gMonthDay", "gDay", "gMonth", "hexBinary",
-			"base64Binary", "anyURI", "QName", "NOTATION", "normalizedString",
-			"token", "language", "NMTOKEN", "NMTOKENS", "Name", "NCName", "ID",
-			"IDREF", "IDREFS", "ENTITY", "ENTITIES", "integer",
-			"nonPositiveInteger", "negativeInteger", "long", "int", "short",
-			"byte", "nonNegativeInteger", "unsignedLong", "unsignedInt",
-			"unsignedShort", "unsignedByte", "positiveInteger" };
-
-	{
-		Arrays.sort(XSD_TYPES);
-	}
-
-	public WsdlCm(PrintWriter out) {
-
-		this.out = out;
-	}
-
-	private void indent() {
-
-		for (int i = 0; i < tags.size(); i++) {
-			for (int j = 0; j < indentation; j++) {
-				out.write(' ');
-			}
-		}
-	}
-
-	private void beginElement(String tag) {
-
-		beginElement(tag, "");
-	}
-
-	private void beginElement(String tag, String attributes) {
-
-		indent();
-		if (attributes.length() == 0) {
-			out.println("<" + tag + ">");
-
-		} else {
-			out.println("<" + tag + " " + attributes + ">");
-		}
-		tags.push(tag);
-	}
-
-	private void endElement() {
-
-		String tag = (String) tags.pop();
-		indent();
-		out.println("</" + tag + ">");
-	}
-
-	private void element(String tag, String content) {
-
-		indent();
-		out.println("<" + tag + ">" + escape(content) + "</" + tag + ">");
-	}
-
-	private static String escape(String x) {
-
-		if (x == null)
-			return null;
-
-		StringBuffer y = new StringBuffer();
-
-		for (int i = 0; i < x.length(); i++) {
-
-			char c = x.charAt(i);
-			switch (c) {
-			case '&':
-				y.append("&amp;");
-				break;
-
-			case '<':
-				y.append("&lt;");
-				break;
-
-			case '>':
-				y.append("&gt;");
-				break;
-
-			case '"':
-				y.append("&quot;");
-				break;
-
-			case '\'':
-				y.append("&apos;");
-				break;
-
-			default:
-				y.append(c);
-			}
-		}
+    private PrintWriter out;
 
-		return y.toString();
-	}
+    private int indentation = 2;
 
-	private void emptyElement(String tag, String attributes) {
+    private Stack tags = new Stack();
 
-		indent();
-		out.println("<" + tag + " " + attributes + "/>");
-	}
+    /** WSDL CM namespaces */
+    private static String WSDLCM_NS = "http://www.w3.org/2002/ws/desc/wsdl/component";
 
-	public static void main(String[] args) {
+    private static String WSDLCMBASE_PREFIX = "cmbase";
 
-		// simple program to read a WSDL 2.0 file and then poke at the component
-		// model.
+    private static String WSDLCMBASE_NS = "http://www.w3.org/2002/ws/desc/wsdl/component-base";
 
-		String wsdlLoc = "file:///D:/workspaces/Woden/woden-java/ant-test/test.wsdl";
-		String wsdlCmLoc = "D:\\workspaces\\Woden\\woden-java\\ant-test\\test.xml";
+    private static String WSDLCMEXTENSIONS_PREFIX = "cmextensions";
 
-		if (args.length == 2) {
-			wsdlLoc = args[0];
-			wsdlCmLoc = args[1];
-		}
+    private static String WSDLCMEXTENSIONS_NS = "http://www.w3.org/2002/ws/desc/wsdl/component-extensions";
 
-		System.out.println("Starting: " + wsdlLoc);
+    private static String WSDLCMHTTP_PREFIX = "cmhttp";
 
-		try {
+    private static String WSDLCMHTTP_NS = "http://www.w3.org/2002/ws/desc/wsdl/component-http";
 
-			WSDLFactory factory = WSDLFactory.newInstance();
-			WSDLReader reader = factory.newWSDLReader();
+    private static String WSDLCMRPC_PREFIX = "cmrpc";
 
-			// <-- enable WSDL 2.0 validation (optional)
-			reader.setFeature(WSDLReader.FEATURE_VALIDATION, true);
+    private static String WSDLCMRPC_NS = "http://www.w3.org/2002/ws/desc/wsdl/component-rpc";
 
-			// <-- the <description> element
-			DescriptionElement desc = reader.readWSDL(wsdlLoc);
+    private static String WSDLCMSOAP_PREFIX = "cmsoap";
 
-			// <-- the Description component
-			Description descComp = desc.toComponent();
+    private static String WSDLCMSOAP_NS = "http://www.w3.org/2002/ws/desc/wsdl/component-soap";
 
-			File xml = new File(wsdlCmLoc);
-			FileOutputStream fos = new FileOutputStream(xml);
-			PrintWriter out = new PrintWriter(fos);
-			WsdlCm wsdlCm = new WsdlCm(out);
+    /** XML Schema namespace */
+    private static String XSD_NS = "http://www.w3.org/2001/XMLSchema";
 
-			wsdlCm.write(descComp);
+    /** build-in simple types */
+    private static String[] XSD_TYPES = { "string", "boolean", "decimal",
+            "float", "double", "duration", "dateTime", "time", "date",
+            "gYearMonth", "gYear", "gMonthDay", "gDay", "gMonth", "hexBinary",
+            "base64Binary", "anyURI", "QName", "NOTATION", "normalizedString",
+            "token", "language", "NMTOKEN", "NMTOKENS", "Name", "NCName", "ID",
+            "IDREF", "IDREFS", "ENTITY", "ENTITIES", "integer",
+            "nonPositiveInteger", "negativeInteger", "long", "int", "short",
+            "byte", "nonNegativeInteger", "unsignedLong", "unsignedInt",
+            "unsignedShort", "unsignedByte", "positiveInteger" };
 
-			out.flush();
+    {
+        Arrays.sort(XSD_TYPES);
+    }
 
-		} catch (WSDLException e) {
+    private static String PARENT = WSDLCMBASE_PREFIX + ":parent";
 
-			e.printStackTrace();
-		} catch (FileNotFoundException e) {
+    private static String FEATURES = WSDLCMBASE_PREFIX + ":features";
 
-			e.printStackTrace();
-		}
+    private static String PROPERTIES = WSDLCMBASE_PREFIX + ":properties";
 
-		System.out.println("Finished.");
+    /**
+     * Constructs a component model writer.
+     * 
+     * @param out the output writer for the component model
+     */
+    public WsdlCm(PrintWriter out) {
 
-	}
+        this.out = out;
+    }
 
-	public void write(Description component) {
+    private void indent() {
 
-		out.println("<?xml version='1.0' encoding='UTF-8'?>");
+        for (int i = 0; i < tags.size(); i++) {
+            for (int j = 0; j < indentation; j++) {
+                out.write(' ');
+            }
+        }
+    }
 
-		String attributes = "xmlns='" + WSDLCM_NS + "'\n";
-		attributes += " xmlns:" + WSDLCMEXTENSIONS_PREFIX + "='"
-				+ WSDLCMEXTENSIONS_NS + "'\n";
-		attributes += " xmlns:" + WSDLCMBASE_PREFIX + "='" + WSDLCMBASE_NS
-				+ "'\n";
-		attributes += " xmlns:" + WSDLCMHTTP_PREFIX + "='" + WSDLCMHTTP_NS
-				+ "'\n";
-		attributes += " xmlns:" + WSDLCMRPC_PREFIX + "='" + WSDLCMRPC_NS
-				+ "'\n";
-		attributes += " xmlns:" + WSDLCMSOAP_PREFIX + "='" + WSDLCMSOAP_NS
-				+ "'\n";
-		attributes += idAttribute(component);
-		beginElement("descriptionComponent", attributes);
+    private void beginElement(String tag) {
 
-		write("interfaces", component.getInterfaces());
-		write("bindings", component.getBindings());
-		write("services", component.getServices());
-		write("elementDeclarations", component.getElementDeclarations());
-		write("typeDefinitions", component.getTypeDefinitions());
+        beginElement(tag, "");
+    }
 
-		endElement();
-	}
+    private void beginElement(String tag, String attributes) {
 
-	private void writeRefs(String tag, Interface[] components) {
+        indent();
+        if (attributes.length() == 0) {
+            out.println("<" + tag + ">");
 
-		if (components.length == 0)
-			return;
+        } else {
+            out.println("<" + tag + " " + attributes + ">");
+        }
+        tags.push(tag);
+    }
 
-		Arrays.sort(components, new Comparator() {
+    private void endElement() {
 
-			public int compare(Object o1, Object o2) {
-				QName x1 = ((Interface) o1).getName();
-				QName x2 = ((Interface) o2).getName();
-				return compareQName(x1, x2);
-			}
-		});
+        String tag = (String) tags.pop();
+        indent();
+        out.println("</" + tag + ">");
+    }
 
-		beginElement(tag);
+    private void element(String tag, String content) {
 
-		for (int i = 0; i < components.length; i++) {
-			writeRef("interface", components[i]);
-		}
+        indent();
+        out.println("<" + tag + ">" + escape(content) + "</" + tag + ">");
+    }
 
-		endElement();
+    private static String escape(String x) {
 
-	}
+        if (x == null)
+            return null;
 
-	private void write(String tag, Interface[] components) {
+        StringBuffer y = new StringBuffer();
 
-		if (components.length == 0)
-			return;
+        for (int i = 0; i < x.length(); i++) {
 
-		Arrays.sort(components, new Comparator() {
+            char c = x.charAt(i);
+            switch (c) {
+            case '&':
+                y.append("&amp;");
+                break;
 
-			public int compare(Object o1, Object o2) {
-				QName x1 = ((Interface) o1).getName();
-				QName x2 = ((Interface) o2).getName();
-				return compareQName(x1, x2);
-			}
-		});
+            case '<':
+                y.append("&lt;");
+                break;
 
-		beginElement(tag);
+            case '>':
+                y.append("&gt;");
+                break;
 
-		for (int i = 0; i < components.length; i++)
-			write("interfaceComponent", components[i]);
+            case '"':
+                y.append("&quot;");
+                break;
 
-		endElement();
-	}
+            case '\'':
+                y.append("&apos;");
+                break;
 
-	private void write(String tag, Interface component) {
+            default:
+                y.append(c);
+            }
+        }
 
-		beginElement(tag, idAttribute(component));
+        return y.toString();
+    }
 
-		write("name", component.getName());
-		writeRefs("extendedInterfaces", component.getExtendedInterfaces());
-		write("interfaceFaults", component.getInterfaceFaults());
-		write("interfaceOperations", component.getInterfaceOperations());
-		write("features", component.getFeatures());
-		write("properties", component.getProperties());
+    private void emptyElement(String tag, String attributes) {
 
-		endElement();
-	}
+        indent();
+        out.println("<" + tag + " " + attributes + "/>");
+    }
 
-	private void write(String tag, InterfaceFault[] components) {
+    /**
+     * Tests the component model interchange format writer.
+     * 
+     * @param args the command line arguments
+     */
+    public static void main(String[] args) {
 
-		if (components.length == 0)
-			return;
+        // simple program to read a WSDL 2.0 file and then poke at the component
+        // model.
 
-		Arrays.sort(components, new Comparator() {
+        String wsdlLoc = "file:///D:/workspaces/Woden/woden-java/ant-test/test.wsdl";
+        String wsdlCmLoc = "D:\\workspaces\\Woden\\woden-java\\ant-test\\test.xml";
 
-			public int compare(Object o1, Object o2) {
-				QName x1 = ((InterfaceFault) o1).getName();
-				QName x2 = ((InterfaceFault) o2).getName();
-				return compareQName(x1, x2);
-			}
-		});
+        if (args.length == 2) {
+            wsdlLoc = args[0];
+            wsdlCmLoc = args[1];
+        }
 
-		beginElement(tag);
+        System.out.println("Starting: " + wsdlLoc);
 
-		for (int i = 0; i < components.length; i++)
-			write("interfaceFaultComponent", components[i]);
+        try {
 
-		endElement();
-	}
+            WSDLFactory factory = WSDLFactory.newInstance();
+            WSDLReader reader = factory.newWSDLReader();
 
-	private void write(String tag, InterfaceFault component) {
+            // <-- enable WSDL 2.0 validation (optional)
+            reader.setFeature(WSDLReader.FEATURE_VALIDATION, true);
 
-		beginElement("interfaceFaultComponent", idAttribute(component));
+            // <-- the <description> element
+            DescriptionElement desc = reader.readWSDL(wsdlLoc);
 
-		write("name", component.getName());
-		writeOptionalRef("elementDeclaration", component
-				.getElementDeclaration());
-		write("features", component.getFeatures());
-		write("properties", component.getProperties());
-		writeRef("parent", component.getParent());
+            // <-- the Description component
+            Description descComp = desc.toComponent();
 
-		endElement();
-	}
+            File xml = new File(wsdlCmLoc);
+            FileOutputStream fos = new FileOutputStream(xml);
+            PrintWriter out = new PrintWriter(fos);
+            WsdlCm wsdlCm = new WsdlCm(out);
 
-	private void write(String tag, InterfaceOperation[] components) {
+            wsdlCm.write(descComp);
 
-		if (components.length == 0)
-			return;
+            out.flush();
 
-		Arrays.sort(components, new Comparator() {
+        } catch (WSDLException e) {
 
-			public int compare(Object o1, Object o2) {
-				QName x1 = ((InterfaceOperation) o1).getName();
-				QName x2 = ((InterfaceOperation) o2).getName();
-				return compareQName(x1, x2);
-			}
-		});
+            e.printStackTrace();
+        } catch (FileNotFoundException e) {
 
-		beginElement(tag);
+            e.printStackTrace();
+        }
 
-		for (int i = 0; i < components.length; i++)
-			write("interfaceOperationComponent", components[i]);
+        System.out.println("Finished.");
 
-		endElement();
-	}
+    }
 
-	private void write(String tag, InterfaceOperation component) {
+    /**
+     * Writes the component model.
+     * 
+     * @param component the root Description component
+     */
+    public void write(Description component) {
 
-		beginElement("interfaceOperationComponent", idAttribute(component));
+        out.println("<?xml version='1.0' encoding='UTF-8'?>");
 
-		write("name", component.getName());
-		write("messageExchangePattern", component.getMessageExchangePattern());
-		write("interfaceMessageReferences", component
-				.getInterfaceMessageReferences());
-		write("interfaceFaultReferences", component
-				.getInterfaceFaultReferences());
-		writeStyleUris("style", component.getStyle());
-		write("features", component.getFeatures());
-		write("properties", component.getProperties());
-		writeRef("parent", component.getParent());
+        String attributes = "xmlns='" + WSDLCM_NS + "'\n";
+        attributes += " xmlns:" + WSDLCMEXTENSIONS_PREFIX + "='"
+                + WSDLCMEXTENSIONS_NS + "'\n";
+        attributes += " xmlns:" + WSDLCMBASE_PREFIX + "='" + WSDLCMBASE_NS
+                + "'\n";
+        attributes += " xmlns:" + WSDLCMHTTP_PREFIX + "='" + WSDLCMHTTP_NS
+                + "'\n";
+        attributes += " xmlns:" + WSDLCMRPC_PREFIX + "='" + WSDLCMRPC_NS
+                + "'\n";
+        attributes += " xmlns:" + WSDLCMSOAP_PREFIX + "='" + WSDLCMSOAP_NS
+                + "'\n";
+        attributes += idAttribute(component);
+        beginElement("descriptionComponent", attributes);
 
-		// <!-- Extensions -->
-		// <xs:element ref="cmextensions:safety" minOccurs="0" />
+        URI[] extensions = { ComponentExtensions.URI_NS_EXTENSIONS,
+                ComponentExtensions.URI_NS_HTTP,
+                ComponentExtensions.URI_NS_RPC, ComponentExtensions.URI_NS_SOAP };
 
-		InterfaceOperationExtensions extensions = (InterfaceOperationExtensions) component
-				.getComponentExtensionsForNamespace(ComponentExtensions.URI_NS_EXTENSIONS);
-		if (extensions != null) {
-			write(WSDLCMEXTENSIONS_PREFIX + ":safety", extensions.isSafety());
-		}
+        writeUris("extensions", extensions);
+        write("interfaces", component.getInterfaces());
+        write("bindings", component.getBindings());
+        write("services", component.getServices());
+        write("elementDeclarations", component.getElementDeclarations());
+        write("typeDefinitions", component.getTypeDefinitions());
 
-		// <!-- RPC Extension -->
-		// <xs:element ref="cmrpc:rpcSignature" minOccurs="0" />
+        endElement();
+    }
 
-		RPCInterfaceOperationExtensions rpcExtensions = (RPCInterfaceOperationExtensions) component
-				.getComponentExtensionsForNamespace(ComponentExtensions.URI_NS_RPC);
-		if (rpcExtensions != null) {
-			write(WSDLCMRPC_PREFIX + ":rpcSignature", rpcExtensions
-					.getRPCSignature());
-		}
+    private void writeRefs(String tag, Interface[] components) {
 
-		endElement();
-	}
+        if (components.length == 0)
+            return;
 
-	private void write(String tag, Argument[] rpcSignature) {
+        Arrays.sort(components, new Comparator() {
 
-		beginElement(tag);
-		for (int i = 0; i < rpcSignature.length; i++) {
+            public int compare(Object o1, Object o2) {
+                QName x1 = ((Interface) o1).getName();
+                QName x2 = ((Interface) o2).getName();
+                return compareQName(x1, x2);
+            }
+        });
 
-			write(WSDLCMRPC_PREFIX + ":argument", rpcSignature[i]);
-		}
-		endElement();
-	}
+        beginElement(tag);
 
-	private void write(String tag, Argument argument) {
+        for (int i = 0; i < components.length; i++) {
+            writeRef("interface", components[i]);
+        }
 
-		beginElement(tag);
+        endElement();
 
-		write(WSDLCMRPC_PREFIX + ":name", argument.getName());
-		write(WSDLCMRPC_PREFIX + ":direction", argument.getDirection()
-				.toString());
+    }
 
-		endElement();
-	}
+    private void write(String tag, Interface[] components) {
 
-	private void write(String tag, InterfaceMessageReference[] components) {
+        if (components.length == 0)
+            return;
 
-		if (components.length == 0)
-			return;
+        Arrays.sort(components, new Comparator() {
 
-		Arrays.sort(components, new Comparator() {
+            public int compare(Object o1, Object o2) {
+                QName x1 = ((Interface) o1).getName();
+                QName x2 = ((Interface) o2).getName();
+                return compareQName(x1, x2);
+            }
+        });
 
-			public int compare(Object o1, Object o2) {
-				String x1 = ((InterfaceMessageReference) o1).getMessageLabel()
-						.toString();
-				String x2 = ((InterfaceMessageReference) o2).getMessageLabel()
-						.toString();
-				return x1.compareTo(x2);
-			}
-		});
+        beginElement(tag);
 
-		beginElement(tag);
+        for (int i = 0; i < components.length; i++)
+            write("interfaceComponent", components[i]);
 
-		for (int i = 0; i < components.length; i++)
-			write("interfaceMessageReferenceComponent", components[i]);
+        endElement();
+    }
 
-		endElement();
-	}
+    private void write(String tag, Interface component) {
 
-	private void write(String tag, InterfaceMessageReference component) {
+        beginElement(tag, idAttribute(component));
 
-		beginElement(tag, idAttribute(component));
+        write("name", component.getName());
+        writeRefs("extendedInterfaces", component.getExtendedInterfaces());
+        write("interfaceFaults", component.getInterfaceFaults());
+        write("interfaceOperations", component.getInterfaceOperations());
+        write(FEATURES, component.getFeatures());
+        write(PROPERTIES, component.getProperties());
 
-		write("messageLabel", component.getMessageLabel().toString());
-		write("direction", component.getDirection().toString());
-		write("messageContentModel", component.getMessageContentModel());
-		writeOptionalRef("elementDeclaration", component
-				.getElementDeclaration());
-		write("features", component.getFeatures());
-		write("properties", component.getProperties());
-		writeRef("parent", component.getParent());
+        endElement();
+    }
 
-		endElement();
-	}
+    private void write(String tag, InterfaceFault[] components) {
 
-	private void write(String tag, InterfaceFaultReference[] components) {
+        if (components.length == 0)
+            return;
 
-		if (components.length == 0)
-			return;
+        Arrays.sort(components, new Comparator() {
 
-		Arrays.sort(components, new Comparator() {
+            public int compare(Object o1, Object o2) {
+                QName x1 = ((InterfaceFault) o1).getName();
+                QName x2 = ((InterfaceFault) o2).getName();
+                return compareQName(x1, x2);
+            }
+        });
 
-			public int compare(Object o1, Object o2) {
+        beginElement(tag);
 
-				InterfaceFaultReference i1 = (InterfaceFaultReference) o1;
-				InterfaceFaultReference i2 = (InterfaceFaultReference) o2;
+        for (int i = 0; i < components.length; i++)
+            write("interfaceFaultComponent", components[i]);
 
-				InterfaceFault if1 = i1.getInterfaceFault();
-				InterfaceFault if2 = i2.getInterfaceFault();
+        endElement();
+    }
 
-				if (if1 == if2)
-					return 0;
-				if (if1 == null)
-					return -1;
-				if (if2 == null)
-					return 1;
+    private void write(String tag, InterfaceFault component) {
 
-				QName q1 = if1.getName();
-				QName q2 = if2.getName();
+        beginElement("interfaceFaultComponent", idAttribute(component));
 
-				int result = compareQName(q1, q2);
-				if (result != 0)
-					return result;
+        write("name", component.getName());
+        writeOptionalRef("elementDeclaration", component
+                .getElementDeclaration());
+        write(FEATURES, component.getFeatures());
+        write(PROPERTIES, component.getProperties());
+        writeRef(PARENT, component.getParent());
 
-				String x1 = i1.getMessageLabel().toString();
-				String x2 = i2.getMessageLabel().toString();
-				return x1.compareTo(x2);
-			}
-		});
+        endElement();
+    }
 
-		beginElement(tag);
+    private void write(String tag, InterfaceOperation[] components) {
 
-		for (int i = 0; i < components.length; i++)
-			write("interfaceFaultReferenceComponent", components[i]);
+        if (components.length == 0)
+            return;
 
-		endElement();
-	}
+        Arrays.sort(components, new Comparator() {
 
-	private void write(String tag, InterfaceFaultReference component) {
+            public int compare(Object o1, Object o2) {
+                QName x1 = ((InterfaceOperation) o1).getName();
+                QName x2 = ((InterfaceOperation) o2).getName();
+                return compareQName(x1, x2);
+            }
+        });
 
-		beginElement(tag, idAttribute(component));
+        beginElement(tag);
 
-		writeRef("interfaceFault", component.getInterfaceFault());
-		write("messageLabel", component.getMessageLabel().toString());
-		write("direction", component.getDirection().toString());
-		write("features", component.getFeatures());
-		write("properties", component.getProperties());
-		writeRef("parent", component.getParent());
+        for (int i = 0; i < components.length; i++)
+            write("interfaceOperationComponent", components[i]);
 
-		endElement();
-	}
+        endElement();
+    }
 
-	private void write(String tag, Binding[] components) {
+    private void write(String tag, InterfaceOperation component) {
 
-		if (components.length == 0)
-			return;
+        beginElement("interfaceOperationComponent", idAttribute(component));
 
-		Arrays.sort(components, new Comparator() {
+        write("name", component.getName());
+        write("messageExchangePattern", component.getMessageExchangePattern());
+        write("interfaceMessageReferences", component
+                .getInterfaceMessageReferences());
+        write("interfaceFaultReferences", component
+                .getInterfaceFaultReferences());
+        writeUris("style", component.getStyle());
+        write(FEATURES, component.getFeatures());
+        write(PROPERTIES, component.getProperties());
+        writeRef(PARENT, component.getParent());
 
-			public int compare(Object o1, Object o2) {
-				QName x1 = ((Binding) o1).getName();
-				QName x2 = ((Binding) o2).getName();
-				return compareQName(x1, x2);
-			}
-		});
+        InterfaceOperationExtensions extensions = (InterfaceOperationExtensions) component
+                .getComponentExtensionsForNamespace(ComponentExtensions.URI_NS_EXTENSIONS);
+        if (extensions != null) {
+            
+            beginElement(WSDLCMEXTENSIONS_PREFIX
+                    + ":wsdlInterfaceOperationExtension");
+            
+            write(WSDLCMEXTENSIONS_PREFIX + ":safety", extensions.isSafety());
+            
+            endElement();
+        }
 
-		beginElement(tag);
+        RPCInterfaceOperationExtensions rpcExtensions = (RPCInterfaceOperationExtensions) component
+                .getComponentExtensionsForNamespace(ComponentExtensions.URI_NS_RPC);
+        if (rpcExtensions != null) {
+            
+            beginElement(WSDLCMRPC_PREFIX + ":rpcInterfaceOperationExtension");
+            
+            write(WSDLCMRPC_PREFIX + ":rpcSignature", rpcExtensions
+                    .getRPCSignature());
+            
+            endElement();
+        }
 
-		for (int i = 0; i < components.length; i++)
-			write("bindingComponent", components[i]);
+        endElement();
+    }
 
-		endElement();
-	}
+    private void write(String tag, Argument[] rpcSignature) {
 
-	private void write(String tag, Binding component) {
+        beginElement(tag);
+        for (int i = 0; i < rpcSignature.length; i++) {
 
-		beginElement(tag, idAttribute(component));
+            write(WSDLCMRPC_PREFIX + ":argument", rpcSignature[i]);
+        }
+        endElement();
+    }
 
-		write("name", component.getName());
-		writeOptionalRef("interface", component.getInterface());
-		write("type", component.getType());
-		write("bindingFaults", component.getBindingFaults());
-		write("bindingOperations", component.getBindingOperations());
-		write("features", component.getFeatures());
-		write("properties", component.getProperties());
+    private void write(String tag, Argument argument) {
 
-		// <!-- HTTP Binding Extension -->
-		// <xs:element ref="cmhttp:httpCookies" minOccurs="0" />
-		// <xs:element ref="cmhttp:httpMethodDefault"
-		// minOccurs="0" />
-		// <xs:element
-		// ref="cmhttp:httpQueryParameterSeparatorDefault" minOccurs="0" />
-		// <xs:element ref="cmhttp:httpTransferCodingDefault"
-		// minOccurs="0" />
-		//
+        beginElement(tag);
 
-		HTTPBindingExtensions http = (HTTPBindingExtensions) component
-				.getComponentExtensionsForNamespace(ComponentExtensions.URI_NS_HTTP);
+        write(WSDLCMRPC_PREFIX + ":name", argument.getName());
+        write(WSDLCMRPC_PREFIX + ":direction", argument.getDirection()
+                .toString());
 
-		if (http != null) {
+        endElement();
+    }
 
-			write(WSDLCMHTTP_PREFIX + ":httpCookies", http.isHttpCookies());
+    private void write(String tag, InterfaceMessageReference[] components) {
 
-			write(WSDLCMHTTP_PREFIX + ":httpMethodDefault", http
-					.getHttpMethodDefault());
+        if (components.length == 0)
+            return;
 
-			write(WSDLCMHTTP_PREFIX + ":httpQueryParameterSeparatorDefault",
-					http.getHttpQueryParameterSeparatorDefault());
+        Arrays.sort(components, new Comparator() {
 
-			write(WSDLCMHTTP_PREFIX + ":httpTransferCodingDefault", http
-					.getHttpTransferCodingDefault());
+            public int compare(Object o1, Object o2) {
+                String x1 = ((InterfaceMessageReference) o1).getMessageLabel()
+                        .toString();
+                String x2 = ((InterfaceMessageReference) o2).getMessageLabel()
+                        .toString();
+                return x1.compareTo(x2);
+            }
+        });
 
-		}
+        beginElement(tag);
 
-		// <!-- SOAP Binding Extension -->
+        for (int i = 0; i < components.length; i++)
+            write("interfaceMessageReferenceComponent", components[i]);
 
-		SOAPBindingExtensions soap = (SOAPBindingExtensions) component
-				.getComponentExtensionsForNamespace(ComponentExtensions.URI_NS_SOAP);
-		if (soap != null) {
+        endElement();
+    }
 
-			write(WSDLCMSOAP_PREFIX + ":soapMepDefault", soap
-					.getSoapMepDefault());
+    private void write(String tag, InterfaceMessageReference component) {
 
-			write(WSDLCMSOAP_PREFIX + ":soapModules", soap.getSoapModules());
+        beginElement(tag, idAttribute(component));
 
-			write(WSDLCMSOAP_PREFIX + ":soapUnderlyingProtocols", soap
-					.getSoapMepDefault());
+        write("messageLabel", component.getMessageLabel().toString());
+        write("direction", component.getDirection().toString());
+        write("messageContentModel", component.getMessageContentModel());
+        writeOptionalRef("elementDeclaration", component
+                .getElementDeclaration());
+        write(FEATURES, component.getFeatures());
+        write(PROPERTIES, component.getProperties());
+        writeRef(PARENT, component.getParent());
 
-			write(WSDLCMSOAP_PREFIX + ":soapVersion", soap.getSoapVersion());
+        endElement();
+    }
 
-		}
+    private void write(String tag, InterfaceFaultReference[] components) {
 
-		endElement();
-	}
+        if (components.length == 0)
+            return;
 
-	private void write(String tag, SOAPModule[] components) {
+        Arrays.sort(components, new Comparator() {
 
-		if (components.length == 0)
-			return;
+            public int compare(Object o1, Object o2) {
 
-		Arrays.sort(components, new Comparator() {
+                InterfaceFaultReference i1 = (InterfaceFaultReference) o1;
+                InterfaceFaultReference i2 = (InterfaceFaultReference) o2;
 
-			public int compare(Object o1, Object o2) {
+                InterfaceFault if1 = i1.getInterfaceFault();
+                InterfaceFault if2 = i2.getInterfaceFault();
 
-				URI uri1 = ((SOAPModule) o1).getRef();
-				URI uri2 = ((SOAPModule) o2).getRef();
+                if (if1 == if2)
+                    return 0;
+                if (if1 == null)
+                    return -1;
+                if (if2 == null)
+                    return 1;
 
-				return uri1.compareTo(uri2);
-			}
-		});
-		beginElement(tag);
+                QName q1 = if1.getName();
+                QName q2 = if2.getName();
 
-		for (int i = 0; i < components.length; i++)
-			write("SoapModuleComponent", components[i]);
+                int result = compareQName(q1, q2);
+                if (result != 0)
+                    return result;
 
-		endElement();
+                String x1 = i1.getMessageLabel().toString();
+                String x2 = i2.getMessageLabel().toString();
+                return x1.compareTo(x2);
+            }
+        });
 
-	}
+        beginElement(tag);
 
-	private void write(String tag, SOAPModule component) {
+        for (int i = 0; i < components.length; i++)
+            write("interfaceFaultReferenceComponent", components[i]);
 
-		beginElement(tag, idAttribute(component));
+        endElement();
+    }
 
-		write(WSDLCMSOAP_PREFIX + ":ref", component.getRef());
+    private void write(String tag, InterfaceFaultReference component) {
 
-		write(WSDLCMSOAP_PREFIX + ":required", component.isRequired()
-				.booleanValue());
+        beginElement(tag, idAttribute(component));
 
-		writeRef(WSDLCMSOAP_PREFIX + ":parent", component.getParent());
+        writeRef("interfaceFault", component.getInterfaceFault());
+        write("messageLabel", component.getMessageLabel().toString());
+        write("direction", component.getDirection().toString());
+        write(FEATURES, component.getFeatures());
+        write(PROPERTIES, component.getProperties());
+        writeRef(PARENT, component.getParent());
 
-		endElement();
-	}
+        endElement();
+    }
 
-	private void write(String tag, BindingFault[] components) {
+    private void write(String tag, Binding[] components) {
 
-		if (components.length == 0)
-			return;
+        if (components.length == 0)
+            return;
 
-		Arrays.sort(components, new Comparator() {
+        Arrays.sort(components, new Comparator() {
 
-			public int compare(Object o1, Object o2) {
+            public int compare(Object o1, Object o2) {
+                QName x1 = ((Binding) o1).getName();
+                QName x2 = ((Binding) o2).getName();
+                return compareQName(x1, x2);
+            }
+        });
 
-				InterfaceFault if1 = ((BindingFault) o1).getInterfaceFault();
-				InterfaceFault if2 = ((BindingFault) o2).getInterfaceFault();
+        beginElement(tag);
 
-				if (if1 == if2)
-					return 0;
-				if (if1 == null)
-					return -1;
-				if (if2 == null)
-					return 1;
+        for (int i = 0; i < components.length; i++)
+            write("bindingComponent", components[i]);
 
-				QName x1 = if1.getName();
-				QName x2 = if2.getName();
+        endElement();
+    }
 
-				return compareQName(x1, x2);
-			}
-		});
+    private void write(String tag, Binding component) {
 
-		beginElement(tag);
+        beginElement(tag, idAttribute(component));
 
-		for (int i = 0; i < components.length; i++)
-			write("bindingFaultComponent", components[i]);
+        write("name", component.getName());
+        writeOptionalRef("interface", component.getInterface());
+        write("type", component.getType());
+        write("bindingFaults", component.getBindingFaults());
+        write("bindingOperations", component.getBindingOperations());
+        write(FEATURES, component.getFeatures());
+        write(PROPERTIES, component.getProperties());
 
-		endElement();
-	}
+        HTTPBindingExtensions http = (HTTPBindingExtensions) component
+                .getComponentExtensionsForNamespace(ComponentExtensions.URI_NS_HTTP);
+        if (http != null) {
+            
+            beginElement(WSDLCMHTTP_PREFIX + ":httpBindingExtension");
 
-	private void write(String tag, BindingFault component) {
+            write(WSDLCMHTTP_PREFIX + ":httpCookies", http.isHttpCookies());
+            write(WSDLCMHTTP_PREFIX + ":httpMethodDefault", http
+                    .getHttpMethodDefault());
+            write(WSDLCMHTTP_PREFIX + ":httpQueryParameterSeparatorDefault",
+                    http.getHttpQueryParameterSeparatorDefault());
+            write(WSDLCMHTTP_PREFIX + ":httpTransferCodingDefault", http
+                    .getHttpTransferCodingDefault());
+            
+            endElement();
+        }
 
-		beginElement(tag, idAttribute(component));
+        SOAPBindingExtensions soap = (SOAPBindingExtensions) component
+                .getComponentExtensionsForNamespace(ComponentExtensions.URI_NS_SOAP);
+        if (soap != null) {
 
-		writeRef("interfaceFault", component.getInterfaceFault());
-		write("features", component.getFeatures());
-		write("properties", component.getProperties());
-		writeRef("parent", component.getParent());
+            beginElement(WSDLCMSOAP_PREFIX + ":soapBindingExtension");
 
-		// <!-- HTTP Binding Extension -->
-		// <xs:element ref="cmhttp:httpErrorStatusCode"
-		// minOccurs="0" />
-		// <xs:element ref="cmhttp:httpHeaders" minOccurs="0" />
-		// <xs:element ref="cmhttp:httpTransferCoding"
-		// minOccurs="0" />
-		//
+            write(WSDLCMSOAP_PREFIX + ":soapMepDefault", soap
+                    .getSoapMepDefault());
+            write(WSDLCMSOAP_PREFIX + ":soapModules", soap.getSoapModules());
+            write(WSDLCMSOAP_PREFIX + ":soapUnderlyingProtocols", soap
+                    .getSoapMepDefault());
+            write(WSDLCMSOAP_PREFIX + ":soapVersion", soap.getSoapVersion());
+            
+            endElement();
+        }
 
-		HTTPBindingFaultExtensions http = (HTTPBindingFaultExtensions) component
-				.getComponentExtensionsForNamespace(ComponentExtensions.URI_NS_HTTP);
+        endElement();
+    }
 
-		if (http != null) {
+    private void write(String tag, SOAPModule[] components) {
 
-			write(WSDLCMHTTP_PREFIX + ":httpErrorStatusCode", http
-					.getHttpErrorStatusCode());
+        if (components.length == 0)
+            return;
 
-			write(WSDLCMHTTP_PREFIX + ":httpHeaders", http.getHttpHeaders());
+        Arrays.sort(components, new Comparator() {
 
-			write(WSDLCMHTTP_PREFIX + ":httpTransferCoding", http
-					.getHttpTransferCoding());
-		}
+            public int compare(Object o1, Object o2) {
 
-		// <!-- SOAP Binding Extension -->
+                URI uri1 = ((SOAPModule) o1).getRef();
+                URI uri2 = ((SOAPModule) o2).getRef();
 
-		SOAPBindingFaultExtensions soap = (SOAPBindingFaultExtensions) component
-				.getComponentExtensionsForNamespace(ComponentExtensions.URI_NS_SOAP);
+                return uri1.compareTo(uri2);
+            }
+        });
+        beginElement(tag);
 
-		if (soap != null) {
+        for (int i = 0; i < components.length; i++)
+            write("SoapModuleComponent", components[i]);
 
-			write(WSDLCMSOAP_PREFIX + ":soapFaultCode", soap.getSoapFaultCode());
+        endElement();
 
-			write(WSDLCMSOAP_PREFIX + ":soapFaultSubcodes", soap
-					.getSoapFaultSubcodes());
+    }
 
-			write(WSDLCMSOAP_PREFIX + ":soapHeaders", soap.getSoapHeaders());
+    private void write(String tag, SOAPModule component) {
 
-			write(WSDLCMSOAP_PREFIX + ":soapModules", soap.getSoapModules());
-		}
+        beginElement(tag, idAttribute(component));
 
-		endElement();
-	}
+        write(WSDLCMSOAP_PREFIX + ":ref", component.getRef());
 
-	private void write(String tag, HTTPErrorStatusCode httpErrorStatusCode) {
+        write(WSDLCMSOAP_PREFIX + ":required", component.isRequired()
+                .booleanValue());
 
-		if (httpErrorStatusCode == null)
-			return;
+        writeRef(PARENT, component.getParent());
 
-		// <xs:complexType name="HttpErrorStatusCodeType">
-		// <xs:annotation>
-		// <xs:documentation>
-		// Empty content represents #any.
-		// </xs:documentation>
-		// </xs:annotation>
-		// <xs:sequence>
-		// <xs:element name="code" type="xs:int" minOccurs="0"/>
-		// </xs:sequence>
-		// </xs:complexType>
+        endElement();
+    }
 
-		beginElement(tag);
+    private void write(String tag, BindingFault[] components) {
 
-		if (httpErrorStatusCode.isCodeUsed()) {
+        if (components.length == 0)
+            return;
 
-			write(WSDLCMHTTP_PREFIX + ":code", httpErrorStatusCode.toString());
-		}
-		endElement();
-	}
+        Arrays.sort(components, new Comparator() {
 
-	private void write(String tag, HTTPHeader[] components) {
+            public int compare(Object o1, Object o2) {
 
-		if (components.length == 0)
-			return;
+                InterfaceFault if1 = ((BindingFault) o1).getInterfaceFault();
+                InterfaceFault if2 = ((BindingFault) o2).getInterfaceFault();
 
-		Arrays.sort(components, new Comparator() {
+                if (if1 == if2)
+                    return 0;
+                if (if1 == null)
+                    return -1;
+                if (if2 == null)
+                    return 1;
 
-			public int compare(Object o1, Object o2) {
+                QName x1 = if1.getName();
+                QName x2 = if2.getName();
 
-				String n1 = ((HTTPHeader) o1).getName();
-				String n2 = ((HTTPHeader) o2).getName();
+                return compareQName(x1, x2);
+            }
+        });
 
-				return n1.compareTo(n2);
-			}
-		});
+        beginElement(tag);
 
-		beginElement(tag);
+        for (int i = 0; i < components.length; i++)
+            write("bindingFaultComponent", components[i]);
 
-		for (int i = 0; i < components.length; i++)
-			write(WSDLCMHTTP_PREFIX + ":HttpHeaderComponent", components[i]);
+        endElement();
+    }
 
-		endElement();
-	}
+    private void write(String tag, BindingFault component) {
 
-	private void write(String tag, HTTPHeader component) {
+        beginElement(tag, idAttribute(component));
 
-		// <xs:complexContent>
-		// <xs:restriction base="cmbase:Component">
-		// <xs:sequence>
-		// <xs:element name="name" type="xs:string" />
-		// <xs:element name="typeDefinition" type="cmbase:Ref" />
-		// <xs:element name="required" type="xs:boolean" />
-		// <xs:element name="parent" type="cmbase:Ref" />
-		// </xs:sequence>
-		// </xs:restriction>
-		// </xs:complexContent>
+        writeRef("interfaceFault", component.getInterfaceFault());
+        write(FEATURES, component.getFeatures());
+        write(PROPERTIES, component.getProperties());
+        writeRef(PARENT, component.getParent());
 
-		beginElement(tag, idAttribute(component));
+        HTTPBindingFaultExtensions http = (HTTPBindingFaultExtensions) component
+                .getComponentExtensionsForNamespace(ComponentExtensions.URI_NS_HTTP);
+        if (http != null) {
+            
+            beginElement(WSDLCMHTTP_PREFIX + ":httpBindingFaultExtension");
 
-		write(WSDLCMHTTP_PREFIX + ":name", component.getName());
+            write(WSDLCMHTTP_PREFIX + ":httpErrorStatusCode", http
+                    .getHttpErrorStatusCode());
+            write(WSDLCMHTTP_PREFIX + ":httpHeaders", http.getHttpHeaders());
+            write(WSDLCMHTTP_PREFIX + ":httpTransferCoding", http
+                    .getHttpTransferCoding());
+            
+            endElement();
+        }
 
-		writeRef(WSDLCMHTTP_PREFIX + ":typeDefinition", component
-				.getTypeDefinition());
+        SOAPBindingFaultExtensions soap = (SOAPBindingFaultExtensions) component
+                .getComponentExtensionsForNamespace(ComponentExtensions.URI_NS_SOAP);
+        if (soap != null) {
 
-		write(WSDLCMHTTP_PREFIX + ":required", component.isRequired());
+            beginElement(WSDLCMSOAP_PREFIX + ":soapBindingFaultExtension");
+            
+            write(WSDLCMSOAP_PREFIX + ":soapFaultCode", soap.getSoapFaultCode());
+            write(WSDLCMSOAP_PREFIX + ":soapFaultSubcodes", soap
+                    .getSoapFaultSubcodes());
+            write(WSDLCMSOAP_PREFIX + ":soapHeaders", soap.getSoapHeaders());
+            write(WSDLCMSOAP_PREFIX + ":soapModules", soap.getSoapModules());
+            
+            endElement();
+        }
 
-		writeRef(WSDLCMHTTP_PREFIX + ":parent", component.getParent());
+        endElement();
+    }
 
-		endElement();
-	}
+    private void write(String tag, HTTPErrorStatusCode httpErrorStatusCode) {
 
-	private void write(String tag, SOAPFaultSubcodes soapFaultSubcodes) {
+        if (httpErrorStatusCode == null)
+            return;
 
-		beginElement(tag);
-		if (soapFaultSubcodes.isQNames()) {
-			beginElement(WSDLCMSOAP_PREFIX + ":subcodes");
-			QName[] codes = soapFaultSubcodes.getQNames();
-			for (int i = 0; i < codes.length; i++) {
-				write(WSDLCMSOAP_PREFIX + ":code", codes[i]);
-			}
-			endElement();
-		}
-		endElement();
-	}
+        beginElement(tag);
 
-	private void write(String tag, SOAPFaultCode soapFaultCode) {
+        if (httpErrorStatusCode.isCodeUsed()) {
 
-		beginElement(tag);
-		if (soapFaultCode.isQName()) {
-			write(WSDLCMSOAP_PREFIX + ":code", soapFaultCode.getQName());
-		}
-		endElement();
-	}
+            write(WSDLCMHTTP_PREFIX + ":code", httpErrorStatusCode.toString());
+        }
+        
+        endElement();
+    }
 
-	private void write(String tag, SOAPHeaderBlock[] components) {
+    private void write(String tag, HTTPHeader[] components) {
 
-		if (components.length == 0)
-			return;
+        if (components.length == 0)
+            return;
 
-		Arrays.sort(components, new Comparator() {
+        Arrays.sort(components, new Comparator() {
 
-			public int compare(Object o1, Object o2) {
+            public int compare(Object o1, Object o2) {
 
-				ElementDeclaration ed1 = ((SOAPHeaderBlock) o1)
-						.getElementDeclaration();
-				ElementDeclaration ed2 = ((SOAPHeaderBlock) o2)
-						.getElementDeclaration();
+                String n1 = ((HTTPHeader) o1).getName();
+                String n2 = ((HTTPHeader) o2).getName();
 
-				if (ed1 == ed2)
-					return 0;
-				if (ed1 == null)
-					return -1;
-				if (ed2 == null)
-					return 1;
+                return n1.compareTo(n2);
+            }
+        });
 
-				QName x1 = ed1.getName();
-				QName x2 = ed2.getName();
+        beginElement(tag);
 
-				return compareQName(x1, x2);
-			}
-		});
+        for (int i = 0; i < components.length; i++)
+            write(WSDLCMHTTP_PREFIX + ":HttpHeaderComponent", components[i]);
 
-		beginElement(tag);
+        endElement();
+    }
 
-		for (int i = 0; i < components.length; i++)
-			write(WSDLCMSOAP_PREFIX + ":SoapHeaderBlockComponent",
-					components[i]);
+    private void write(String tag, HTTPHeader component) {
 
-		endElement();
-	}
+        beginElement(tag, idAttribute(component));
 
-	private void write(String tag, SOAPHeaderBlock component) {
+        write(WSDLCMHTTP_PREFIX + ":name", component.getName());
 
-		beginElement(tag, idAttribute(component));
+        writeRef(WSDLCMHTTP_PREFIX + ":typeDefinition", component
+                .getTypeDefinition());
 
-		writeRef(WSDLCMSOAP_PREFIX + ":elementDeclaration", component
-				.getElementDeclaration());
+        write(WSDLCMHTTP_PREFIX + ":required", component.isRequired());
 
-		write(WSDLCMSOAP_PREFIX + ":mustUnderstand", component.mustUnderstand()
-				.booleanValue());
+        writeRef(PARENT, component.getParent());
 
-		write(WSDLCMSOAP_PREFIX + ":required", component.isRequired()
-				.booleanValue());
+        endElement();
+    }
 
-		writeRef(WSDLCMSOAP_PREFIX + ":parent", component.getParent());
+    private void write(String tag, SOAPFaultSubcodes soapFaultSubcodes) {
 
-		endElement();
+        beginElement(tag);
+        if (soapFaultSubcodes.isQNames()) {
+            beginElement(WSDLCMSOAP_PREFIX + ":subcodes");
+            QName[] codes = soapFaultSubcodes.getQNames();
+            for (int i = 0; i < codes.length; i++) {
+                write(WSDLCMSOAP_PREFIX + ":code", codes[i]);
+            }
+            endElement();
+        }
+        endElement();
+    }
 
-	}
+    private void write(String tag, SOAPFaultCode soapFaultCode) {
 
-	private void write(String tag, BindingOperation[] components) {
+        beginElement(tag);
+        if (soapFaultCode.isQName()) {
+            write(WSDLCMSOAP_PREFIX + ":code", soapFaultCode.getQName());
+        }
+        endElement();
+    }
 
-		if (components.length == 0)
-			return;
+    private void write(String tag, SOAPHeaderBlock[] components) {
 
-		Arrays.sort(components, new Comparator() {
+        if (components.length == 0)
+            return;
 
-			public int compare(Object o1, Object o2) {
-				QName x1 = ((BindingOperation) o1).getInterfaceOperation()
-						.getName();
-				QName x2 = ((BindingOperation) o1).getInterfaceOperation()
-						.getName();
-				return compareQName(x1, x2);
-			}
-		});
+        Arrays.sort(components, new Comparator() {
 
-		beginElement(tag);
+            public int compare(Object o1, Object o2) {
 
-		for (int i = 0; i < components.length; i++)
-			write("bindingOperationComponent", components[i]);
+                ElementDeclaration ed1 = ((SOAPHeaderBlock) o1)
+                        .getElementDeclaration();
+                ElementDeclaration ed2 = ((SOAPHeaderBlock) o2)
+                        .getElementDeclaration();
 
-		endElement();
-	}
+                if (ed1 == ed2)
+                    return 0;
+                if (ed1 == null)
+                    return -1;
+                if (ed2 == null)
+                    return 1;
 
-	private void write(String tag, BindingOperation component) {
+                QName x1 = ed1.getName();
+                QName x2 = ed2.getName();
 
-		beginElement(tag, idAttribute(component));
+                return compareQName(x1, x2);
+            }
+        });
 
-		writeRef("interfaceOperation", component.getInterfaceOperation());
-		write("bindingFaultReferences", component.getBindingFaultReferences());
-		write("bindingMessageReferences", component
-				.getBindingMessageReferences());
-		write("features", component.getFeatures());
-		write("properties", component.getProperties());
-		writeRef("parent", component.getParent());
+        beginElement(tag);
 
-		// <!-- HTTP Binding Extension -->
-		// <xs:element ref="cmhttp:httpFaultSerialization"
-		// minOccurs="0" />
-		// <xs:element ref="cmhttp:httpInputSerialization"
-		// minOccurs="0" />
-		// <xs:element ref="cmhttp:httpLocation" minOccurs="0" />
-		// <xs:element ref="cmhttp:httpLocationIgnoreUncited"
-		// minOccurs="0" />
-		// <xs:element ref="cmhttp:httpMethod" minOccurs="0" />
-		// <xs:element ref="cmhttp:httpOutputSerialization"
-		// minOccurs="0" />
-		// <xs:element ref="cmhttp:httpQueryParameterSeparator"
-		// minOccurs="0" />
-		// <xs:element ref="cmhttp:httpTransferCodingDefault"
-		// minOccurs="0" />
-		//
+        for (int i = 0; i < components.length; i++)
+            write(WSDLCMSOAP_PREFIX + ":SoapHeaderBlockComponent",
+                    components[i]);
 
-		HTTPBindingOperationExtensions http = (HTTPBindingOperationExtensions) component
-				.getComponentExtensionsForNamespace(ComponentExtensions.URI_NS_HTTP);
+        endElement();
+    }
 
-		if (http != null) {
+    private void write(String tag, SOAPHeaderBlock component) {
 
-			write(WSDLCMHTTP_PREFIX + ":httpFaultSerialization", http
-					.getHttpFaultSerialization());
+        beginElement(tag, idAttribute(component));
 
-			write(WSDLCMHTTP_PREFIX + ":httpInputSerialization", http
-					.getHttpInputSerialization());
+        writeRef(WSDLCMSOAP_PREFIX + ":elementDeclaration", component
+                .getElementDeclaration());
 
-			write(WSDLCMHTTP_PREFIX + ":httpLocation", http.getHttpLocation());
+        write(WSDLCMSOAP_PREFIX + ":mustUnderstand", component.mustUnderstand()
+                .booleanValue());
 
-			write(WSDLCMHTTP_PREFIX + ":httpLocationIgnoreUncited", http
-					.isHttpLocationIgnoreUncited());
+        write(WSDLCMSOAP_PREFIX + ":required", component.isRequired()
+                .booleanValue());
 
-			write(WSDLCMHTTP_PREFIX + ":httpMethod", http.getHttpMethod());
+        writeRef(WSDLCMSOAP_PREFIX + ":parent", component.getParent());
 
-			write(WSDLCMHTTP_PREFIX + ":httpOutputSerialization", http
-					.getHttpOutputSerialization());
+        endElement();
 
-			write(WSDLCMHTTP_PREFIX + ":httpQueryParameterSeparator", http
-					.getHttpQueryParameterSeparator());
+    }
 
-			write(WSDLCMHTTP_PREFIX + ":httpTransferCodingDefault", http
-					.getHttpTransferCodingDefault());
-		}
+    private void write(String tag, BindingOperation[] components) {
 
-		// <!-- SOAP Binding Extension -->
+        if (components.length == 0)
+            return;
 
-		SOAPBindingOperationExtensions soap = (SOAPBindingOperationExtensions) component
-				.getComponentExtensionsForNamespace(ComponentExtensions.URI_NS_SOAP);
-		if (soap != null) {
+        Arrays.sort(components, new Comparator() {
 
-			write(WSDLCMSOAP_PREFIX + ":soapAction", soap.getSoapAction());
+            public int compare(Object o1, Object o2) {
+                QName x1 = ((BindingOperation) o1).getInterfaceOperation()
+                        .getName();
+                QName x2 = ((BindingOperation) o1).getInterfaceOperation()
+                        .getName();
+                return compareQName(x1, x2);
+            }
+        });
 
-			write(WSDLCMSOAP_PREFIX + ":soapMep", soap.getSoapMep());
+        beginElement(tag);
 
-			write(WSDLCMSOAP_PREFIX + ":soapModules", soap.getSoapModules());
-		}
+        for (int i = 0; i < components.length; i++)
+            write("bindingOperationComponent", components[i]);
 
-		endElement();
-	}
+        endElement();
+    }
 
-	private void write(String tag, BindingMessageReference[] components) {
+    private void write(String tag, BindingOperation component) {
 
-		if (components.length == 0)
-			return;
+        beginElement(tag, idAttribute(component));
 
-		Arrays.sort(components, new Comparator() {
+        writeRef("interfaceOperation", component.getInterfaceOperation());
+        write("bindingFaultReferences", component.getBindingFaultReferences());
+        write("bindingMessageReferences", component
+                .getBindingMessageReferences());
+        write(FEATURES, component.getFeatures());
+        write(PROPERTIES, component.getProperties());
+        writeRef(PARENT, component.getParent());
 
-			public int compare(Object o1, Object o2) {
+        HTTPBindingOperationExtensions http = (HTTPBindingOperationExtensions) component
+                .getComponentExtensionsForNamespace(ComponentExtensions.URI_NS_HTTP);
+        if (http != null) {
+            
+            beginElement(WSDLCMHTTP_PREFIX + ":httpBindingOperationExtension");
 
-				InterfaceMessageReference i1 = ((BindingMessageReference) o1)
-						.getInterfaceMessageReference();
-				InterfaceMessageReference i2 = ((BindingMessageReference) o2)
-						.getInterfaceMessageReference();
+            write(WSDLCMHTTP_PREFIX + ":httpFaultSerialization", http
+                    .getHttpFaultSerialization());
+            write(WSDLCMHTTP_PREFIX + ":httpInputSerialization", http
+                    .getHttpInputSerialization());
+            write(WSDLCMHTTP_PREFIX + ":httpLocation", http.getHttpLocation());
+            write(WSDLCMHTTP_PREFIX + ":httpLocationIgnoreUncited", http
+                    .isHttpLocationIgnoreUncited());
+            write(WSDLCMHTTP_PREFIX + ":httpMethod", http.getHttpMethod());
+            write(WSDLCMHTTP_PREFIX + ":httpOutputSerialization", http
+                    .getHttpOutputSerialization());
+            write(WSDLCMHTTP_PREFIX + ":httpQueryParameterSeparator", http
+                    .getHttpQueryParameterSeparator());
+            write(WSDLCMHTTP_PREFIX + ":httpTransferCodingDefault", http
+                    .getHttpTransferCodingDefault());
+            
+            endElement();
+        }
 
-				String x1 = i1.getMessageLabel().toString();
-				String x2 = i2.getMessageLabel().toString();
-				return x1.compareTo(x2);
-			}
-		});
+        SOAPBindingOperationExtensions soap = (SOAPBindingOperationExtensions) component
+                .getComponentExtensionsForNamespace(ComponentExtensions.URI_NS_SOAP);
+        if (soap != null) {
+            
+            beginElement(WSDLCMSOAP_PREFIX + ":soapBindingOperationExtension");
 
-		beginElement(tag);
+            write(WSDLCMSOAP_PREFIX + ":soapAction", soap.getSoapAction());
+            write(WSDLCMSOAP_PREFIX + ":soapMep", soap.getSoapMep());
+            write(WSDLCMSOAP_PREFIX + ":soapModules", soap.getSoapModules());
+            
+            endElement();
+        }
 
-		for (int i = 0; i < components.length; i++)
-			write("bindingMessageReferenceComponent", components[i]);
+        endElement();
+    }
 
-		endElement();
-	}
+    private void write(String tag, BindingMessageReference[] components) {
 
-	private void write(String tag, BindingMessageReference component) {
+        if (components.length == 0)
+            return;
 
-		beginElement(tag, idAttribute(component));
+        Arrays.sort(components, new Comparator() {
 
-		writeRef("interfaceMessageReference", component
-				.getInterfaceMessageReference());
-		write("features", component.getFeatures());
-		write("properties", component.getProperties());
-		writeRef("parent", component.getParent());
+            public int compare(Object o1, Object o2) {
 
-		// <!-- HTTP Binding Extension -->
-		// <xs:element ref="cmhttp:httpHeaders" minOccurs="0" />
-		// <xs:element ref="cmhttp:httpTransferCoding"
-		// minOccurs="0" />
+                InterfaceMessageReference i1 = ((BindingMessageReference) o1)
+                        .getInterfaceMessageReference();
+                InterfaceMessageReference i2 = ((BindingMessageReference) o2)
+                        .getInterfaceMessageReference();
 
-		HTTPBindingMessageReferenceExtensions http = (HTTPBindingMessageReferenceExtensions) component
-				.getComponentExtensionsForNamespace(ComponentExtensions.URI_NS_HTTP);
+                String x1 = i1.getMessageLabel().toString();
+                String x2 = i2.getMessageLabel().toString();
+                return x1.compareTo(x2);
+            }
+        });
 
-		if (http != null) {
+        beginElement(tag);
 
-			write(WSDLCMHTTP_PREFIX + ":httpHeaders", http.getHttpHeaders());
+        for (int i = 0; i < components.length; i++)
+            write("bindingMessageReferenceComponent", components[i]);
 
-			write(WSDLCMHTTP_PREFIX + ":httpTransferCoding", http
-					.getHttpTransferCoding());
-		}
+        endElement();
+    }
 
-		// <!-- SOAP Binding Extension -->
+    private void write(String tag, BindingMessageReference component) {
 
-		SOAPBindingMessageReferenceExtensions soap = (SOAPBindingMessageReferenceExtensions) component
-				.getComponentExtensionsForNamespace(ComponentExtensions.URI_NS_SOAP);
-		if (soap != null) {
+        beginElement(tag, idAttribute(component));
 
-			write(WSDLCMSOAP_PREFIX + ":soapHeaders", soap.getSoapHeaders());
+        writeRef("interfaceMessageReference", component
+                .getInterfaceMessageReference());
+        write(FEATURES, component.getFeatures());
+        write(PROPERTIES, component.getProperties());
+        writeRef(PARENT, component.getParent());
 
-			write(WSDLCMSOAP_PREFIX + ":soapModules", soap.getSoapModules());
-		}
+        HTTPBindingMessageReferenceExtensions http = (HTTPBindingMessageReferenceExtensions) component
+                .getComponentExtensionsForNamespace(ComponentExtensions.URI_NS_HTTP);
+        if (http != null) {
+            
+            beginElement(WSDLCMHTTP_PREFIX + ":httpBindingMessageReferenceExtension");
 
-		endElement();
-	}
+            write(WSDLCMHTTP_PREFIX + ":httpHeaders", http.getHttpHeaders());
+            write(WSDLCMHTTP_PREFIX + ":httpTransferCoding", http
+                    .getHttpTransferCoding());
+            
+            endElement();
+        }
 
-	private void write(String tag, BindingFaultReference[] components) {
+        SOAPBindingMessageReferenceExtensions soap = (SOAPBindingMessageReferenceExtensions) component
+                .getComponentExtensionsForNamespace(ComponentExtensions.URI_NS_SOAP);
+        if (soap != null) {
+            
+            beginElement(WSDLCMSOAP_PREFIX + ":soapBindingMessageReferenceExtension");
 
-		if (components.length == 0)
-			return;
+            write(WSDLCMSOAP_PREFIX + ":soapHeaders", soap.getSoapHeaders());
+            write(WSDLCMSOAP_PREFIX + ":soapModules", soap.getSoapModules());
+            
+            endElement();
+        }
 
-		Arrays.sort(components, new Comparator() {
+        endElement();
+    }
 
-			public int compare(Object o1, Object o2) {
+    private void write(String tag, BindingFaultReference[] components) {
 
-				InterfaceFaultReference i1 = ((BindingFaultReference) o1)
-						.getInterfaceFaultReference();
-				InterfaceFaultReference i2 = ((BindingFaultReference) o2)
-						.getInterfaceFaultReference();
+        if (components.length == 0)
+            return;
 
-				QName q1 = i1.getInterfaceFault().getName();
-				QName q2 = i2.getInterfaceFault().getName();
+        Arrays.sort(components, new Comparator() {
 
-				int result = compareQName(q1, q2);
-				if (result != 0)
-					return result;
+            public int compare(Object o1, Object o2) {
 
-				String x1 = i1.getMessageLabel().toString();
-				String x2 = i2.getMessageLabel().toString();
-				return x1.compareTo(x2);
-			}
-		});
+                InterfaceFaultReference i1 = ((BindingFaultReference) o1)
+                        .getInterfaceFaultReference();
+                InterfaceFaultReference i2 = ((BindingFaultReference) o2)
+                        .getInterfaceFaultReference();
 
-		beginElement(tag);
+                QName q1 = i1.getInterfaceFault().getName();
+                QName q2 = i2.getInterfaceFault().getName();
 
-		for (int i = 0; i < components.length; i++)
-			write("bindingFaultReferenceComponent", components[i]);
+                int result = compareQName(q1, q2);
+                if (result != 0)
+                    return result;
 
-		endElement();
-	}
+                String x1 = i1.getMessageLabel().toString();
+                String x2 = i2.getMessageLabel().toString();
+                return x1.compareTo(x2);
+            }
+        });
 
-	private void write(String tag, BindingFaultReference component) {
+        beginElement(tag);
 
-		beginElement(tag, idAttribute(component));
+        for (int i = 0; i < components.length; i++)
+            write("bindingFaultReferenceComponent", components[i]);
 
-		writeRef("interfaceFaultReference", component
-				.getInterfaceFaultReference());
-		write("features", component.getFeatures());
-		write("properties", component.getProperties());
-		writeRef("parent", component.getParent());
+        endElement();
+    }
 
-		// <!-- SOAP Binding Extension -->
+    private void write(String tag, BindingFaultReference component) {
 
-		SOAPBindingFaultReferenceExtensions soap = (SOAPBindingFaultReferenceExtensions) component
-				.getComponentExtensionsForNamespace(ComponentExtensions.URI_NS_SOAP);
-		if (soap != null) {
+        beginElement(tag, idAttribute(component));
 
-			write(WSDLCMSOAP_PREFIX + ":soapModules", soap.getSoapModules());
-		}
+        writeRef("interfaceFaultReference", component
+                .getInterfaceFaultReference());
+        write(FEATURES, component.getFeatures());
+        write(PROPERTIES, component.getProperties());
+        writeRef(PARENT, component.getParent());
 
-		endElement();
-	}
+        SOAPBindingFaultReferenceExtensions soap = (SOAPBindingFaultReferenceExtensions) component
+                .getComponentExtensionsForNamespace(ComponentExtensions.URI_NS_SOAP);
+        if (soap != null) {
+            
+            beginElement(WSDLCMSOAP_PREFIX + ":soapBindingFaultReferenceExtension");
 
-	private void write(String tag, Service[] components) {
+            write(WSDLCMSOAP_PREFIX + ":soapModules", soap.getSoapModules());
+            
+            endElement();
+        }
 
-		if (components.length == 0)
-			return;
+        endElement();
+    }
 
-		Arrays.sort(components, new Comparator() {
+    private void write(String tag, Service[] components) {
 
-			public int compare(Object o1, Object o2) {
-				QName x1 = ((Service) o1).getName();
-				QName x2 = ((Service) o2).getName();
-				return compareQName(x1, x2);
-			}
-		});
+        if (components.length == 0)
+            return;
 
-		beginElement(tag);
+        Arrays.sort(components, new Comparator() {
 
-		for (int i = 0; i < components.length; i++)
-			write("serviceComponent", components[i]);
+            public int compare(Object o1, Object o2) {
+                QName x1 = ((Service) o1).getName();
+                QName x2 = ((Service) o2).getName();
+                return compareQName(x1, x2);
+            }
+        });
 
-		endElement();
-	}
+        beginElement(tag);
 
-	private void write(String tag, Service component) {
+        for (int i = 0; i < components.length; i++)
+            write("serviceComponent", components[i]);
 
-		beginElement(tag, idAttribute(component));
+        endElement();
+    }
 
-		write("name", component.getName());
-		writeRef("interface", component.getInterface());
-		write("endpoints", component.getEndpoints());
-		write("features", component.getFeatures());
-		write("properties", component.getProperties());
+    private void write(String tag, Service component) {
 
-		endElement();
-	}
+        beginElement(tag, idAttribute(component));
 
-	private void write(String tag, Endpoint[] components) {
+        write("name", component.getName());
+        writeRef("interface", component.getInterface());
+        write("endpoints", component.getEndpoints());
+        write(FEATURES, component.getFeatures());
+        write(PROPERTIES, component.getProperties());
 
-		if (components.length == 0)
-			return;
+        endElement();
+    }
 
-		Arrays.sort(components, new Comparator() {
+    private void write(String tag, Endpoint[] components) {
 
-			public int compare(Object o1, Object o2) {
-				String x1 = ((Endpoint) o1).getName().toString();
-				String x2 = ((Endpoint) o2).getName().toString();
-				return x1.compareTo(x2);
-			}
-		});
+        if (components.length == 0)
+            return;
 
-		beginElement(tag);
+        Arrays.sort(components, new Comparator() {
 
-		for (int i = 0; i < components.length; i++) {
-			write("endpointComponent", components[i]);
-		}
+            public int compare(Object o1, Object o2) {
+                String x1 = ((Endpoint) o1).getName().toString();
+                String x2 = ((Endpoint) o2).getName().toString();
+                return x1.compareTo(x2);
+            }
+        });
 
-		endElement();
+        beginElement(tag);
 
-	}
+        for (int i = 0; i < components.length; i++) {
+            write("endpointComponent", components[i]);
+        }
 
-	private void write(String tag, Endpoint component) {
+        endElement();
 
-		beginElement(tag, idAttribute(component));
+    }
 
-		write("name", component.getName());
-		writeRef("binding", component.getBinding());
-		write("address", component.getAddress());
-		write("feaures", component.getFeatures());
-		write("properties", component.getProperties());
-		writeRef("parent", component.getParent());
+    private void write(String tag, Endpoint component) {
 
-		// <!-- HTTP Binding Extension -->
-		// <xs:element ref="cmhttp:httpAuthenticationRealm"
-		// minOccurs="0" />
-		// <xs:element ref="cmhttp:httpAuthenticationScheme"
-		// minOccurs="0" />
+        beginElement(tag, idAttribute(component));
 
-		HTTPEndpointExtensions http = (HTTPEndpointExtensions) component
-				.getComponentExtensionsForNamespace(ComponentExtensions.URI_NS_HTTP);
+        write("name", component.getName());
+        writeRef("binding", component.getBinding());
+        write("address", component.getAddress());
+        write("feaures", component.getFeatures());
+        write(PROPERTIES, component.getProperties());
+        writeRef(PARENT, component.getParent());
 
-		if (http != null) {
+        HTTPEndpointExtensions http = (HTTPEndpointExtensions) component
+                .getComponentExtensionsForNamespace(ComponentExtensions.URI_NS_HTTP);
 
-			write(WSDLCMHTTP_PREFIX + ":httpAuthenticationRealm", http
-					.getHttpAuthenticationRealm());
+        if (http != null) {
 
-			write(WSDLCMHTTP_PREFIX + ":httpAuthenticationScheme", http
-					.getHttpAuthenicationScheme());
-		}
+            beginElement(WSDLCMHTTP_PREFIX + ":httpEndpointExtension");
+            
+            write(WSDLCMHTTP_PREFIX + ":httpAuthenticationRealm", http
+                    .getHttpAuthenticationRealm());
+            write(WSDLCMHTTP_PREFIX + ":httpAuthenticationScheme", http
+                    .getHttpAuthenicationScheme());
+            
+            endElement();
+        }
 
-		endElement();
-	}
+        endElement();
+    }
 
-	private void write(String tag, HTTPAuthenticationScheme scheme) {
+    private void write(String tag, HTTPAuthenticationScheme scheme) {
 
-		if (scheme == null)
-			return;
+        if (scheme == null)
+            return;
 
-		write(tag, scheme.toString());
-	}
+        write(tag, scheme.toString());
+    }
 
-	private void write(String tag, ElementDeclaration[] components) {
+    private void write(String tag, ElementDeclaration[] components) {
 
-		// filter out the XSD elements until Woden fixes the bug
-		Vector filteredElements = new Vector();
-		for (int i = 0; i < components.length; i++) {
-			if (!XSD_NS.equals(components[i].getName().getNamespaceURI()))
-				filteredElements.addElement(components[i]);
-		}
-		components = new ElementDeclaration[filteredElements.size()];
-		filteredElements.copyInto(components);
+        // filter out the XSD elements until Woden fixes the bug
+        Vector filteredElements = new Vector();
+        for (int i = 0; i < components.length; i++) {
+            if (!XSD_NS.equals(components[i].getName().getNamespaceURI()))
+                filteredElements.addElement(components[i]);
+        }
+        components = new ElementDeclaration[filteredElements.size()];
+        filteredElements.copyInto(components);
 
-		if (components.length == 0)
-			return;
+        if (components.length == 0)
+            return;
 
-		Arrays.sort(components, new Comparator() {
+        Arrays.sort(components, new Comparator() {
 
-			public int compare(Object o1, Object o2) {
-				QName x1 = ((ElementDeclaration) o1).getName();
-				QName x2 = ((ElementDeclaration) o2).getName();
-				return compareQName(x1, x2);
-			}
-		});
+            public int compare(Object o1, Object o2) {
+                QName x1 = ((ElementDeclaration) o1).getName();
+                QName x2 = ((ElementDeclaration) o2).getName();
+                return compareQName(x1, x2);
+            }
+        });
 
-		beginElement(tag);
+        beginElement(tag);
 
-		for (int i = 0; i < components.length; i++)
-			write("elementDeclarationComponent", components[i]);
+        for (int i = 0; i < components.length; i++)
+            write("elementDeclarationComponent", components[i]);
 
-		endElement();
-	}
+        endElement();
+    }
 
-	private void write(String tag, ElementDeclaration component) {
+    private void write(String tag, ElementDeclaration component) {
 
-		beginElement(tag, idAttribute(component));
+        beginElement(tag, idAttribute(component));
 
-		write("name", component.getName());
-		write("system", component.getSystem());
+        write("name", component.getName());
+        write("system", component.getSystem());
 
-		endElement();
-	}
+        endElement();
+    }
 
-	private void write(String tag, TypeDefinition[] components) {
+    private void write(String tag, TypeDefinition[] components) {
 
-		// filter out the XSD non-built-in types until Woden fixes the bug
-		Vector filteredTypes = new Vector();
-		for (int i = 0; i < components.length; i++) {
-			if (!XSD_NS.equals(components[i].getName().getNamespaceURI())) {
-				filteredTypes.addElement(components[i]);
-			} else {
-				if (Arrays.binarySearch(XSD_TYPES, components[i].getName()
-						.getLocalPart()) >= 0)
-					filteredTypes.addElement(components[i]);
-			}
-		}
-		components = new TypeDefinition[filteredTypes.size()];
-		filteredTypes.copyInto(components);
+        // filter out the XSD non-built-in types until Woden fixes the bug
+        Vector filteredTypes = new Vector();
+        for (int i = 0; i < components.length; i++) {
+            if (!XSD_NS.equals(components[i].getName().getNamespaceURI())) {
+                filteredTypes.addElement(components[i]);
+            } else {
+                if (Arrays.binarySearch(XSD_TYPES, components[i].getName()
+                        .getLocalPart()) >= 0)
+                    filteredTypes.addElement(components[i]);
+            }
+        }
+        components = new TypeDefinition[filteredTypes.size()];
+        filteredTypes.copyInto(components);
 
-		if (components.length == 0)
-			return;
+        if (components.length == 0)
+            return;
 
-		Arrays.sort(components, new Comparator() {
+        Arrays.sort(components, new Comparator() {
 
-			public int compare(Object o1, Object o2) {
-				QName x1 = ((TypeDefinition) o1).getName();
-				QName x2 = ((TypeDefinition) o2).getName();
-				return compareQName(x1, x2);
-			}
-		});
+            public int compare(Object o1, Object o2) {
+                QName x1 = ((TypeDefinition) o1).getName();
+                QName x2 = ((TypeDefinition) o2).getName();
+                return compareQName(x1, x2);
+            }
+        });
 
-		beginElement(tag);
+        beginElement(tag);
 
-		for (int i = 0; i < components.length; i++)
-			write("typeDefinitionComponent", components[i]);
+        for (int i = 0; i < components.length; i++)
+            write("typeDefinitionComponent", components[i]);
 
-		endElement();
-	}
+        endElement();
+    }
 
-	private void write(String tag, TypeDefinition component) {
+    private void write(String tag, TypeDefinition component) {
 
-		beginElement(tag, idAttribute(component));
+        beginElement(tag, idAttribute(component));
 
-		write("name", component.getName());
-		write("system", component.getSystem());
+        write("name", component.getName());
+        write("system", component.getSystem());
 
-		endElement();
-	}
+        endElement();
+    }
 
-	private void write(String tag, Feature[] components) {
+    private void write(String tag, Feature[] components) {
 
-		if (components.length == 0)
-			return;
+        if (components.length == 0)
+            return;
 
-		Arrays.sort(components, new Comparator() {
+        Arrays.sort(components, new Comparator() {
 
-			public int compare(Object o1, Object o2) {
-				URI x1 = ((Feature) o1).getRef();
-				URI x2 = ((Feature) o2).getRef();
-				return x1.compareTo(x2);
-			}
-		});
+            public int compare(Object o1, Object o2) {
+                URI x1 = ((Feature) o1).getRef();
+                URI x2 = ((Feature) o2).getRef();
+                return x1.compareTo(x2);
+            }
+        });
 
-		beginElement(tag);
+        beginElement(tag);
 
-		for (int i = 0; i < components.length; i++) {
-			write("featureComponent", components[i]);
-		}
-		endElement();
-	}
+        for (int i = 0; i < components.length; i++) {
+            write("featureComponent", components[i]);
+        }
+        endElement();
+    }
 
-	private void write(String tag, Feature component) {
+    private void write(String tag, Feature component) {
 
-		beginElement(tag, idAttribute(component));
+        beginElement(tag, idAttribute(component));
 
-		write("ref", component.getRef());
-		write("required", component.isRequired());
-		writeRef("parent", component.getParent());
+        write("ref", component.getRef());
+        write("required", component.isRequired());
+        writeRef(PARENT, component.getParent());
 
-		endElement();
-	}
+        endElement();
+    }
 
-	private void write(String tag, Property[] components) {
+    private void write(String tag, Property[] components) {
 
-		if (components.length == 0)
-			return;
+        if (components.length == 0)
+            return;
 
-		Arrays.sort(components, new Comparator() {
+        Arrays.sort(components, new Comparator() {
 
-			public int compare(Object o1, Object o2) {
-				URI x1 = ((Property) o1).getRef();
-				URI x2 = ((Property) o2).getRef();
-				return x1.compareTo(x2);
-			}
-		});
+            public int compare(Object o1, Object o2) {
+                URI x1 = ((Property) o1).getRef();
+                URI x2 = ((Property) o2).getRef();
+                return x1.compareTo(x2);
+            }
+        });
 
-		beginElement(tag);
+        beginElement(tag);
 
-		for (int i = 0; i < components.length; i++) {
-			write("propertyComponent", components[i]);
-		}
+        for (int i = 0; i < components.length; i++) {
+            write("propertyComponent", components[i]);
+        }
 
-		endElement();
-	}
+        endElement();
+    }
 
-	private void write(String tag, Property component) {
+    private void write(String tag, Property component) {
 
-		beginElement(tag, idAttribute(component));
+        beginElement(tag, idAttribute(component));
 
-		write("ref", component.getRef());
-		writeOptionalRef("valueConstraint", component.getValueConstraint());
-		writeAny("value", component.getValue());
-		writeRef("parent", component.getParent());
+        write("ref", component.getRef());
+        writeOptionalRef("valueConstraint", component.getValueConstraint());
+        writeAny("value", component.getValue());
+        writeRef(PARENT, component.getParent());
 
-		endElement();
-	}
+        endElement();
+    }
 
-	private void write(String tag, NCName ncname) {
+    private void write(String tag, NCName ncname) {
 
-		if (ncname == null)
-			return;
+        if (ncname == null)
+            return;
 
-		element(tag, ncname.toString());
-	}
+        element(tag, ncname.toString());
+    }
 
-	private void write(String tag, String content) {
+    private void write(String tag, String content) {
 
-		if (content == null)
-			return;
+        if (content == null)
+            return;
 
-		element(tag, content);
-	}
+        element(tag, content);
+    }
 
-	private void write(String tag, Boolean o) {
+    private void write(String tag, Boolean o) {
 
-		if (o == null)
-			return;
+        if (o == null)
+            return;
 
-		write(tag, o.booleanValue());
-	}
+        write(tag, o.booleanValue());
+    }
 
-	private void write(String tag, boolean value) {
+    private void write(String tag, boolean value) {
 
-		element(tag, value ? "true" : "false");
-	}
+        element(tag, value ? "true" : "false");
+    }
 
-	private void write(String tag, QName qname) {
+    private void write(String tag, QName qname) {
 
-		if (qname == null)
-			return;
+        if (qname == null)
+            return;
 
-		beginElement(tag);
+        beginElement(tag);
 
-		element(WSDLCMBASE_PREFIX + ":namespaceName", qname.getNamespaceURI());
-		element(WSDLCMBASE_PREFIX + ":localName", qname.getLocalPart());
+        element(WSDLCMBASE_PREFIX + ":namespaceName", qname.getNamespaceURI());
+        element(WSDLCMBASE_PREFIX + ":localName", qname.getLocalPart());
 
-		endElement();
-	}
+        endElement();
+    }
 
-	private void write(String tag, URI uri) {
+    private void write(String tag, URI uri) {
 
-		if (uri == null)
-			return;
+        if (uri == null)
+            return;
 
-		element(tag, uri.toString());
-	}
+        element(tag, uri.toString());
+    }
 
-	private void writeAny(String tag, Object o) {
+    private void writeAny(String tag, Object o) {
 
-		if (o == null)
-			return;
+        if (o == null)
+            return;
 
-		// TODO: write element content correctly
-		element(tag, o.toString());
-	}
+        // TODO: write element content correctly
+        element(tag, o.toString());
+    }
 
-	private void writeOptionalRef(String tag, Object o) {
+    private void writeOptionalRef(String tag, Object o) {
 
-		if (o == null)
-			return;
+        if (o == null)
+            return;
 
-		writeRef(tag, o);
-	}
+        writeRef(tag, o);
+    }
 
-	private void writeRef(String tag, Object o) {
+    private void writeRef(String tag, Object o) {
 
-		emptyElement(tag, refAttribute(o));
-	}
+        emptyElement(tag, refAttribute(o));
+    }
 
-	private void writeStyleUris(String tag, URI[] uris) {
+    private void writeUris(String tag, URI[] uris) {
 
-		if (uris.length == 0)
-			return;
+        if (uris.length == 0)
+            return;
 
-		Arrays.sort(uris);
+        Arrays.sort(uris);
 
-		beginElement(tag);
+        beginElement(tag);
 
-		for (int i = 0; i < uris.length; i++)
-			write(WSDLCMBASE_PREFIX + ":uri", uris[i]);
+        for (int i = 0; i < uris.length; i++)
+            write(WSDLCMBASE_PREFIX + ":uri", uris[i]);
 
-		endElement();
-	}
+        endElement();
+    }
 
-	private static String id(Object o) {
+    private static String id(Object o) {
 
-		if (o == null) {
-			return "id-null";
-		}
+        if (o == null) {
+            return "id-null";
+        }
 
-		return "id-" + o.hashCode();
-	}
+        return "id-" + o.hashCode();
+    }
 
-	private static String idAttribute(Object o) {
+    private static String idAttribute(Object o) {
 
-		return "xml:id='" + id(o) + "'";
-	}
+        return "xml:id='" + id(o) + "'";
+    }
 
-	private static String refAttribute(Object o) {
+    private static String refAttribute(Object o) {
 
-		return "ref='" + id(o) + "'";
-	}
+        return "ref='" + id(o) + "'";
+    }
 
-	private static int compareQName(QName q1, QName q2) {
+    private static int compareQName(QName q1, QName q2) {
 
-		if (q1.equals(q2))
-			return 0;
+        if (q1.equals(q2))
+            return 0;
 
-		String n1 = q1.getNamespaceURI();
-		String n2 = q2.getNamespaceURI();
-		if (n1.equals(n2)) {
-			String l1 = q1.getLocalPart();
-			String l2 = q2.getLocalPart();
+        String n1 = q1.getNamespaceURI();
+        String n2 = q2.getNamespaceURI();
+        if (n1.equals(n2)) {
+            String l1 = q1.getLocalPart();
+            String l2 = q2.getLocalPart();
 
-			return l1.compareTo(l2);
-		} else {
-			return n1.compareTo(n2);
-		}
-	}
+            return l1.compareTo(l2);
+        } else {
+            return n1.compareTo(n2);
+        }
+    }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: woden-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: woden-dev-help@ws.apache.org