You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by ff...@apache.org on 2007/02/28 04:46:01 UTC

svn commit: r512593 - in /incubator/cxf/trunk/tools: common/src/main/java/org/apache/cxf/tools/util/ wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/ wsdl2java/src/test/java/org/apache/cxf/tools/wsdl2java/processor/ wsdl2java/...

Author: ffang
Date: Tue Feb 27 19:46:00 2007
New Revision: 512593

URL: http://svn.apache.org/viewvc?view=rev&rev=512593
Log:
[CXF-356] CodeGen Bug related to WebParam Annotation in a wrapped doc-lit style wsdl
                        

Added:
    incubator/cxf/trunk/tools/wsdl2java/src/test/resources/wsdl2java_wsdl/locator.wsdl   (with props)
Modified:
    incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/ProcessorUtil.java
    incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/OperationProcessor.java
    incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/ParameterProcessor.java
    incubator/cxf/trunk/tools/wsdl2java/src/test/java/org/apache/cxf/tools/wsdl2java/processor/WSDLToJavaProcessorTest.java

Modified: incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/ProcessorUtil.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/ProcessorUtil.java?view=diff&rev=512593&r1=512592&r2=512593
==============================================================================
--- incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/ProcessorUtil.java (original)
+++ incubator/cxf/trunk/tools/common/src/main/java/org/apache/cxf/tools/util/ProcessorUtil.java Tue Feb 27 19:46:00 2007
@@ -19,17 +19,28 @@
 
 package org.apache.cxf.tools.util;
 
+
 import java.io.File;
 import java.io.IOException;
 import java.net.MalformedURLException;
 import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collection;
 import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
 import java.util.Map;
 import java.util.StringTokenizer;
 
+import javax.wsdl.Definition;
+import javax.wsdl.Import;
 import javax.wsdl.Message;
 import javax.wsdl.Operation;
 import javax.wsdl.Part;
+import javax.wsdl.Types;
+import javax.wsdl.extensions.UnknownExtensibilityElement;
+import javax.wsdl.extensions.schema.Schema;
+import javax.wsdl.extensions.schema.SchemaImport;
 import javax.xml.namespace.QName;
 
 import org.w3c.dom.DOMException;
@@ -42,15 +53,24 @@
 
 import org.apache.cxf.helpers.JavaUtils;
 import org.apache.cxf.jaxb.JAXBUtils;
+import org.apache.cxf.resource.XmlSchemaURIResolver;
 import org.apache.cxf.tools.common.DataBindingGenerator;
 import org.apache.cxf.tools.common.ToolConstants;
 import org.apache.cxf.tools.common.ToolContext;
 import org.apache.cxf.tools.common.ToolException;
+import org.apache.ws.commons.schema.XmlSchemaCollection;
+import org.apache.ws.commons.schema.XmlSchemaComplexType;
+import org.apache.ws.commons.schema.XmlSchemaElement;
+import org.apache.ws.commons.schema.XmlSchemaObject;
+import org.apache.ws.commons.schema.XmlSchemaObjectCollection;
+import org.apache.ws.commons.schema.XmlSchemaSequence;
+
+import static org.apache.cxf.helpers.CastUtils.cast;
 
 public final class ProcessorUtil {
     //private static final Logger LOG = LogUtils.getL7dLogger(ProcessorUtil.class);
     private static final String KEYWORDS_PREFIX = "_";
-    
+    private static Map<String, Element> schemaList = new HashMap<String, Element>();
     private ProcessorUtil() {
     }
 
@@ -139,12 +159,40 @@
        
     }
 
-    public static String resolvePartNamespace(Part part) {
+    public static String resolvePartNamespace(Part part, Definition definition) {
         QName qname = part.getElementName();
+        
+        
+
         if (qname == null) {
             qname = part.getTypeName();
         }
         if (qname != null) {
+            XmlSchemaElement schemaElement = getSchemas(definition).getElementByQName(qname);
+            if (schemaElement != null 
+                && schemaElement.getSchemaType() instanceof XmlSchemaComplexType) {
+                XmlSchemaComplexType xsct = null;
+                
+                xsct = (XmlSchemaComplexType)schemaElement.getSchemaType();
+                if (xsct.getParticle() instanceof XmlSchemaSequence) {
+                    XmlSchemaSequence seq = (XmlSchemaSequence)xsct.getParticle();
+                    XmlSchemaObjectCollection items = seq.getItems();
+
+                    for (int x = 0; x < items.getCount(); x++) {
+                        XmlSchemaObject o = items.getItem(x);
+                        XmlSchemaElement el = null;
+                        if (o instanceof XmlSchemaElement) {   
+                            el = (XmlSchemaElement)o;
+                        }
+                        
+                        if (el != null && el.getRefName() != null) {
+                            return el.getRefName().getNamespaceURI();
+                        }
+                    }
+                }
+                
+                
+            }
             return qname.getNamespaceURI();
         } else {
             return null;
@@ -461,5 +509,128 @@
         }
         return clone;
     }
+    
+    public static XmlSchemaCollection getSchemas(Definition def) {
+        XmlSchemaCollection schemaCol = new XmlSchemaCollection();
+        
+        List<Definition> defList = new ArrayList<Definition>();
+        parseImports(def, defList);
+        extractSchema(def, schemaCol);
+        // added
+        getSchemaList(def);
+        for (Definition def2 : defList) {
+            extractSchema(def2, schemaCol);
+            // added
+            getSchemaList(def2);
+        }
+
+        return schemaCol;
+    }
+
+    private static void parseImports(Definition def, List<Definition> defList) {
+        List<Import> importList = new ArrayList<Import>();
+
+        Collection<List<Import>> ilist = cast(def.getImports().values());
+        for (List<Import> list : ilist) {
+            importList.addAll(list);
+        }
+        for (Import impt : importList) {
+            parseImports(impt.getDefinition(), defList);
+            defList.add(impt.getDefinition());
+        }
+    }
+
+    private static void extractSchema(Definition def, XmlSchemaCollection schemaCol) {
+        Types typesElement = def.getTypes();
+        if (typesElement != null) {
+            for (Object obj : typesElement.getExtensibilityElements()) {
+                org.w3c.dom.Element schemaElem = null;
+                if (obj instanceof Schema) {
+                    Schema schema = (Schema)obj;
+                    schemaElem = schema.getElement();
+                } else if (obj instanceof UnknownExtensibilityElement) {
+                    org.w3c.dom.Element elem = ((UnknownExtensibilityElement)obj).getElement();
+                    if (elem.getLocalName().equals("schema")) {
+                        schemaElem = elem;
+                    }
+                }
+                if (schemaElem != null) { // && schemaElem.getNodeValue() != null) {
+                    for (Object prefix : def.getNamespaces().keySet()) {
+                        String ns = (String)def.getNamespaces().get(prefix);
+                        if (!"".equals(prefix) && !schemaElem.hasAttribute("xmlns:" + prefix)) {
+                            schemaElem.setAttributeNS(javax.xml.XMLConstants.XMLNS_ATTRIBUTE_NS_URI,
+                                                      "xmlns:" + prefix, ns);
+                        }
+                    }
+                    try {
+                        schemaCol.setBaseUri(def.getDocumentBaseURI());
+                        schemaCol.setSchemaResolver(new XmlSchemaURIResolver());
+                   
+                        schemaCol.read(schemaElem);
+                    } catch (Exception e) {
+                        //e.printStackTrace();
+                    }
+                    
+                }
+            }
+        }
+    }
+
+    private static void getSchemaList(Definition def) {
+        Types typesElement = def.getTypes();
+        if (typesElement != null) {
+            Iterator ite = typesElement.getExtensibilityElements().iterator();
+            while (ite.hasNext()) {
+                Object obj = ite.next();
+                if (obj instanceof Schema) {
+                    Schema schema = (Schema)obj;
+                    addSchema(schema);
+                }
+            }
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    private static void addSchema(Schema schema) {
+        if (schemaList.get(schema.getDocumentBaseURI()) == null) {
+            schemaList.put(schema.getDocumentBaseURI(), schema.getElement());
+        } else {
+            String tns = schema.getDocumentBaseURI() + "#"
+                         + schema.getElement().getAttribute("targetNamespace");
+            if (schemaList.get(tns) == null) {
+                schemaList.put(tns, schema.getElement());
+            }
+        }
+        
+        Map<String, List> imports = schema.getImports();
+        if (imports != null && imports.size() > 0) {
+            Collection<String> importKeys = imports.keySet();
+            for (String importNamespace : importKeys) {
+                if (importNamespace != null 
+                    && !isSchemaParsed(schema.getDocumentBaseURI(), importNamespace)) {
+                    List<SchemaImport> schemaImports = imports.get(importNamespace);
+                    for (SchemaImport schemaImport : schemaImports) {
+                        Schema tempImport = schemaImport.getReferencedSchema();
+                        if (tempImport != null && !schemaList.containsValue(tempImport.getElement())) {
+                            addSchema(tempImport);
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+    private static boolean isSchemaParsed(String baseUri, String ns) {
+        if (schemaList.get(baseUri) != null) {
+            Element ele = schemaList.get(baseUri);
+            String tns = ele.getAttribute("targetNamespace");
+            if (ns.equals(tns)) {
+                return true;
+            }
+        }
+        return false;
+    }
+    
+    
 
 }

Modified: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/OperationProcessor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/OperationProcessor.java?view=diff&rev=512593&r1=512592&r2=512593
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/OperationProcessor.java (original)
+++ incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/OperationProcessor.java Tue Feb 27 19:46:00 2007
@@ -26,6 +26,7 @@
 import java.util.logging.Level;
 
 import javax.jws.soap.SOAPBinding;
+import javax.wsdl.Definition;
 import javax.wsdl.Fault;
 import javax.wsdl.Message;
 import javax.wsdl.Operation;
@@ -52,8 +53,10 @@
     private JavaParameter wrapperRequest;
     private JavaParameter wrapperResponse;
 
+    private Definition definition;
     public OperationProcessor(ToolContext penv) {
         super(penv);
+        definition = (Definition)penv.get(ToolConstants.WSDL_DEFINITION);
     }
 
     @SuppressWarnings("unchecked")
@@ -273,7 +276,7 @@
             wrapperRequest = new JavaParameter();
             wrapperRequest.setName(ProcessorUtil.resolvePartName(inputPart));
             wrapperRequest.setType(ProcessorUtil.getPartType(inputPart));
-            wrapperRequest.setTargetNamespace(ProcessorUtil.resolvePartNamespace(inputPart));
+            wrapperRequest.setTargetNamespace(ProcessorUtil.resolvePartNamespace(inputPart, definition));
 
             wrapperRequest.setClassName(ProcessorUtil.getFullClzName(inputPart, 
                                                                      this.env, this.collector, false));
@@ -283,7 +286,7 @@
             wrapperResponse = new JavaParameter();
             wrapperResponse.setName(ProcessorUtil.resolvePartName(outputPart));
             wrapperResponse.setType(ProcessorUtil.getPartType(outputPart));
-            wrapperResponse.setTargetNamespace(ProcessorUtil.resolvePartNamespace(outputPart));
+            wrapperResponse.setTargetNamespace(ProcessorUtil.resolvePartNamespace(outputPart, definition));
 
             wrapperResponse.setClassName(ProcessorUtil.getFullClzName(outputPart, 
                                                                       this.env, this.collector, false));

Modified: incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/ParameterProcessor.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/ParameterProcessor.java?view=diff&rev=512593&r1=512592&r2=512593
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/ParameterProcessor.java (original)
+++ incubator/cxf/trunk/tools/wsdl2java/src/main/java/org/apache/cxf/tools/wsdl2java/processor/internal/ParameterProcessor.java Tue Feb 27 19:46:00 2007
@@ -59,11 +59,12 @@
     
     private Map<String, Element> wsdlElementMap = new HashMap<String, Element>();
     private Map<String, String>  wsdlLoc = new HashMap<String, String>();
+    private Definition definition;
     
     @SuppressWarnings("unchecked")
     public ParameterProcessor(ToolContext penv) {
         super(penv);
-        Definition definition = (Definition)penv.get(ToolConstants.WSDL_DEFINITION);
+        definition = (Definition)penv.get(ToolConstants.WSDL_DEFINITION);
         wsdlLoc.put(definition.getTargetNamespace(), definition.getDocumentBaseURI());
         List<Definition> defs = (List<Definition>)penv.get(ToolConstants.IMPORTED_DEFINITION);
         for (Definition def : defs) {
@@ -104,7 +105,7 @@
 
     private JavaParameter getParameterFromPart(JavaMethod method, Part part, JavaType.Style style) {
         String name = ProcessorUtil.resolvePartName(part);
-        String namespace = ProcessorUtil.resolvePartNamespace(part);
+        String namespace = ProcessorUtil.resolvePartNamespace(part, definition);
         String type = ProcessorUtil.resolvePartType(part, this.env);
 
         JavaParameter parameter = new JavaParameter(name, type, namespace);
@@ -120,6 +121,7 @@
             parameter.setHolderClass(ProcessorUtil.getFullClzName(part, env, this.collector, true));
         }
         parameter.setStyle(style);
+        
         return parameter;
     }
 
@@ -155,6 +157,9 @@
         webParamAnnotation.addArgument("name", name);
         if (method.getSoapStyle() == SOAPBinding.Style.DOCUMENT
             || parameter.isHeader()) {
+            if (parameter.getTypeReference() != null) {
+                targetNamespace = parameter.getTypeReference().tagName.getNamespaceURI();
+            }
             webParamAnnotation.addArgument("targetNamespace", targetNamespace);
         }
 
@@ -169,7 +174,7 @@
         String name = part == null ? "return" : part.getName();
         String type = part == null ? "void" : ProcessorUtil.resolvePartType(part, this.env);
  
-        String namespace = part == null ? null : ProcessorUtil.resolvePartNamespace(part);
+        String namespace = part == null ? null : ProcessorUtil.resolvePartNamespace(part, definition);
               
         JavaReturn returnType = new JavaReturn(name, type, namespace);
         returnType.setQName(ProcessorUtil.getElementName(part));
@@ -434,7 +439,7 @@
 
     private JavaParameter getParameterFromProperty(Property property, JavaType.Style style, Part part) {
         JType t = property.type();
-        String targetNamespace = ProcessorUtil.resolvePartNamespace(part);
+        String targetNamespace = ProcessorUtil.resolvePartNamespace(part, definition);
         if (targetNamespace == null) {
             targetNamespace = property.elementName().getNamespaceURI();
         }
@@ -451,7 +456,7 @@
 
     private JavaReturn getReturnFromProperty(Property property, Part part) {
         JType t = property.type();
-        String targetNamespace = ProcessorUtil.resolvePartNamespace(part);
+        String targetNamespace = ProcessorUtil.resolvePartNamespace(part, definition);
         if (targetNamespace == null) {
             targetNamespace = property.elementName().getNamespaceURI();
         }

Modified: incubator/cxf/trunk/tools/wsdl2java/src/test/java/org/apache/cxf/tools/wsdl2java/processor/WSDLToJavaProcessorTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/test/java/org/apache/cxf/tools/wsdl2java/processor/WSDLToJavaProcessorTest.java?view=diff&rev=512593&r1=512592&r2=512593
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/test/java/org/apache/cxf/tools/wsdl2java/processor/WSDLToJavaProcessorTest.java (original)
+++ incubator/cxf/trunk/tools/wsdl2java/src/test/java/org/apache/cxf/tools/wsdl2java/processor/WSDLToJavaProcessorTest.java Tue Feb 27 19:46:00 2007
@@ -1144,7 +1144,36 @@
         assertNotNull("Server should be generated", greeterServer);
     }
     
-    
+    public void testRefTNS() throws Exception {
+        env.put(ToolConstants.CFG_WSDLURL, getLocation("/wsdl2java_wsdl/locator.wsdl"));
+        processor.setEnvironment(env);
+        processor.process();
+
+        assertNotNull(output);
+
+        File org = new File(output, "org");
+        assertTrue(org.exists());
+        File apache = new File(org, "apache");
+        assertTrue(apache.exists());
+        File locator = new File(apache, "locator");
+        assertTrue(locator.exists());
+        File locatorService = new File(locator, "LocatorService.java");
+        assertTrue(locatorService.exists());
+        
+
+        Class<?> clz = classLoader.loadClass("org.apache.locator.LocatorService");
+
+        javax.jws.WebService ws = AnnotationUtil.getPrivClassAnnotation(clz, javax.jws.WebService.class);
+        assertTrue("Webservice annotation wsdlLocation should begin with file", ws.wsdlLocation()
+            .startsWith("file"));
+        
+        Class<?> paraClass = classLoader.loadClass("org.apache.locator.query.QuerySelectType");
+        Method method = clz.getMethod("queryEndpoints", new Class[] {paraClass});
+        WebParam webParamAnn = AnnotationUtil.getWebParam(method, "select");
+        assertEquals("http://apache.org/locator/query", webParamAnn.targetNamespace());
+        
+        
+    }
     
     private String getLocation(String wsdlFile) {
         return WSDLToJavaProcessorTest.class.getResource(wsdlFile).getFile();

Added: incubator/cxf/trunk/tools/wsdl2java/src/test/resources/wsdl2java_wsdl/locator.wsdl
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdl2java/src/test/resources/wsdl2java_wsdl/locator.wsdl?view=auto&rev=512593
==============================================================================
--- incubator/cxf/trunk/tools/wsdl2java/src/test/resources/wsdl2java_wsdl/locator.wsdl (added)
+++ incubator/cxf/trunk/tools/wsdl2java/src/test/resources/wsdl2java_wsdl/locator.wsdl Tue Feb 27 19:46:00 2007
@@ -0,0 +1,514 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements. See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership. The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License. You may obtain a copy of the License at
+                                                                                                                                                             
+  http://www.apache.org/licenses/LICENSE-2.0
+                                                                                                                                                             
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied. See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+
+<definitions targetNamespace="http://apache.org/locator" 
+    xmlns="http://schemas.xmlsoap.org/wsdl/" 
+    xmlns:ls="http://apache.org/locator" 
+    xmlns:query="http://apache.org/locator/query" 
+    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
+    xmlns:tns="http://apache.org/locator/types" 
+    xmlns:wsa="http://www.w3.org/2005/08/addressing" 
+    xmlns:xs="http://www.w3.org/2001/XMLSchema">
+    <types>
+        <xs:schema attributeFormDefault="unqualified" blockDefault="#all" 
+            elementFormDefault="qualified" finalDefault="" 
+            targetNamespace="http://www.w3.org/2005/08/addressing" 
+            xmlns:tns="http://www.w3.org/2005/08/addressing">
+            <xs:element name="EndpointReference" type="tns:EndpointReferenceType"/>
+            <xs:complexType mixed="false" name="EndpointReferenceType">
+                <xs:sequence>
+                    <xs:element name="Address" type="tns:AttributedURIType"/>
+                    <xs:element minOccurs="0" name="ReferenceParameters" 
+                        type="tns:ReferenceParametersType"/>
+                    <xs:element minOccurs="0" ref="tns:Metadata"/>
+                    <xs:any maxOccurs="unbounded" minOccurs="0" namespace="##other" 
+                        processContents="lax"/>
+                </xs:sequence>
+                <xs:anyAttribute namespace="##other" processContents="lax"/>
+            </xs:complexType>
+            <xs:complexType mixed="false" name="ReferenceParametersType">
+                <xs:sequence>
+                    <xs:any maxOccurs="unbounded" minOccurs="0" namespace="##any" 
+                        processContents="lax"/>
+                </xs:sequence>
+                <xs:anyAttribute namespace="##other" processContents="lax"/>
+            </xs:complexType>
+            <xs:element name="Metadata" type="tns:MetadataType"/>
+            <xs:complexType mixed="false" name="MetadataType">
+                <xs:sequence>
+                    <xs:any maxOccurs="unbounded" minOccurs="0" namespace="##any" 
+                        processContents="lax"/>
+                </xs:sequence>
+                <!--
+    Until anyAttribute is supported, explicitly include the
+             wsdlLocation attribute definition.
+
+    <xs:anyAttribute namespace="##other" processContents="lax"/>
+-->
+                <xs:attribute name="wsdlLocation" type="xs:string" use="optional"/>
+            </xs:complexType>
+            <xs:element name="MessageID" type="tns:AttributedURIType"/>
+            <xs:element name="RelatesTo" type="tns:RelatesToType"/>
+            <xs:complexType mixed="false" name="RelatesToType">
+                <xs:simpleContent>
+                    <xs:extension base="xs:anyURI">
+                        <xs:attribute name="RelationshipType" 
+                            type="tns:RelationshipTypeOpenEnum" use="optional"/>
+                        <xs:anyAttribute namespace="##other" processContents="lax"/>
+                    </xs:extension>
+                </xs:simpleContent>
+            </xs:complexType>
+            <xs:simpleType name="RelationshipTypeOpenEnum">
+                <xs:union memberTypes="tns:RelationshipType xs:anyURI"/>
+            </xs:simpleType>
+            <xs:simpleType name="RelationshipType">
+                <xs:restriction base="xs:anyURI">
+                    <xs:enumeration value="http://www.w3.org/2005/08/addressing/reply"/>
+                </xs:restriction>
+            </xs:simpleType>
+            <xs:element name="ReplyTo" type="tns:EndpointReferenceType"/>
+            <xs:element name="From" type="tns:EndpointReferenceType"/>
+            <xs:element name="FaultTo" type="tns:EndpointReferenceType"/>
+            <xs:element name="To" type="tns:AttributedURIType"/>
+            <xs:element name="Action" type="tns:AttributedURIType"/>
+            <xs:complexType mixed="false" name="AttributedURIType">
+                <xs:simpleContent>
+                    <xs:extension base="xs:anyURI">
+                        <xs:anyAttribute namespace="##other" processContents="lax"/>
+                    </xs:extension>
+                </xs:simpleContent>
+            </xs:complexType>
+            <xs:attribute name="IsReferenceParameter" type="xs:boolean"/>
+            <xs:simpleType name="FaultCodesOpenEnumType">
+                <xs:union memberTypes="tns:FaultCodesType xs:QName"/>
+            </xs:simpleType>
+            <xs:simpleType name="FaultCodesType">
+                <xs:restriction base="xs:QName">
+                    <xs:enumeration value="tns:InvalidAddressingHeader"/>
+                    <xs:enumeration value="tns:InvalidAddress"/>
+                    <xs:enumeration value="tns:InvalidEPR"/>
+                    <xs:enumeration value="tns:InvalidCardinality"/>
+                    <xs:enumeration value="tns:MissingAddressInEPR"/>
+                    <xs:enumeration value="tns:DuplicateMessageID"/>
+                    <xs:enumeration value="tns:ActionMismatch"/>
+                    <xs:enumeration value="tns:MessageAddressingHeaderRequired"/>
+                    <xs:enumeration value="tns:DestinationUnreachable"/>
+                    <xs:enumeration value="tns:ActionNotSupported"/>
+                    <xs:enumeration value="tns:EndpointUnavailable"/>
+                </xs:restriction>
+            </xs:simpleType>
+            <xs:element name="RetryAfter" type="tns:AttributedUnsignedLongType"/>
+            <xs:complexType mixed="false" name="AttributedUnsignedLongType">
+                <xs:simpleContent>
+                    <xs:extension base="xs:unsignedLong">
+                        <xs:anyAttribute namespace="##other" processContents="lax"/>
+                    </xs:extension>
+                </xs:simpleContent>
+            </xs:complexType>
+            <xs:element name="ProblemHeaderQName" type="tns:AttributedQNameType"/>
+            <xs:complexType mixed="false" name="AttributedQNameType">
+                <xs:simpleContent>
+                    <xs:extension base="xs:QName">
+                        <xs:anyAttribute namespace="##other" processContents="lax"/>
+                    </xs:extension>
+                </xs:simpleContent>
+            </xs:complexType>
+            <xs:element name="ProblemHeader" type="tns:AttributedAnyType"/>
+            <xs:complexType mixed="false" name="AttributedAnyType">
+                <xs:sequence>
+                    <xs:any maxOccurs="1" minOccurs="1" namespace="##any" 
+                        processContents="lax"/>
+                </xs:sequence>
+                <xs:anyAttribute namespace="##other" processContents="lax"/>
+            </xs:complexType>
+            <xs:element name="ProblemIRI" type="tns:AttributedURIType"/>
+            <xs:element name="ProblemAction" type="tns:ProblemActionType"/>
+            <xs:complexType mixed="false" name="ProblemActionType">
+                <xs:sequence>
+                    <xs:element minOccurs="0" ref="tns:Action"/>
+                    <xs:element minOccurs="0" name="SoapAction" type="xs:anyURI"/>
+                </xs:sequence>
+                <xs:anyAttribute namespace="##other" processContents="lax"/>
+            </xs:complexType>
+        </xs:schema>
+        <xs:schema elementFormDefault="qualified" 
+            targetNamespace="http://apache.org/locator/query" 
+            xmlns:tns="http://apache.org/locator/query">
+            <xs:simpleType name="FieldEnumeratedType">
+                <xs:restriction base="xs:string">
+                    <xs:enumeration value="GROUP"/>
+                    <xs:enumeration value="SERVICE"/>
+                    <xs:enumeration value="PORTNAME"/>
+                    <xs:enumeration value="INTERFACE"/>
+                    <xs:enumeration value="BINDING"/>
+                    <xs:enumeration value="EXTENSOR"/>
+                </xs:restriction>
+            </xs:simpleType>
+            <xs:simpleType name="FilterFieldType">
+                <xs:union memberTypes="tns:FieldEnumeratedType xs:string"/>
+            </xs:simpleType>
+            <xs:complexType name="FilterType">
+                <xs:simpleContent>
+                    <xs:extension base="xs:string">
+                        <xs:attribute name="field" type="tns:FilterFieldType" 
+                            use="required"/>
+                    </xs:extension>
+                </xs:simpleContent>
+            </xs:complexType>
+            <xs:complexType name="QuerySelectType">
+                <xs:sequence>
+                    <xs:element maxOccurs="unbounded" minOccurs="0" name="filter" 
+                        type="tns:FilterType"/>
+                    <xs:any minOccurs="0" namespace="##other" processContents="lax"/>
+                </xs:sequence>
+            </xs:complexType>
+            <xs:element name="select" type="tns:QuerySelectType"/>
+        </xs:schema>
+        <xs:schema targetNamespace="http://apache.org/locator/extensions">
+            <xs:element name="group" type="xs:string"/>
+        </xs:schema>
+        <xs:schema targetNamespace="http://apache.org/locator/types">
+            <xs:import namespace="http://www.w3.org/2005/08/addressing"/>
+            <xs:import namespace="http://apache.org/locator/query"/>
+            <xs:complexType name="EmptyMessage">
+                <xs:sequence/>
+            </xs:complexType>
+            <xs:complexType name="EndpointIdentity">
+                <xs:annotation>
+                    <xs:documentation>Extensible endpoint identity type.</xs:documentation>
+                </xs:annotation>
+                <xs:sequence>
+                    <xs:element name="node_id" type="xs:string"/>
+                    <xs:element name="service_qname" type="xs:QName"/>
+                    <xs:any maxOccurs="unbounded" minOccurs="0" namespace="##other" 
+                        processContents="lax"/>
+                </xs:sequence>
+            </xs:complexType>
+            <xs:element name="registerPeerManager">
+                <xs:annotation>
+                    <xs:documentation>Input message element for &quot;registerPeerManager&quot; operation.</xs:documentation>
+                </xs:annotation>
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element name="peer_manager" type="wsa:EndpointReferenceType"/>
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="registerPeerManagerResponse">
+                <xs:annotation>
+                    <xs:documentation>Output message element for &quot;registerPeerManager&quot; operation.</xs:documentation>
+                </xs:annotation>
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element name="peer_manager_reference" 
+                            type="wsa:EndpointReferenceType"/>
+                        <xs:element name="node_id" type="xs:string"/>
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="deregisterPeerManager">
+                <xs:annotation>
+                    <xs:documentation>Input message element for &quot;deregisterPeerManager&quot; operation.</xs:documentation>
+                </xs:annotation>
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element name="node_id" type="xs:string"/>
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="deregisterPeerManagerResponse" type="tns:EmptyMessage"/>
+            <xs:element name="registerEndpoint">
+                <xs:annotation>
+                    <xs:documentation>Input message element for &quot;registerEndpoint&quot; operation.</xs:documentation>
+                </xs:annotation>
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element name="endpoint_id" type="tns:EndpointIdentity"/>
+                        <xs:element name="endpoint_reference" 
+                            type="wsa:EndpointReferenceType"/>
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="registerEndpointResponse" type="tns:EmptyMessage"/>
+            <xs:element name="deregisterEndpoint">
+                <xs:annotation>
+                    <xs:documentation>Input message element for &quot;deregisterEndpoint&quot; operation.</xs:documentation>
+                </xs:annotation>
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element name="endpoint_id" type="tns:EndpointIdentity"/>
+                        <xs:element name="endpoint_reference" 
+                            type="wsa:EndpointReferenceType"/>
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="deregisterEndpointResponse" type="tns:EmptyMessage"/>
+            <xs:element name="lookupEndpoint">
+                <xs:annotation>
+                    <xs:documentation>Input message element for &quot;lookupEndpoint&quot; operation.</xs:documentation>
+                </xs:annotation>
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element name="service_qname" type="xs:QName"/>
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="lookupEndpointResponse">
+                <xs:annotation>
+                    <xs:documentation>Output message element for &quot;lookupEndpoint&quot; operation.</xs:documentation>
+                </xs:annotation>
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element name="service_endpoint" 
+                            type="wsa:EndpointReferenceType"/>
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="listEndpoints" type="tns:EmptyMessage"/>
+            <xs:element name="listEndpointsResponse">
+                <xs:annotation>
+                    <xs:documentation>Output message element for &quot;listEndpoints&quot; operation.</xs:documentation>
+                </xs:annotation>
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element maxOccurs="unbounded" minOccurs="0" name="endpoint">
+                            <xs:complexType>
+                                <xs:sequence>
+                                    <xs:element name="endpoint_id" 
+                                        type="tns:EndpointIdentity"/>
+                                    <xs:element name="endpoint_reference" 
+                                        type="wsa:EndpointReferenceType"/>
+                                </xs:sequence>
+                            </xs:complexType>
+                        </xs:element>
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="queryEndpoints">
+                <xs:annotation>
+                    <xs:documentation>Input message element for &quot;queryEndpoints&quot; operation.</xs:documentation>
+                </xs:annotation>
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element ref="query:select"/>
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="queryEndpointsResponse">
+                <xs:annotation>
+                    <xs:documentation>Output message element for &quot;queryEndpoints&quot; operation.</xs:documentation>
+                </xs:annotation>
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element maxOccurs="unbounded" minOccurs="0" name="endpoint">
+                            <xs:complexType>
+                                <xs:sequence>
+                                    <xs:element name="endpoint_id" 
+                                        type="tns:EndpointIdentity"/>
+                                    <xs:element name="endpoint_reference" 
+                                        type="wsa:EndpointReferenceType"/>
+                                </xs:sequence>
+                            </xs:complexType>
+                        </xs:element>
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:complexType name="EndpointNotExistFaultException">
+                <xs:annotation>
+                    <xs:documentation>Fault exception when no endpoint available.</xs:documentation>
+                </xs:annotation>
+                <xs:sequence>
+                    <xs:element name="error" type="xs:string"/>
+                </xs:sequence>
+            </xs:complexType>
+            <xs:element name="EndpointNotExistFault" 
+                type="tns:EndpointNotExistFaultException"/>
+        </xs:schema>
+    </types>
+    <message name="registerPeerManagerInput">
+        <part element="tns:registerPeerManager" name="parameters"/>
+    </message>
+    <message name="registerPeerManagerOutput">
+        <part element="tns:registerPeerManagerResponse" name="parameters"/>
+    </message>
+    <message name="deregisterPeerManagerInput">
+        <part element="tns:deregisterPeerManager" name="parameters"/>
+    </message>
+    <message name="deregisterPeerManagerOutput">
+        <part element="tns:deregisterPeerManagerResponse" name="parameters"/>
+    </message>
+    <message name="registerEndpointInput">
+        <part element="tns:registerEndpoint" name="parameters"/>
+    </message>
+    <message name="registerEndpointOutput">
+        <part element="tns:registerEndpointResponse" name="parameters"/>
+    </message>
+    <message name="deregisterEndpointInput">
+        <part element="tns:deregisterEndpoint" name="parameters"/>
+    </message>
+    <message name="deregisterEndpointOutput">
+        <part element="tns:deregisterEndpointResponse" name="parameters"/>
+    </message>
+    <message name="lookupEndpointInput">
+        <part element="tns:lookupEndpoint" name="parameters"/>
+    </message>
+    <message name="lookupEndpointOutput">
+        <part element="tns:lookupEndpointResponse" name="parameters"/>
+    </message>
+    <message name="listEndpointInput">
+        <part element="tns:listEndpoints" name="parameters"/>
+    </message>
+    <message name="listEndpointOutput">
+        <part element="tns:listEndpointsResponse" name="parameters"/>
+    </message>
+    <message name="queryEndpointInput">
+        <part element="tns:queryEndpoints" name="parameters"/>
+    </message>
+    <message name="queryEndpointOutput">
+        <part element="tns:queryEndpointsResponse" name="parameters"/>
+    </message>
+    <message name="endpointNotExistFault">
+        <part element="tns:EndpointNotExistFault" name="parameters"/>
+    </message>
+    <portType name="LocatorService">
+        <operation name="registerPeerManager">
+            <xs:documentation>
+        Register a peer endpoint manager with the locator service. Once registered, 
+        the Locator associates the peer_id with the peer endpoint manager.
+      </xs:documentation>
+            <input message="ls:registerPeerManagerInput"/>
+            <output message="ls:registerPeerManagerOutput"/>
+        </operation>
+        <operation name="deregisterPeerManager">
+            <xs:documentation>
+        Deregister a peer endpoint manager with the locator service. Deregistering a
+        peer manager also deregisters all endpoints that were registered by it.
+      </xs:documentation>
+            <input message="ls:deregisterPeerManagerInput"/>
+            <output message="ls:deregisterPeerManagerOutput"/>
+        </operation>
+        <operation name="registerEndpoint">
+            <xs:documentation>
+        Register an endpoint to become available in the locator.  Once registered, an  
+        endpoint will be returned in response to the &quot;list_endpoints&quot; and &quot;query_endpoints&quot; operations.
+      </xs:documentation>
+            <input message="ls:registerEndpointInput"/>
+            <output message="ls:registerEndpointOutput"/>
+        </operation>
+        <operation name="deregisterEndpoint">
+            <xs:documentation>
+        Deregister an endpoint from the locator. Once deregistered an endpoint will
+        no longer be returned in response to the &quot;list_endpoints&quot; and &quot;query_endpoints operations.
+      </xs:documentation>
+            <input message="ls:deregisterEndpointInput"/>
+            <output message="ls:deregisterEndpointOutput"/>
+        </operation>
+        <operation name="lookupEndpoint">
+            <xs:documentation>Lookup an endpoint from the locator based on a QName.</xs:documentation>
+            <input message="ls:lookupEndpointInput"/>
+            <output message="ls:lookupEndpointOutput"/>
+            <fault message="ls:endpointNotExistFault" name="fault"/>
+        </operation>
+        <operation name="listEndpoints">
+            <xs:documentation>List all endpoints available in the locator.</xs:documentation>
+            <input message="ls:listEndpointInput"/>
+            <output message="ls:listEndpointOutput"/>
+        </operation>
+        <operation name="queryEndpoints">
+            <xs:documentation>List all endpoints available in the locator based on selection filters.</xs:documentation>
+            <input message="ls:queryEndpointInput"/>
+            <output message="ls:queryEndpointOutput"/>
+        </operation>
+    </portType>
+    <binding name="LocatorServiceBinding" type="ls:LocatorService">
+        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+        <operation name="registerPeerManager">
+            <soap:operation/>
+            <input>
+                <soap:body use="literal"/>
+            </input>
+            <output>
+                <soap:body use="literal"/>
+            </output>
+        </operation>
+        <operation name="deregisterPeerManager">
+            <soap:operation/>
+            <input>
+                <soap:body use="literal"/>
+            </input>
+            <output>
+                <soap:body use="literal"/>
+            </output>
+        </operation>
+        <operation name="registerEndpoint">
+            <soap:operation/>
+            <input>
+                <soap:body use="literal"/>
+            </input>
+            <output>
+                <soap:body use="literal"/>
+            </output>
+        </operation>
+        <operation name="deregisterEndpoint">
+            <soap:operation/>
+            <input>
+                <soap:body use="literal"/>
+            </input>
+            <output>
+                <soap:body use="literal"/>
+            </output>
+        </operation>
+        <operation name="lookupEndpoint">
+            <soap:operation/>
+            <input>
+                <soap:body use="literal"/>
+            </input>
+            <output>
+                <soap:body use="literal"/>
+            </output>
+            <fault name="fault">
+                <soap:fault name="fault" use="literal"/>
+            </fault>
+        </operation>
+        <operation name="listEndpoints">
+            <soap:operation/>
+            <input>
+                <soap:body use="literal"/>
+            </input>
+            <output>
+                <soap:body use="literal"/>
+            </output>
+        </operation>
+        <operation name="queryEndpoints">
+            <soap:operation/>
+            <input>
+                <soap:body use="literal"/>
+            </input>
+            <output>
+                <soap:body use="literal"/>
+            </output>
+        </operation>
+    </binding>
+    <service name="LocatorService">
+        <port binding="ls:LocatorServiceBinding" name="LocatorServicePort">
+            <soap:address location="http://localhost:6006/services/LocatorService"/>
+        </port>
+    </service>
+</definitions>

Propchange: incubator/cxf/trunk/tools/wsdl2java/src/test/resources/wsdl2java_wsdl/locator.wsdl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/cxf/trunk/tools/wsdl2java/src/test/resources/wsdl2java_wsdl/locator.wsdl
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: incubator/cxf/trunk/tools/wsdl2java/src/test/resources/wsdl2java_wsdl/locator.wsdl
------------------------------------------------------------------------------
    svn:mime-type = text/xml