You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by em...@apache.org on 2007/10/11 06:20:53 UTC
svn commit: r583674 - in /incubator/cxf/trunk/tools/wsdlto:
frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/
frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/
frontend/jaxws/src/test/j...
Author: ema
Date: Wed Oct 10 21:20:48 2007
New Revision: 583674
URL: http://svn.apache.org/viewvc?rev=583674&view=rev
Log:
Fixed issue CXF-1094, CXF-1095
Added:
incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/CustomizedWSDLLocator.java
incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1094/
incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1094/async_binding.xml
incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1094/echo_date.wsdl
incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1094/hello_world.wsdl
incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1094/hello_world_oneway.wsdl
incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1094/jaxbbinding.xml
incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1095/
incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1095/binding.xml
incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1095/binding1.xml
incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1095/hello_world_bindings.wsdl
incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1095/hello_world_messages.wsdl
incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1095/hello_world_services.wsdl
incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1095/hello_world_wsdl_import.wsdl
Modified:
incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java
incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/Messages.properties
incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/JAXWSDefinitionBuilder.java
incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParserTest.java
incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java
Modified: incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java?rev=583674&r1=583673&r2=583674&view=diff
==============================================================================
--- incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java (original)
+++ incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java Wed Oct 10 21:20:48 2007
@@ -18,11 +18,15 @@
*/
package org.apache.cxf.tools.wsdlto.frontend.jaxws.customization;
+import java.io.File;
+import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
+
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
+import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.logging.Logger;
@@ -41,7 +45,9 @@
import org.apache.cxf.common.logging.LogUtils;
import org.apache.cxf.common.util.StringUtils;
import org.apache.cxf.helpers.DOMUtils;
+import org.apache.cxf.helpers.FileUtils;
import org.apache.cxf.helpers.MapNamespaceContext;
+import org.apache.cxf.helpers.XMLUtils;
import org.apache.cxf.resource.URIResolver;
import org.apache.cxf.tools.common.ToolConstants;
import org.apache.cxf.tools.common.ToolContext;
@@ -55,8 +61,10 @@
private static final Logger LOG = LogUtils.getL7dLogger(CustomizationParser.class);
private ToolContext env;
- private final List<Element> jaxwsBindings = new ArrayList<Element>();
+ //map for jaxws binding and wsdl element
+ private final Map<Element, Element> jaxwsBindingsMap = new HashMap<Element, Element>();
private final List<InputSource> jaxbBindings = new ArrayList<InputSource>();
+ private final Map<String, Element> customizedElements = new HashMap<String, Element>();
private Element handlerChains;
private Element wsdlNode;
@@ -65,7 +73,7 @@
private CustomNodeSelector nodeSelector = new CustomNodeSelector();
public CustomizationParser() {
- jaxwsBindings.clear();
+ jaxwsBindingsMap.clear();
jaxbBindings.clear();
}
@@ -77,8 +85,9 @@
this.env = pe;
String[] bindingFiles;
try {
- this.wsdlURL = URIParserUtil.getAbsoluteURI((String)env.get(ToolConstants.CFG_WSDLURL));
- this.wsdlNode = this.getTargetNode(this.wsdlURL);
+ wsdlURL = URIParserUtil.getAbsoluteURI((String)env.get(ToolConstants.CFG_WSDLURL));
+ wsdlNode = getTargetNode(this.wsdlURL);
+ customizedElements.put(wsdlURL.toString(), wsdlNode);
bindingFiles = (String[])env.get(ToolConstants.CFG_BINDING);
if (bindingFiles == null) {
return;
@@ -97,9 +106,12 @@
}
}
- for (Element element : jaxwsBindings) {
+ for (Element element : jaxwsBindingsMap.keySet()) {
nodeSelector.addNamespaces(element);
- internalizeBinding(element, "");
+ Element targetNode = jaxwsBindingsMap.get(element);
+ internalizeBinding(element, targetNode, "");
+ String uri = element.getAttribute("wsdlLocation");
+ customizedElements.put(uri, targetNode);
}
buildHandlerChains();
}
@@ -129,7 +141,7 @@
private void buildHandlerChains() {
- for (Element jaxwsBinding : jaxwsBindings) {
+ for (Element jaxwsBinding : jaxwsBindingsMap.keySet()) {
NodeList nl = jaxwsBinding.getElementsByTagNameNS(ToolConstants.HANDLER_CHAINS_URI,
ToolConstants.HANDLER_CHAINS);
if (nl.getLength() == 0) {
@@ -207,13 +219,13 @@
}
}
- protected void internalizeBinding(Element bindings, String expression) {
+ protected void internalizeBinding(Element bindings, Element targetNode, String expression) {
if (bindings.getAttributeNode("wsdlLocation") != null) {
expression = "/";
}
if (isGlobaleBindings(bindings)) {
- String pfx = wsdlNode.getPrefix();
+ String pfx = targetNode.getPrefix();
if (pfx == null) {
pfx = "";
} else {
@@ -221,7 +233,7 @@
}
nodeSelector.addNamespaces(wsdlNode);
- Node node = nodeSelector.queryNode(wsdlNode, "//" + pfx + "definitions");
+ Node node = nodeSelector.queryNode(targetNode, "//" + pfx + "definitions");
copyBindingsToWsdl(node, bindings, nodeSelector.getNamespaceContext());
}
@@ -230,7 +242,7 @@
nodeSelector.addNamespaces(bindings);
- Node node = nodeSelector.queryNode(wsdlNode, expression);
+ Node node = nodeSelector.queryNode(targetNode, expression);
if (node == null) {
throw new ToolException(new Message("NODE_NOT_EXISTS",
LOG, new Object[] {expression}));
@@ -246,9 +258,10 @@
Element[] children = getChildElements(bindings, ToolConstants.NS_JAXWS_BINDINGS);
for (int i = 0; i < children.length; i++) {
if (children[i].getNodeType() == Node.ELEMENT_NODE) {
- internalizeBinding(children[i], expression);
+ internalizeBinding(children[i], targetNode, expression);
}
}
+
}
private void copyBindingsToWsdl(Node node, Node bindings, MapNamespaceContext ctx) {
@@ -345,50 +358,71 @@
StAXUtil.toStartTag(reader);
+ Element root = null;
+ try {
+ URIResolver resolver = new URIResolver(bindingFile);
+ root = DOMUtils.readXml(resolver.getInputStream()).getDocumentElement();
+ } catch (Exception e1) {
+ Message msg = new Message("CAN_NOT_READ_AS_ELEMENT", LOG, new Object[] {bindingFile});
+ throw new ToolException(msg, e1);
+ }
if (isValidJaxwsBindingFile(bindingFile, reader)) {
- Element root = null;
- try {
- URIResolver resolver = new URIResolver(bindingFile);
- root = DOMUtils.readXml(resolver.getInputStream()).getDocumentElement();
- } catch (Exception e1) {
- Message msg = new Message("CAN_NOT_READ_AS_ELEMENT", LOG, new Object[] {bindingFile});
- throw new ToolException(msg, e1);
- }
+
String wsdlLocation = root.getAttribute("wsdlLocation");
- URI wsdlURI = null;
- try {
- wsdlURI = new URI(wsdlLocation);
- } catch (URISyntaxException e) {
- Message msg = new Message("JAXWSBINDINGS_WSDLLOC_ERROR", LOG, new Object[] {wsdlLocation});
- throw new ToolException(msg);
- }
-
- if (!wsdlURI.isAbsolute()) {
+ Element targetNode;
+ if (!StringUtils.isEmpty(wsdlLocation)) {
+ URI wsdlURI = null;
try {
- URI baseURI = new URI(bindingFile);
- wsdlURI = baseURI.resolve(wsdlURI);
+ wsdlURI = new URI(wsdlLocation);
} catch (URISyntaxException e) {
- Message msg = new Message("NOT_URI", LOG, new Object[] {bindingFile});
- throw new ToolException(msg, e);
- }
-
- }
-
- URI normalizedURL = null;
- if (this.wsdlURL != null) {
- normalizedURL = URI.create(this.wsdlURL).normalize();
- }
+ Message msg = new Message("JAXWSBINDINGS_WSDLLOC_ERROR",
+ LOG, new Object[] {wsdlLocation});
+ throw new ToolException(msg);
+ }
+
+ if (!wsdlURI.isAbsolute()) {
+ try {
+ String base = URIParserUtil.getAbsoluteURI(bindingFile);
+ URI baseURI = new URI(base);
+ wsdlURI = baseURI.resolve(wsdlURI);
+ } catch (URISyntaxException e) {
+ Message msg = new Message("NOT_URI", LOG, new Object[] {bindingFile});
+ throw new ToolException(msg, e);
+ }
- if (wsdlURI.normalize().equals(normalizedURL)) {
- jaxwsBindings.add(root);
+ }
+ targetNode = this.getTargetNode(wsdlURI.toString());
+ if (targetNode == null) {
+ Message msg = new Message("CAN_NOT_FIND_BINDING_WSDL",
+ LOG, new Object[] {wsdlURI.normalize(), bindingFile});
+ throw new ToolException(msg);
+
+ }
+ root.setAttribute("wsdlLocation", wsdlURI.toString());
} else {
- Message msg = new Message("NOT_POINTTO_URL", LOG, new Object[] {bindingFile,
- wsdlURI.normalize(),
- normalizedURL});
- throw new ToolException(msg);
+ targetNode = this.getTargetNode(wsdlURL);
+ root.setAttribute("wsdlLocation", wsdlURL);
}
+ jaxwsBindingsMap.put(root, targetNode);
+
} else if (isValidJaxbBindingFile(reader)) {
- jaxbBindings.add(is);
+ String schemaLocation = root.getAttribute("schemaLocation");
+ if (StringUtils.isEmpty(schemaLocation)) {
+ root.setAttribute("schemaLocation", wsdlURL);
+ try {
+ File tmpFile = FileUtils.createTempFile("jaxbbinding", ".xml");
+ XMLUtils.writeTo(root, new FileOutputStream(tmpFile));
+ InputSource newis = new InputSource(URIParserUtil.getAbsoluteURI(tmpFile
+ .getAbsolutePath()));
+ jaxbBindings.add(newis);
+ tmpFile.deleteOnExit();
+ } catch (Exception e) {
+ Message msg = new Message("FAILED_TO_ADD_SCHEMALOACTION", LOG, bindingFile);
+ throw new ToolException(msg, e);
+ }
+ } else {
+ jaxbBindings.add(is);
+ }
} else {
Message msg = new Message("UNKNOWN_BINDING_FILE", LOG, bindingFile);
throw new ToolException(msg);
@@ -397,6 +431,7 @@
private boolean isValidJaxbBindingFile(XMLStreamReader reader) {
if (ToolConstants.JAXB_BINDINGS.equals(reader.getName())) {
+
return true;
}
return false;
@@ -404,10 +439,13 @@
private boolean isValidJaxwsBindingFile(String bindingLocation, XMLStreamReader reader) {
if (ToolConstants.JAXWS_BINDINGS.equals(reader.getName())) {
- String wsdlLocation = reader.getAttributeValue(null, "wsdlLocation");
+ //Comment this check , by default wsdlLocation value will be the user input wsdl url
+ /*
+ String wsdlLocation = reader.getAttributeValue(null, "wsdlLocation");
if (!StringUtils.isEmpty(wsdlLocation)) {
return true;
- }
+ }*/
+ return true;
}
return false;
@@ -452,8 +490,8 @@
return false;
}
- public Element getCustomizedWSDLElement() {
- return this.wsdlNode;
+ public Map<String, Element> getCustomizedWSDLElements() {
+ return this.customizedElements;
}
public List<InputSource> getJaxbBindings() {
Modified: incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/Messages.properties
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/Messages.properties?rev=583674&r1=583673&r2=583674&view=diff
==============================================================================
--- incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/Messages.properties (original)
+++ incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/Messages.properties Wed Oct 10 21:20:48 2007
@@ -20,10 +20,11 @@
#
STAX_PARSER_ERROR = StAX parser error, check your external binding file(s)
UNKNOWN_BINDING_FILE= Unknown external binding files : {0}
-NOT_POINTTO_URL = External binding file: {0} does not point to the specified wsdl: {2}, resolved as {1}
+CAN_NOT_FIND_BINDING_WSDL = Can not read the specified wsdl {0} that external binding file {1} points
JAXWSBINDINGS_WSDLLOC_ERROR = Attribute wsdlLocation value {0} in jaxws binding element is not an URI
ERROR_TARGETNODE_WITH_XPATH = XPath query {0} is identifying either multiple or no target nodes.
XPATH_ERROR = XPath query error , check the query expression : {0}
NOT_URI = Can not construct new URI with this string : {0}
CAN_NOT_READ_AS_ELEMENT = Can not read this file to a xml element : {0}
-NODE_NOT_EXISTS = Can not find any node with the XPath {0}
\ No newline at end of file
+NODE_NOT_EXISTS = Can not find any node with the XPath {0}
+FAILED_TO_ADD_SCHEMALOACTION = Failed to inject schmeaLoaction for binding file {0}
\ No newline at end of file
Added: incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/CustomizedWSDLLocator.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/CustomizedWSDLLocator.java?rev=583674&view=auto
==============================================================================
--- incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/CustomizedWSDLLocator.java (added)
+++ incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/CustomizedWSDLLocator.java Wed Oct 10 21:20:48 2007
@@ -0,0 +1,135 @@
+/**
+ * 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.
+ */
+package org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11;
+
+import java.io.StringReader;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.Map;
+
+import org.w3c.dom.Element;
+
+import org.xml.sax.InputSource;
+
+import org.apache.cxf.helpers.XMLUtils;
+import org.apache.cxf.resource.ExtendedURIResolver;
+import org.apache.xml.resolver.Catalog;
+
+public class CustomizedWSDLLocator implements javax.wsdl.xml.WSDLLocator {
+ private String wsdlUrl;
+ private ExtendedURIResolver resolver;
+
+ private String baseUri;
+ private String importedUri;
+
+ private Catalog catalogResolver;
+
+ private Map<String, Element> elementMap;
+ private String lastestImportURI;
+ private boolean resolveFormMap;
+
+ public CustomizedWSDLLocator(String wsdlUrl, Map<String, Element> map) {
+ this.wsdlUrl = wsdlUrl;
+ this.baseUri = this.wsdlUrl;
+ resolver = new ExtendedURIResolver();
+ elementMap = map;
+ }
+
+ public void setCatalogResolver(final Catalog cr) {
+ this.catalogResolver = cr;
+ }
+
+ private InputSource resolve(final String target, final String base) {
+ try {
+ String resolvedLocation = null;
+ if (catalogResolver != null) {
+ resolvedLocation = catalogResolver.resolveSystem(target);
+
+ if (resolvedLocation == null) {
+ resolvedLocation = catalogResolver.resolveURI(target);
+ }
+ if (resolvedLocation == null) {
+ resolvedLocation = catalogResolver.resolvePublic(target, base);
+ }
+ }
+ if (resolvedLocation == null) {
+ return this.resolver.resolve(target, base);
+ } else {
+ return this.resolver.resolve(resolvedLocation, base);
+ }
+ } catch (Exception e) {
+ throw new RuntimeException("Catalog resolve failed: ", e);
+ }
+ }
+
+ public InputSource getBaseInputSource() {
+ if (elementMap.get(baseUri) != null) {
+ Element ele = elementMap.get(baseUri);
+ String content = XMLUtils.toString(ele);
+ InputSource ins = new InputSource(new StringReader(content));
+ ins.setSystemId(baseUri);
+ return ins;
+
+ }
+ InputSource result = resolve(baseUri, null);
+ baseUri = resolver.getURI();
+ return result;
+ }
+ public String getBaseURI() {
+ return baseUri;
+ }
+ public String getLatestImportURI() {
+ if (this.resolveFormMap) {
+ return this.lastestImportURI;
+
+ }
+ return resolver.getLatestImportURI();
+ }
+ public InputSource getImportInputSource(String parent, String importLocation) {
+ baseUri = parent;
+ importedUri = importLocation;
+ try {
+ URI importURI = new URI(importLocation);
+ if (!importURI.isAbsolute()) {
+ URI parentURI = new URI(parent);
+ importURI = parentURI.resolve(importURI);
+ }
+
+ if (elementMap.get(importURI.toString()) != null) {
+ Element ele = elementMap.get(importURI.toString());
+ String content = XMLUtils.toString(ele);
+
+ InputSource ins = new InputSource(new StringReader(content));
+ ins.setSystemId(importURI.toString());
+ this.resolveFormMap = true;
+ this.lastestImportURI = importURI.toString();
+ return ins;
+ }
+
+ } catch (URISyntaxException e) {
+ throw new RuntimeException("Resolve " + importLocation + "Failed: ", e);
+ }
+ resolveFormMap = false;
+ return resolve(importedUri, baseUri);
+ }
+ public void close() {
+ resolver.close();
+ }
+
+}
Modified: incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/JAXWSDefinitionBuilder.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/JAXWSDefinitionBuilder.java?rev=583674&r1=583673&r2=583674&view=diff
==============================================================================
--- incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/JAXWSDefinitionBuilder.java (original)
+++ incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/JAXWSDefinitionBuilder.java Wed Oct 10 21:20:48 2007
@@ -20,13 +20,9 @@
package org.apache.cxf.tools.wsdlto.frontend.jaxws.wsdl11;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.InputStream;
-import java.io.OutputStream;
import java.util.Iterator;
import java.util.List;
+import java.util.Map;
import java.util.logging.Logger;
import javax.jws.soap.SOAPBinding;
@@ -40,18 +36,18 @@
import javax.wsdl.extensions.ExtensionRegistry;
import javax.wsdl.xml.WSDLReader;
-import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.xml.sax.InputSource;
+import org.apache.cxf.catalog.OASISCatalogManager;
import org.apache.cxf.common.i18n.Message;
import org.apache.cxf.common.logging.LogUtils;
-import org.apache.cxf.helpers.DOMUtils;
-import org.apache.cxf.helpers.FileUtils;
+
import org.apache.cxf.tools.common.ToolConstants;
import org.apache.cxf.tools.common.ToolException;
import org.apache.cxf.tools.util.SOAPBindingUtil;
+import org.apache.cxf.tools.util.URIParserUtil;
import org.apache.cxf.tools.validator.internal.WSDL11Validator;
import org.apache.cxf.tools.wsdlto.core.AbstractWSDLBuilder;
import org.apache.cxf.tools.wsdlto.frontend.jaxws.customization.CustomizationParser;
@@ -126,7 +122,7 @@
} catch (Exception e) {
Message msg = new Message("FAIL_TO_CREATE_WSDL_DEFINITION",
LOG,
- cusParser.getCustomizedWSDLElement().getBaseURI());
+ (String)context.get(ToolConstants.CFG_WSDLURL));
throw new RuntimeException(msg.toString(), e);
}
}
@@ -166,25 +162,17 @@
return true;
}
}
-
}
return false;
}
- private CustomizationParser getCustomizationParser() {
- return cusParser;
- }
+ private Definition buildCustomizedDefinition() throws Exception {
+ Map<String, Element> eleMap = cusParser.getCustomizedWSDLElements();
+ String wsdlUrl = URIParserUtil.getAbsoluteURI((String)context.get(ToolConstants.CFG_WSDLURL));
+ CustomizedWSDLLocator wsdlLocator = new CustomizedWSDLLocator(wsdlUrl, eleMap);
+ wsdlLocator.setCatalogResolver(OASISCatalogManager.getCatalogManager(bus).getCatalog());
+ return wsdlReader.readWSDL(wsdlLocator);
- private Definition buildCustomizedDefinition() throws Exception {
- File tmpFile = FileUtils.createTempFile("customzied", ".wsdl");
- OutputStream outs = new FileOutputStream(tmpFile);
- DOMUtils.writeXml(getCustomizationParser().getCustomizedWSDLElement(), outs);
- InputStream ins = new FileInputStream(new File(tmpFile.toURI()));
- Document wsdlDoc = DOMUtils.readXml(ins);
- Definition def = wsdlReader.readWSDL(this.wsdlDefinition.getDocumentBaseURI(),
- wsdlDoc);
- FileUtils.delete(tmpFile);
- return def;
}
public Definition getWSDLModel() {
Modified: incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParserTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParserTest.java?rev=583674&r1=583673&r2=583674&view=diff
==============================================================================
--- incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParserTest.java (original)
+++ incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParserTest.java Wed Oct 10 21:20:48 2007
@@ -76,7 +76,7 @@
Element jaxwsBinding = getDocumentElement("resources/external_jaxws.xml");
parser.setWSDLNode(wsdlDoc);
- parser.internalizeBinding(jaxwsBinding, "");
+ parser.internalizeBinding(jaxwsBinding, wsdlDoc, "");
File file = new File(output, "custom_test.wsdl");
XMLUtils.writeTo(wsdlDoc, new FileOutputStream(file));
@@ -94,7 +94,7 @@
Element jaxwsBinding = getDocumentElement("resources/external_jaxws_embed_jaxb.xml");
parser.setWSDLNode(wsdlDoc);
- parser.internalizeBinding(jaxwsBinding, "");
+ parser.internalizeBinding(jaxwsBinding, wsdlDoc, "");
String base = "wsdl:definitions/wsdl:types/xsd:schema/xsd:annotation/xsd:appinfo/";
String[] checkingPoints =
@@ -112,7 +112,7 @@
Element wsdlDoc = getDocumentElement("resources/test.wsdl");
Element jaxwsBinding = getDocumentElement("resources/external_jaxws_embed_jaxb_date.xml");
parser.setWSDLNode(wsdlDoc);
- parser.internalizeBinding(jaxwsBinding, "");
+ parser.internalizeBinding(jaxwsBinding, wsdlDoc, "");
String base = "wsdl:definitions/wsdl:types/xsd:schema/xsd:annotation/xsd:appinfo/";
String[] checkingPoints =
@@ -130,7 +130,7 @@
Element wsdlDoc = getDocumentElement("resources/hello_world.wsdl");
Element jaxwsBinding = getDocumentElement("resources/binding2.xml");
parser.setWSDLNode(wsdlDoc);
- parser.internalizeBinding(jaxwsBinding, "");
+ parser.internalizeBinding(jaxwsBinding, wsdlDoc, "");
String checkingPoint = "wsdl:definitions/wsdl:types/xsd:schema";
checkingPoint += "/xsd:element[@name='CreateProcess']/xsd:complexType/xsd:sequence";
Modified: incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java?rev=583674&r1=583673&r2=583674&view=diff
==============================================================================
--- incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java (original)
+++ incubator/cxf/trunk/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenBugTest.java Wed Oct 10 21:20:48 2007
@@ -22,6 +22,7 @@
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
+import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import javax.jws.WebService;
import javax.xml.namespace.QName;
@@ -305,6 +306,7 @@
output.getCanonicalPath() + "/classes", "-d",
output.getCanonicalPath(), "-b",
getLocation("/wsdl2java_wsdl/bug305924/binding2.xml"),
+ "-verbose",
getLocation("/wsdl2java_wsdl/bug305924/hello_world.wsdl")};
WSDLToJava.main(args);
} catch (Exception e) {
@@ -721,4 +723,72 @@
assertTrue(results.indexOf("public int getMessageLimit") != -1);
assertTrue(results.indexOf("header = true, name = \"MessengerHeader") != -1);
}
+
+ @Test
+ public void testBindingForImportWSDL() throws Exception {
+ env.put(ToolConstants.CFG_WSDLURL,
+ getLocation("/wsdl2java_wsdl/cxf1095/hello_world_services.wsdl"));
+ env.put(ToolConstants.CFG_BINDING,
+ new String[] {getLocation("/wsdl2java_wsdl/cxf1095/binding.xml")
+ , getLocation("/wsdl2java_wsdl/cxf1095/binding1.xml")});
+ processor.setContext(env);
+ processor.execute();
+ Class clz = classLoader
+ .loadClass("org.apache.hello_world.messages.CustomizedFault");
+ assertNotNull("Customization Fault Class is not generated", clz);
+ Class serviceClz = classLoader
+ .loadClass("org.apache.hello_world.services.CustomizedService");
+ assertNotNull("Customization Fault Class is not generated", serviceClz);
+
+ }
+ @Test
+ public void testReuseJaxwsBindingFile() throws Exception {
+ env.put(ToolConstants.CFG_WSDLURL,
+ getLocation("/wsdl2java_wsdl/cxf1094/hello_world.wsdl"));
+ env.put(ToolConstants.CFG_BINDING, getLocation("/wsdl2java_wsdl/cxf1094/async_binding.xml"));
+ processor.setContext(env);
+ processor.execute();
+
+ Class clz = classLoader.loadClass("org.apache.hello_world_soap_http.Greeter");
+
+ Method method1 = clz.getMethod("greetMeSometimeAsync", new Class[] {java.lang.String.class,
+ javax.xml.ws.AsyncHandler.class});
+
+ assertNotNull("jaxws binding file does not take effect for hello_world.wsdl", method1);
+
+ env.put(ToolConstants.CFG_WSDLURL,
+ getLocation("/wsdl2java_wsdl/cxf1094/echo_date.wsdl"));
+ env.put(ToolConstants.CFG_BINDING, getLocation("/wsdl2java_wsdl/cxf1094/async_binding.xml"));
+ processor.setContext(env);
+ processor.execute();
+ clz = classLoader.loadClass("org.apache.cxf.tools.fortest.date.EchoDate");
+
+ Method method2 = clz.getMethod("echoDateAsync",
+ new Class[] {javax.xml.datatype.XMLGregorianCalendar.class,
+ javax.xml.ws.AsyncHandler.class});
+ assertNotNull("jaxws binding file does not take effect for echo_date.wsdl", method2);
+
+ }
+
+
+ @Test
+ public void testReuseJabBindingFile1() throws Exception {
+ env.put(ToolConstants.CFG_WSDLURL,
+ getLocation("/wsdl2java_wsdl/cxf1094/hello_world.wsdl"));
+ env.put(ToolConstants.CFG_BINDING, getLocation("/wsdl2java_wsdl/cxf1094/jaxbbinding.xml"));
+ processor.setContext(env);
+ processor.execute();
+ Class clz = classLoader.loadClass("org.apache.hello_world_soap_http.types.CreateProcess$MyProcess");
+ assertNotNull("Failed to generate customized class for hello_world.wsdl" , clz);
+
+ env.put(ToolConstants.CFG_WSDLURL,
+ getLocation("/wsdl2java_wsdl/cxf1094/hello_world_oneway.wsdl"));
+ env.put(ToolConstants.CFG_BINDING, getLocation("/wsdl2java_wsdl/cxf1094/jaxbbinding.xml"));
+ processor.setContext(env);
+ processor.execute();
+ Class customizedClz = classLoader.loadClass("org.apache.oneway.types.CreateProcess$MyProcess");
+ assertNotNull("Failed to generate customized class for hello_world_oneway.wsdl", customizedClz);
+
+ }
+
}
Added: incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1094/async_binding.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1094/async_binding.xml?rev=583674&view=auto
==============================================================================
--- incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1094/async_binding.xml (added)
+++ incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1094/async_binding.xml Wed Oct 10 21:20:48 2007
@@ -0,0 +1,26 @@
+<!--
+ 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.
+-->
+<bindings
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns="http://java.sun.com/xml/ns/jaxws">
+ <bindings node="wsdl:definitions">
+ <enableAsyncMapping>true</enableAsyncMapping>
+ </bindings>
+</bindings>
\ No newline at end of file
Added: incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1094/echo_date.wsdl
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1094/echo_date.wsdl?rev=583674&view=auto
==============================================================================
--- incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1094/echo_date.wsdl (added)
+++ incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1094/echo_date.wsdl Wed Oct 10 21:20:48 2007
@@ -0,0 +1,70 @@
+<?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.
+-->
+<wsdl:definitions name="EchoDateService" targetNamespace="http://date.fortest.tools.cxf.apache.org/" xmlns:ns1="http://date.fortest.tools.cxf.apache.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+ <wsdl:types>
+ <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://date.fortest.tools.cxf.apache.org/" attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="http://date.fortest.tools.cxf.apache.org/">
+ <xsd:element name="echoDate" type="echoDate"/>
+ <xsd:complexType name="echoDate">
+ <xsd:sequence>
+ <xsd:element minOccurs="0" name="arg0" type="xsd:dateTime"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ <xsd:element name="echoDateResponse" type="echoDateResponse"/>
+ <xsd:complexType name="echoDateResponse">
+ <xsd:sequence>
+ <xsd:element minOccurs="0" name="return" type="xsd:dateTime"/>
+ </xsd:sequence>
+ </xsd:complexType>
+ </xsd:schema>
+ </wsdl:types>
+ <wsdl:message name="echoDateResponse">
+ <wsdl:part name="result" element="ns1:echoDateResponse">
+ </wsdl:part>
+ </wsdl:message>
+ <wsdl:message name="echoDate">
+ <wsdl:part name="parameters" element="ns1:echoDate">
+ </wsdl:part>
+ </wsdl:message>
+ <wsdl:portType name="EchoDate">
+ <wsdl:operation name="echoDate">
+ <wsdl:input name="echoDate" message="ns1:echoDate">
+ </wsdl:input>
+ <wsdl:output name="echoDateResponse" message="ns1:echoDateResponse">
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="EchoDateServiceSoapBinding" type="ns1:EchoDate">
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="echoDate">
+ <soap:operation soapAction="" style="document"/>
+ <wsdl:input name="echoDate">
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output name="echoDateResponse">
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="EchoDateService">
+ <wsdl:port name="EchoDatePort" binding="ns1:EchoDateServiceSoapBinding">
+ <soap:address location="http://localhost:9090/hello"/>
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
Added: incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1094/hello_world.wsdl
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1094/hello_world.wsdl?rev=583674&view=auto
==============================================================================
--- incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1094/hello_world.wsdl (added)
+++ incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1094/hello_world.wsdl Wed Oct 10 21:20:48 2007
@@ -0,0 +1,283 @@
+<?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.
+-->
+<wsdl:definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:tns="http://apache.org/hello_world_soap_http"
+ xmlns:x1="http://apache.org/hello_world_soap_http/types"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://apache.org/hello_world_soap_http" name="HelloWorld">
+ <wsdl:types>
+ <schema targetNamespace="http://apache.org/hello_world_soap_http/types" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:x1="http://apache.org/hello_world_soap_http/types" elementFormDefault="qualified">
+ <element name="CreateProcess">
+ <complexType>
+ <sequence>
+ <element name="MyProcess">
+ <simpleType>
+ <restriction base="string">
+ <enumeration value="BLUE" />
+ <enumeration value="RED" />
+ <enumeration value="GREEN" />
+ </restriction>
+ </simpleType>
+ </element>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="sayHiResponse">
+ <complexType>
+ <sequence>
+ <element name="responseType" type="string"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="greetMe">
+ <complexType>
+ <sequence>
+ <element name="requestType" type="string"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="greetMeResponse">
+ <complexType>
+ <sequence>
+ <element name="responseType" type="string"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="greetMeSometime">
+ <complexType>
+ <sequence>
+ <element name="requestType" type="string"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="greetMeSometimeResponse">
+ <complexType>
+ <sequence>
+ <element name="responseType" type="string"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="greetMeOneWay">
+ <complexType>
+ <sequence>
+ <element name="requestType" type="string"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="testDocLitFault">
+ <complexType>
+ <sequence>
+ <element name="faultType" type="string"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="testDocLitFaultResponse">
+ <complexType>
+ <sequence/>
+ </complexType>
+ </element>
+ <complexType name="ErrorCode">
+ <sequence>
+ <element name="minor" type="short"/>
+ <element name="major" type="short"/>
+ </sequence>
+ </complexType>
+ <element name="NoSuchCodeLit">
+ <complexType>
+ <sequence>
+ <element name="code" type="x1:ErrorCode"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="BadRecordLit" type="string"/>
+ <complexType name="BadRecord">
+ <sequence>
+ <element name="reason" type="string"/>
+ <element name="code" type="short"/>
+ </sequence>
+ </complexType>
+ <complexType name="addNumbers">
+ <sequence>
+ <element name="arg0" type="int"/>
+ <element name="arg1" type="int"/>
+ </sequence>
+ </complexType>
+ <element name="addNumbers" type="x1:addNumbers"/>
+ <complexType name="addNumbersResponse">
+ <sequence>
+ <element name="return" type="int"/>
+ </sequence>
+ </complexType>
+ <element name="addNumbersResponse" type="x1:addNumbersResponse"/>
+ <element name="BareDocument" type="string"/>
+ <element name="BareDocumentResponse">
+ <complexType>
+ <sequence>
+ <element name="company" type="string"/>
+ </sequence>
+ <attribute name="id" type="int"/>
+ </complexType>
+ </element>
+ </schema>
+ </wsdl:types>
+ <wsdl:message name="sayHiRequest">
+ <wsdl:part name="in" element="x1:CreateProcess"/>
+ </wsdl:message>
+ <wsdl:message name="sayHiResponse">
+ <wsdl:part name="out" element="x1:sayHiResponse"/>
+ </wsdl:message>
+ <wsdl:message name="greetMeRequest">
+ <wsdl:part name="in" element="x1:greetMe"/>
+ </wsdl:message>
+ <wsdl:message name="greetMeResponse">
+ <wsdl:part name="out" element="x1:greetMeResponse"/>
+ </wsdl:message>
+ <wsdl:message name="greetMeSometimeRequest">
+ <wsdl:part name="in" element="x1:greetMeSometime"/>
+ </wsdl:message>
+ <wsdl:message name="greetMeSometimeResponse">
+ <wsdl:part name="out" element="x1:greetMeSometimeResponse"/>
+ </wsdl:message>
+ <wsdl:message name="greetMeOneWayRequest">
+ <wsdl:part name="in" element="x1:greetMeOneWay"/>
+ </wsdl:message>
+ <wsdl:message name="testDocLitFaultRequest">
+ <wsdl:part name="in" element="x1:testDocLitFault"/>
+ </wsdl:message>
+ <wsdl:message name="testDocLitFaultResponse">
+ <wsdl:part name="out" element="x1:testDocLitFaultResponse"/>
+ </wsdl:message>
+ <wsdl:message name="NoSuchCodeLitFault">
+ <wsdl:part name="NoSuchCodeLit" element="x1:NoSuchCodeLit"/>
+ </wsdl:message>
+ <wsdl:message name="BadRecordLitFault">
+ <wsdl:part name="BadRecordLit" element="x1:BadRecordLit"/>
+ </wsdl:message>
+ <wsdl:message name="testDocLitBareRequest">
+ <wsdl:part name="in" element="x1:BareDocument"/>
+ </wsdl:message>
+ <wsdl:message name="testDocLitBareResponse">
+ <wsdl:part name="out" element="x1:BareDocumentResponse"/>
+ </wsdl:message>
+ <wsdl:portType name="Greeter">
+ <wsdl:operation name="sayHi">
+ <wsdl:input name="sayHiRequest" message="tns:sayHiRequest"/>
+ <wsdl:output name="sayHiResponse" message="tns:sayHiResponse"/>
+ </wsdl:operation>
+ <wsdl:operation name="greetMe">
+ <wsdl:input name="greetMeRequest" message="tns:greetMeRequest"/>
+ <wsdl:output name="greetMeResponse" message="tns:greetMeResponse"/>
+ </wsdl:operation>
+ <wsdl:operation name="greetMeSometime">
+ <wsdl:input name="greetMeSometimeRequest" message="tns:greetMeSometimeRequest"/>
+ <wsdl:output name="greetMeSometimeResponse" message="tns:greetMeSometimeResponse"/>
+ </wsdl:operation>
+ <wsdl:operation name="greetMeOneWay">
+ <wsdl:input name="greetMeOneWayRequest" message="tns:greetMeOneWayRequest"/>
+ </wsdl:operation>
+ <wsdl:operation name="testDocLitFault">
+ <wsdl:input name="testDocLitFaultRequest" message="tns:testDocLitFaultRequest"/>
+ <wsdl:output name="testDocLitFaultResponse" message="tns:testDocLitFaultResponse"/>
+ <wsdl:fault name="NoSuchCodeLitFault" message="tns:NoSuchCodeLitFault"/>
+ <wsdl:fault name="BadRecordLitFault" message="tns:BadRecordLitFault"/>
+ </wsdl:operation>
+ <wsdl:operation name="testDocLitBare">
+ <wsdl:input name="testDocLitBareRequest" message="tns:testDocLitBareRequest"/>
+ <wsdl:output name="testDocLitBareResponse" message="tns:testDocLitBareResponse"/>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="Greeter_SOAPBinding" type="tns:Greeter">
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="sayHi">
+ <soap:operation style="document"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="greetMe">
+ <soap:operation style="document"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="greetMeSometime">
+ <soap:operation style="document"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="greetMeOneWay">
+ <soap:operation style="document"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ </wsdl:operation>
+ <wsdl:operation name="testDocLitFault">
+ <soap:operation style="document"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ <wsdl:fault name="NoSuchCodeLitFault">
+ <soap:fault name="NoSuchCodeLitFault" use="literal"/>
+ </wsdl:fault>
+ <wsdl:fault name="BadRecordLitFault">
+ <soap:fault name="BadRecordLitFault" use="literal"/>
+ </wsdl:fault>
+ </wsdl:operation>
+ <wsdl:operation name="testDocLitBare">
+ <soap:operation style="document" soapAction="http://apache.org/hello_world_soap_http/testDocLitBare"/>
+ <wsdl:input name="testDocLitBareRequest">
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output name="testDocLitBareResponse">
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="SOAPService">
+ <wsdl:port name="SoapPort" binding="tns:Greeter_SOAPBinding">
+ <soap:address location="http://localhost:9000/SoapContext/SoapPort"/>
+ <wswa:UsingAddressing xmlns:wswa="http://www.w3.org/2005/02/addressing/wsdl"/>
+ </wsdl:port>
+ </wsdl:service>
+ <wsdl:service name="SOAPService_Test1">
+ <wsdl:port name="SoapPort_Test1" binding="tns:Greeter_SOAPBinding">
+ <soap:address location="http://localhost:9100"/>
+ </wsdl:port>
+ <wsdl:port name="SoapPort_Test2" binding="tns:Greeter_SOAPBinding">
+ <soap:address location="http://localhost:9101"/>
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
+
Added: incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1094/hello_world_oneway.wsdl
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1094/hello_world_oneway.wsdl?rev=583674&view=auto
==============================================================================
--- incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1094/hello_world_oneway.wsdl (added)
+++ incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1094/hello_world_oneway.wsdl Wed Oct 10 21:20:48 2007
@@ -0,0 +1,81 @@
+<?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.
+-->
+<wsdl:definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:tns="http://apache.org/oneway"
+ xmlns:x1="http://apache.org/oneway/types"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://apache.org/oneway"
+ name="HelloWorldOneWay">
+ <wsdl:types>
+ <schema elementFormDefault="qualified"
+ targetNamespace="http://apache.org/oneway/types"
+ xmlns="http://www.w3.org/2001/XMLSchema">
+ <element name="CreateProcess">
+ <complexType>
+ <sequence>
+ <element name="MyProcess">
+ <simpleType>
+ <restriction base="string">
+ <enumeration value="BLUE" />
+ <enumeration value="RED" />
+ <enumeration value="GREEN" />
+ </restriction>
+ </simpleType>
+ </element>
+ </sequence>
+ </complexType>
+ </element>
+
+ </schema>
+ </wsdl:types>
+
+ <wsdl:message name="greetMeOneWayRequest">
+ <wsdl:part name="in" element="x1:CreateProcess" />
+ </wsdl:message>
+
+
+ <wsdl:portType name="Greeter">
+ <wsdl:operation name="greetMeOneWay">
+ <wsdl:input name="greetMeOneWayRequest"
+ message="tns:greetMeOneWayRequest" />
+ </wsdl:operation>
+
+ </wsdl:portType>
+ <wsdl:binding name="Greeter_SOAPBinding" type="tns:Greeter">
+ <soap:binding style="document"
+ transport="http://schemas.xmlsoap.org/soap/http" />
+ <wsdl:operation name="greetMeOneWay">
+ <soap:operation style="document" />
+ <wsdl:input>
+ <soap:body use="literal" />
+ </wsdl:input>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="SOAPService">
+ <wsdl:port name="SoapPort"
+ binding="tns:Greeter_SOAPBinding">
+ <soap:address location="http://localhost:9100" />
+ </wsdl:port>
+
+ </wsdl:service>
+</wsdl:definitions>
+
Added: incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1094/jaxbbinding.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1094/jaxbbinding.xml?rev=583674&view=auto
==============================================================================
--- incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1094/jaxbbinding.xml (added)
+++ incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1094/jaxbbinding.xml Wed Oct 10 21:20:48 2007
@@ -0,0 +1,29 @@
+<!--
+ 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.
+-->
+
+<jaxb:bindings version="2.0"
+ xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ node="xsd:element[@name='CreateProcess']/xsd:complexType/xsd:sequence/xsd:element[@name='MyProcess']/xsd:simpleType">
+ <jaxb:typesafeEnumClass name="MyProcess">
+ <jaxb:typesafeEnumMember name="BLUE" value="BLUE" />
+ <jaxb:typesafeEnumMember name="RED" value="RED" />
+ <jaxb:typesafeEnumMember name="GREEN" value="GREEN" />
+ </jaxb:typesafeEnumClass>
+</jaxb:bindings>
Added: incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1095/binding.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1095/binding.xml?rev=583674&view=auto
==============================================================================
--- incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1095/binding.xml (added)
+++ incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1095/binding.xml Wed Oct 10 21:20:48 2007
@@ -0,0 +1,29 @@
+<!--
+ 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.
+-->
+<bindings
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ wsdlLocation="hello_world_wsdl_import.wsdl"
+ xmlns="http://java.sun.com/xml/ns/jaxws">
+ <bindings node="wsdl:definitions/wsdl:portType">
+ <bindings node="wsdl:operation[@name='pingMe']/wsdl:fault">
+ <class name="CustomizedFault"/>
+ </bindings>
+ </bindings>
+</bindings>
\ No newline at end of file
Added: incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1095/binding1.xml
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1095/binding1.xml?rev=583674&view=auto
==============================================================================
--- incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1095/binding1.xml (added)
+++ incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1095/binding1.xml Wed Oct 10 21:20:48 2007
@@ -0,0 +1,29 @@
+<!--
+ 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.
+-->
+<bindings
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ wsdlLocation="hello_world_services.wsdl"
+ xmlns="http://java.sun.com/xml/ns/jaxws">
+ <bindings node="wsdl:definitions/wsdl:service">
+
+ <class name="CustomizedService"/>
+
+ </bindings>
+</bindings>
\ No newline at end of file
Added: incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1095/hello_world_bindings.wsdl
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1095/hello_world_bindings.wsdl?rev=583674&view=auto
==============================================================================
--- incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1095/hello_world_bindings.wsdl (added)
+++ incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1095/hello_world_bindings.wsdl Wed Oct 10 21:20:48 2007
@@ -0,0 +1,67 @@
+<?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.
+-->
+<wsdl:definitions name="HelloWorld"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:x2="http://apache.org/hello_world"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://apache.org/hello_world/bindings">
+
+
+ <wsdl:import
+ namespace="http://apache.org/hello_world"
+ location="hello_world_wsdl_import.wsdl"/>
+
+ <wsdl:binding name="SOAPBinding" type="x2:Greeter">
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <wsdl:operation name="sayHi">
+ <soap:operation style="document"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="greetMe">
+ <soap:operation style="document"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ <wsdl:operation name="pingMe">
+ <soap:operation style="document"/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ <wsdl:fault name="pingMeFault">
+ <soap:fault name="pingMeFault" use="literal"/>
+ </wsdl:fault>
+ </wsdl:operation>
+ </wsdl:binding>
+
+</wsdl:definitions>
Added: incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1095/hello_world_messages.wsdl
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1095/hello_world_messages.wsdl?rev=583674&view=auto
==============================================================================
--- incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1095/hello_world_messages.wsdl (added)
+++ incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1095/hello_world_messages.wsdl Wed Oct 10 21:20:48 2007
@@ -0,0 +1,95 @@
+<?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.
+-->
+<wsdl:definitions name="HelloWorld"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:tns="http://apache.org/hello_world/messages"
+ xmlns:x1="http://apache.org/hello_world/types"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://apache.org/hello_world/messages">
+ <wsdl:types>
+ <schema
+ xmlns="http://www.w3.org/2001/XMLSchema"
+ xmlns:x1="http://apache.org/hello_world/types"
+ targetNamespace="http://apache.org/hello_world/types"
+ elementFormDefault="qualified">
+ <element name="sayHi">
+ <complexType/>
+ </element>
+ <element name="sayHiResponse">
+ <complexType>
+ <sequence>
+ <element name="responseType" type="string"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="greetMe">
+ <complexType>
+ <sequence>
+ <element name="requestType" type="string"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="greetMeResponse">
+ <complexType>
+ <sequence>
+ <element name="responseType" type="string"/>
+ </sequence>
+ </complexType>
+ </element>
+ <element name="pingMe">
+ <complexType/>
+ </element>
+ <element name="pingMeResponse">
+ <complexType/>
+ </element>
+ <element name="faultDetail">
+ <complexType>
+ <sequence>
+ <element name="minor" type="short" form="qualified" minOccurs="0"/>
+ <element name="major" type="short" form="qualified" minOccurs="0"/>
+ </sequence>
+ </complexType>
+ </element>
+ </schema>
+ </wsdl:types>
+ <wsdl:message name="sayHiRequest">
+ <wsdl:part name="in" element="x1:sayHi"/>
+ </wsdl:message>
+ <wsdl:message name="sayHiResponse">
+ <wsdl:part name="out" element="x1:sayHiResponse"/>
+ </wsdl:message>
+ <wsdl:message name="greetMeRequest">
+ <wsdl:part name="in" element="x1:greetMe"/>
+ </wsdl:message>
+ <wsdl:message name="greetMeResponse">
+ <wsdl:part name="out" element="x1:greetMeResponse"/>
+ </wsdl:message>
+ <wsdl:message name="pingMeRequest">
+ <wsdl:part name="in" element="x1:pingMe"/>
+ </wsdl:message>
+ <wsdl:message name="pingMeResponse">
+ <wsdl:part name="out" element="x1:pingMeResponse"/>
+ </wsdl:message>
+ <wsdl:message name="pingMeFault">
+ <wsdl:part name="faultDetail" element="x1:faultDetail"/>
+ </wsdl:message>
+</wsdl:definitions>
Added: incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1095/hello_world_services.wsdl
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1095/hello_world_services.wsdl?rev=583674&view=auto
==============================================================================
--- incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1095/hello_world_services.wsdl (added)
+++ incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1095/hello_world_services.wsdl Wed Oct 10 21:20:48 2007
@@ -0,0 +1,39 @@
+<?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.
+-->
+<wsdl:definitions name="HelloWorld"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:tns="http://apache.org/hello_world/services"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:x1="http://apache.org/hello_world/bindings"
+ xmlns:x2="http://apache.org/hello_world"
+ targetNamespace="http://apache.org/hello_world/services">
+ <wsdl:import
+ namespace="http://apache.org/hello_world/bindings"
+ location="hello_world_bindings.wsdl"/>
+
+ <wsdl:service name="SOAPService">
+ <wsdl:port name="SoapPort" binding="x1:SOAPBinding">
+ <soap:address location="http://localhost:9000/SoapContext/SoapPort"/>
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
+
Added: incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1095/hello_world_wsdl_import.wsdl
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1095/hello_world_wsdl_import.wsdl?rev=583674&view=auto
==============================================================================
--- incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1095/hello_world_wsdl_import.wsdl (added)
+++ incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1095/hello_world_wsdl_import.wsdl Wed Oct 10 21:20:48 2007
@@ -0,0 +1,50 @@
+<?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.
+-->
+<wsdl:definitions name="HelloWorldImport"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+ xmlns:tns="http://apache.org/hello_world"
+ xmlns:x1="http://apache.org/hello_world/messages"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="http://apache.org/hello_world">
+
+ <wsdl:import
+ namespace="http://apache.org/hello_world/messages"
+ location="hello_world_messages.wsdl"/>
+
+ <wsdl:portType name="Greeter">
+ <wsdl:operation name="sayHi">
+ <wsdl:input message="x1:sayHiRequest" name="sayHiRequest"/>
+ <wsdl:output message="x1:sayHiResponse" name="sayHiResponse"/>
+ </wsdl:operation>
+
+ <wsdl:operation name="greetMe">
+ <wsdl:input message="x1:greetMeRequest" name="greetMeRequest"/>
+ <wsdl:output message="x1:greetMeResponse" name="greetMeResponse"/>
+ </wsdl:operation>
+
+ <wsdl:operation name="pingMe">
+ <wsdl:input name="pingMeRequest" message="x1:pingMeRequest"/>
+ <wsdl:output name="pingMeResponse" message="x1:pingMeResponse"/>
+ <wsdl:fault name="pingMeFault" message="x1:pingMeFault"/>
+ </wsdl:operation>
+ </wsdl:portType>
+</wsdl:definitions>
Re: svn commit: r583674 - in /incubator/cxf/trunk/tools/wsdlto: frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/
frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/
frontend/jaxws/src/test/j...
Posted by Jim Ma <em...@iona.com>.
Hi Glen,
Thank you for pointing out these errors.
The wsdls I committed for test is different with the wsdls under
resources/ wsdl2java_wsdl directory .
I modified content for them but I did not change the file name.
Thanks
Jim
Glen Mazza wrote:
> Am Donnerstag, den 11.10.2007, 04:20 +0000 schrieb ema@apache.org:
>
>> Author: ema
>> Date: Wed Oct 10 21:20:48 2007
>> New Revision: 583674
>>
>> Modified:
>> incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java
>> URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java?rev=583674&r1=583673&r2=583674&view=diff
>> ==============================================================================
>> --- incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java (original)
>> +++ incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java Wed Oct 10 21:20:48 2007
>> @@ -18,11 +18,15 @@
>> */
>> package org.apache.cxf.tools.wsdlto.frontend.jaxws.customization;
>>
>>
>> private void copyBindingsToWsdl(Node node, Node bindings, MapNamespaceContext ctx) {
>> @@ -345,50 +358,71 @@
>>
>> } else if (isValidJaxbBindingFile(reader)) {
>> - jaxbBindings.add(is);
>> + String schemaLocation = root.getAttribute("schemaLocation");
>> + if (StringUtils.isEmpty(schemaLocation)) {
>> + root.setAttribute("schemaLocation", wsdlURL);
>> + try {
>> + File tmpFile = FileUtils.createTempFile("jaxbbinding", ".xml");
>> + XMLUtils.writeTo(root, new FileOutputStream(tmpFile));
>> + InputSource newis = new InputSource(URIParserUtil.getAbsoluteURI(tmpFile
>> + .getAbsolutePath()));
>> + jaxbBindings.add(newis);
>> + tmpFile.deleteOnExit();
>> + } catch (Exception e) {
>> + Message msg = new Message("FAILED_TO_ADD_SCHEMALOACTION", LOG, bindingFile);
>>
>
>
> ..._SCHEMALOCATION
>
>
>
>
>> Modified: incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/Messages.properties
>> URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/Messages.properties?rev=583674&r1=583673&r2=583674&view=diff
>> ==============================================================================
>> --- incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/Messages.properties (original)
>> +++ incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/Messages.properties Wed Oct 10 21:20:48 2007
>> @@ -20,10 +20,11 @@
>> #
>> STAX_PARSER_ERROR = StAX parser error, check your external binding file(s)
>> UNKNOWN_BINDING_FILE= Unknown external binding files : {0}
>> -NOT_POINTTO_URL = External binding file: {0} does not point to the specified wsdl: {2}, resolved as {1}
>> +CAN_NOT_FIND_BINDING_WSDL = Can not read the specified wsdl {0} that external binding file {1} points
>>
>
>
> ...that external binding file {1} refers to [or ...points to]
>
>
>
>> Added:
>> incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/CustomizedWSDLLocator.java
>> URL:
>> http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/CustomizedWSDLLocator.java?rev=583674&view=auto
>> ==============================================================================
>> ---
>> incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/CustomizedWSDLLocator.java (added)
>> +++
>> incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/CustomizedWSDLLocator.java
>>
>
>
>> +
>> + private Map<String, Element> elementMap;
>> + private String lastestImportURI;
>>
>
>
> latestImportURI
>
>
>
>> + private boolean resolveFormMap;
>>
>
>
> resolveFromMap
>
>
>
>> +
>> + } catch (URISyntaxException e) {
>> + throw new RuntimeException("Resolve " + importLocation +
>> "Failed: ", e);
>>
>
>
> "Failed to resolve " + importLocation + ": "
>
>
>
>> Added: incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1094/hello_world.wsdl
>> URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1094/hello_world.wsdl?rev=583674&view=auto
>> ==============================================================================
>>
>
>
> It seems like we are creating too many WSDLs, and many of them appear to
> be just copies of others. It would be nice if they could be reused.
>
> Regards,
> Glen
>
>
>
Re: svn commit: r583674 - in /incubator/cxf/trunk/tools/wsdlto:
frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/
frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/
frontend/jaxws/src/test/j...
Posted by Glen Mazza <gl...@verizon.net>.
Am Donnerstag, den 11.10.2007, 04:20 +0000 schrieb ema@apache.org:
> Author: ema
> Date: Wed Oct 10 21:20:48 2007
> New Revision: 583674
>
> Modified:
> incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java
> URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java?rev=583674&r1=583673&r2=583674&view=diff
> ==============================================================================
> --- incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java (original)
> +++ incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java Wed Oct 10 21:20:48 2007
> @@ -18,11 +18,15 @@
> */
> package org.apache.cxf.tools.wsdlto.frontend.jaxws.customization;
>
>
> private void copyBindingsToWsdl(Node node, Node bindings, MapNamespaceContext ctx) {
> @@ -345,50 +358,71 @@
>
> } else if (isValidJaxbBindingFile(reader)) {
> - jaxbBindings.add(is);
> + String schemaLocation = root.getAttribute("schemaLocation");
> + if (StringUtils.isEmpty(schemaLocation)) {
> + root.setAttribute("schemaLocation", wsdlURL);
> + try {
> + File tmpFile = FileUtils.createTempFile("jaxbbinding", ".xml");
> + XMLUtils.writeTo(root, new FileOutputStream(tmpFile));
> + InputSource newis = new InputSource(URIParserUtil.getAbsoluteURI(tmpFile
> + .getAbsolutePath()));
> + jaxbBindings.add(newis);
> + tmpFile.deleteOnExit();
> + } catch (Exception e) {
> + Message msg = new Message("FAILED_TO_ADD_SCHEMALOACTION", LOG, bindingFile);
..._SCHEMALOCATION
> Modified: incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/Messages.properties
> URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/Messages.properties?rev=583674&r1=583673&r2=583674&view=diff
> ==============================================================================
> --- incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/Messages.properties (original)
> +++ incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/Messages.properties Wed Oct 10 21:20:48 2007
> @@ -20,10 +20,11 @@
> #
> STAX_PARSER_ERROR = StAX parser error, check your external binding file(s)
> UNKNOWN_BINDING_FILE= Unknown external binding files : {0}
> -NOT_POINTTO_URL = External binding file: {0} does not point to the specified wsdl: {2}, resolved as {1}
> +CAN_NOT_FIND_BINDING_WSDL = Can not read the specified wsdl {0} that external binding file {1} points
...that external binding file {1} refers to [or ...points to]
> Added:
> incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/CustomizedWSDLLocator.java
> URL:
> http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/CustomizedWSDLLocator.java?rev=583674&view=auto
> ==============================================================================
> ---
> incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/CustomizedWSDLLocator.java (added)
> +++
> incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/CustomizedWSDLLocator.java
> +
> + private Map<String, Element> elementMap;
> + private String lastestImportURI;
latestImportURI
> + private boolean resolveFormMap;
resolveFromMap
> +
> + } catch (URISyntaxException e) {
> + throw new RuntimeException("Resolve " + importLocation +
> "Failed: ", e);
"Failed to resolve " + importLocation + ": "
> Added: incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1094/hello_world.wsdl
> URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/test/src/test/resources/wsdl2java_wsdl/cxf1094/hello_world.wsdl?rev=583674&view=auto
> ==============================================================================
It seems like we are creating too many WSDLs, and many of them appear to
be just copies of others. It would be nice if they could be reused.
Regards,
Glen