Author: jim.ma
Date: 2012-02-26 22:26:43 -0500 (Sun, 26 Feb 2012)
New Revision: 15747
Modified:
thirdparty/cxf/branches/cxf-2.2.12/api/src/main/java/org/apache/cxf/tools/common/ToolConstants.java
thirdparty/cxf/branches/cxf-2.2.12/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java
thirdparty/cxf/branches/cxf-2.2.12/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java
Log:
[JBPAPP-8235]:wsconsume chokes on wsdl containing element referring its schema
Modified:
thirdparty/cxf/branches/cxf-2.2.12/api/src/main/java/org/apache/cxf/tools/common/ToolConstants.java
===================================================================
---
thirdparty/cxf/branches/cxf-2.2.12/api/src/main/java/org/apache/cxf/tools/common/ToolConstants.java 2012-02-26
15:12:25 UTC (rev 15746)
+++
thirdparty/cxf/branches/cxf-2.2.12/api/src/main/java/org/apache/cxf/tools/common/ToolConstants.java 2012-02-27
03:26:43 UTC (rev 15747)
@@ -161,6 +161,7 @@
public static final String NS_JAXB_BINDINGS =
"http://java.sun.com/xml/ns/jaxb";
public static final QName JAXWS_BINDINGS = new QName(NS_JAXWS_BINDINGS,
"bindings");
public static final QName JAXB_BINDINGS = new QName(NS_JAXB_BINDINGS,
"bindings");
+ public static final QName SCHEMA = new QName(SCHEMA_URI, "schema");
public static final String JAXWS_BINDINGS_WSDL_LOCATION = "wsdlLocation";
public static final String JAXWS_BINDING_NODE = "node";
public static final String JAXWS_BINDING_VERSION = "version";
Modified:
thirdparty/cxf/branches/cxf-2.2.12/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java
===================================================================
---
thirdparty/cxf/branches/cxf-2.2.12/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java 2012-02-26
15:12:25 UTC (rev 15746)
+++
thirdparty/cxf/branches/cxf-2.2.12/tools/wsdlto/frontend/jaxws/src/main/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/customization/CustomizationParser.java 2012-02-27
03:26:43 UTC (rev 15747)
@@ -578,8 +578,8 @@
}
private boolean isValidJaxbBindingFile(XMLStreamReader reader) {
- if (ToolConstants.JAXB_BINDINGS.equals(reader.getName())) {
-
+ if (ToolConstants.JAXB_BINDINGS.equals(reader.getName())
+ || ToolConstants.SCHEMA.equals(reader.getName())) {
return true;
}
return false;
Modified:
thirdparty/cxf/branches/cxf-2.2.12/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java
===================================================================
---
thirdparty/cxf/branches/cxf-2.2.12/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java 2012-02-26
15:12:25 UTC (rev 15746)
+++
thirdparty/cxf/branches/cxf-2.2.12/tools/wsdlto/test/src/test/java/org/apache/cxf/tools/wsdlto/jaxws/CodeGenTest.java 2012-02-27
03:26:43 UTC (rev 15747)
@@ -1371,5 +1371,17 @@
RequestWrapper reqWrapper = method.getAnnotation(RequestWrapper.class);
assertNotNull("@RequestWrapper is expected", reqWrapper);
}
-
+ @Test
+ // CXF-4135
+ public void testPassShemaFileAsJAXBBinding() throws Exception {
+ env.put(ToolConstants.CFG_WSDLURL,
getLocation("/wsdl2java_wsdl/hello_world.wsdl"));
+ env.put(ToolConstants.CFG_BINDING,
getLocation("/wsdl2java_wsdl/Invoice.xsd"));
+ processor.setContext(env);
+ processor.execute();
+ File generateFromBindingFile = new File(output,
"org/apache/invoice/Invoice.java");
+ assertTrue(generateFromBindingFile.exists());
+ File seiFile = new File(output,
"org/apache/cxf/w2j/hello_world_soap_http/Greeter.java");
+ assertTrue(seiFile.exists());
+ }
+
}
Show replies by date