Index: TesterWSDLUtils.java
===================================================================
--- TesterWSDLUtils.java	(revision 30520)
+++ TesterWSDLUtils.java	(working copy)
@@ -51,6 +51,7 @@
 import org.eclipse.core.runtime.Status;
 import org.jboss.tools.ws.core.utils.StatusUtils;
 import org.jboss.tools.ws.ui.messages.JBossWSUIMessages;
+import org.jdom.Element;
 import org.jdom.Namespace;
 import org.jdom.input.DOMBuilder;
 
@@ -102,6 +103,8 @@
 	public final static String SOAP12_NS_URI = "http://schemas.xmlsoap.org/wsdl/soap12/"; //$NON-NLS-1$
 	public final static String SOAP12_PREFIX = "soap12"; //$NON-NLS-1$
 	public final static String SOAP_PREFIX = "soap"; //$NON-NLS-1$
+	
+	private static final String NS_PREFIX = "ns1";
 
 	public static Definition readWSDLURL(URL contextURL, String wsdlLoc) throws WSDLException {
 		Properties props = System.getProperties();
@@ -234,8 +237,8 @@
 								Collection<?> parts = inputMsg.getParts().values();
 								StringBuffer buf = new StringBuffer();
 								if (parts.size() > 1) {
-									buf.append('<' + operation.getName());
-									buf.append(" xmlns = \"" + ns + "\""); //$NON-NLS-1$ //$NON-NLS-2$
+									buf.append('<' + NS_PREFIX + ":" + operation.getName());
+									buf.append(" xmlns:" + NS_PREFIX + " = \"" + ns + "\""); //$NON-NLS-1$ //$NON-NLS-2$
 									buf.append(">\n"); //$NON-NLS-1$
 								}
 								for( Iterator<?> it4 = parts.iterator(); it4.hasNext(); ) {
@@ -497,8 +500,8 @@
 									
 									if (rootName != null && rootName.equalsIgnoreCase(messageName)) {
 										StringBuffer buf = new StringBuffer();
-										buf.append('<' + rootName);
-										buf.append(" xmlns = \"" + namespace + "\""); //$NON-NLS-1$ //$NON-NLS-2$
+										buf.append('<' + NS_PREFIX + ":" + rootName);
+										buf.append(" xmlns:" + NS_PREFIX + " = \"" + namespace + "\""); //$NON-NLS-1$ //$NON-NLS-2$
 										buf.append(">\n"); //$NON-NLS-1$
 										if (!temp.getChildren().isEmpty()){
 											org.jdom.Element temp2 = (org.jdom.Element)temp.getChildren().get(0);
@@ -513,7 +516,7 @@
 												buf.append(elementStr);
 											}
 										}
-										buf.append("</" + rootName + ">\n");//$NON-NLS-1$//$NON-NLS-2$
+										buf.append("</" + NS_PREFIX + ":" + rootName + ">\n");//$NON-NLS-1$//$NON-NLS-2$
 										return buf.toString();
 									}
 								}
@@ -548,8 +551,10 @@
 								buf.append(partName);
 							}
 							else {
+								buf.append(NS_PREFIX);
+								buf.append(":");
 								buf.append(rootName);
-								buf.append(" xmlns = \"" + namespace + "\""); //$NON-NLS-1$ //$NON-NLS-2$
+								buf.append(" xmlns:" + NS_PREFIX + " = \"" + namespace + "\""); //$NON-NLS-1$ //$NON-NLS-2$
 							}
 							buf.append(">\n"); //$NON-NLS-1$
 							if (temp.getChildren().isEmpty()) {
@@ -576,8 +581,11 @@
 							buf.append("</");//$NON-NLS-1$
 							if (partName != null)
 								buf.append(partName);
-							else
+							else {
+								buf.append(NS_PREFIX);
+								buf.append(":");
 								buf.append(rootName);
+							}
 							buf.append(">\n");//$NON-NLS-1$
 							return buf.toString();
 						} else {
@@ -727,8 +735,13 @@
 			innerMinOccursNum = Integer.decode(innerMinOccurs);
 		}
 		if (innerChildName != null && !childEl.getName().contains(SIMPLE_TYPE_NAME)){
-			buf.append('<' + innerChildName);
-			buf.append(">"); //$NON-NLS-1$
+			buf.append('<');
+			if (isQualified(childEl)) {
+				buf.append(NS_PREFIX);
+				buf.append(':');
+			}
+			buf.append(innerChildName);
+			buf.append('>'); //$NON-NLS-1$
 		}
 		
 		if (childEl.getChildren().size() > 0) {
@@ -754,11 +767,28 @@
 			String elementStr = processType(wsdlDefinition, childEl, innerChildType, false);
 			buf.append(elementStr);
 		}
-		if (innerChildName != null && !childEl.getName().contains(SIMPLE_TYPE_NAME))
-			buf.append("</" + innerChildName + ">\n");  //$NON-NLS-1$//$NON-NLS-2$
+		if (innerChildName != null && !childEl.getName().contains(SIMPLE_TYPE_NAME)) {			
+			buf.append("</");
+			if (isQualified(childEl)) {
+				buf.append(NS_PREFIX);
+				buf.append(':');
+			}
+			buf.append(innerChildName);
+			buf.append(">\n"); //$NON-NLS-1$
+		}
 		return buf.toString();
 	}
 
+	private static boolean isQualified(Element el) {
+		Element e = el;
+		while (e.getParentElement() != null) {
+			e = e.getParentElement();
+		}
+		String x = e.getAttributeValue("elementFormDefault", "http://www.w3.org/2001/XMLSchema");
+		return x != null && "qualified".equalsIgnoreCase(x);
+	}
+	
+	
 	public static String createMessageForSchemaElement ( Definition wsdlDefinition, String partName, String messageName, String namespace ) {
 		Types types = wsdlDefinition.getTypes();
 		if (types == null || wsdlDefinition.getImports().size() > 0) {
