Author: mmao
Date: Tue Aug 21 01:34:17 2007
New Revision: 568021
URL: http://svn.apache.org/viewvc?rev=568021&view=rev
Log:
If the services of the wsdl definition are located in it's imported wsdl
Added:
incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/resources/build.wsdl
Modified:
incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLDefinitionBuilder.java
incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/JAXWSDefinitionBuilderTest.java
Modified:
incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLDefinitionBuilder.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLDefinitionBuilder.java?rev=568021&r1=568020&r2=568021&view=diff
==============================================================================
---
incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLDefinitionBuilder.java
(original)
+++
incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLDefinitionBuilder.java
Tue Aug 21 01:34:17 2007
@@ -27,6 +27,7 @@
import java.util.List;
import java.util.Map;
import java.util.Properties;
+import java.util.Set;
import java.util.StringTokenizer;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -113,6 +114,7 @@
return wsdlDefinition;
}
+ @SuppressWarnings("unchecked")
protected void parseWSDL(String wsdlURL) {
try {
@@ -123,6 +125,17 @@
wsdlDefinition = wsdlReader.readWSDL(wsdlLocator);
parseImports(wsdlDefinition);
+
+ if (wsdlDefinition.getServices().isEmpty()) {
+ for (Definition def : importedDefinitions) {
+ Set<QName> services = def.getServices().keySet();
+ for (QName sName : services) {
+ if
(!wsdlDefinition.getServices().keySet().contains(sName)) {
+ wsdlDefinition.getServices().put(sName,
def.getService(sName));
+ }
+ }
+ }
+ }
} catch (Exception we) {
Message msg = new Message("FAIL_TO_CREATE_WSDL_DEFINITION",
LOG,
Modified:
incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/JAXWSDefinitionBuilderTest.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/JAXWSDefinitionBuilderTest.java?rev=568021&r1=568020&r2=568021&view=diff
==============================================================================
---
incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/JAXWSDefinitionBuilderTest.java
(original)
+++
incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/JAXWSDefinitionBuilderTest.java
Tue Aug 21 01:34:17 2007
@@ -152,4 +152,16 @@
assertTrue(true);
}
+ @Test
+ public void testNoService() {
+ env.put(ToolConstants.CFG_WSDLURL,
getClass().getResource("resources/build.wsdl").toString());
+
+ JAXWSDefinitionBuilder builder = new JAXWSDefinitionBuilder();
+ builder.setContext(env);
+ builder.build();
+
+ Definition def = builder.getWSDLModel();
+ assertTrue(def.getServices().keySet().contains(new
QName("http://apache.org/hello_world_soap_http",
+
"SOAPService")));
+ }
}
Added:
incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/resources/build.wsdl
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/resources/build.wsdl?rev=568021&view=auto
==============================================================================
---
incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/resources/build.wsdl
(added)
+++
incubator/cxf/trunk/tools/wsdlto/frontend/jaxws/src/test/java/org/apache/cxf/tools/wsdlto/frontend/jaxws/wsdl11/resources/build.wsdl
Tue Aug 21 01:34:17 2007
@@ -0,0 +1,28 @@
+<?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:tns="urn:build.cxf.com"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ name="build"
+ targetNamespace="urn:build.aepona.com"
+ xmlns:wsdl1="http://apache.org/hello_world_soap_http">
+ <wsdl:import
+ namespace="http://apache.org/hello_world_soap_http"
+ location="./hello_world.wsdl"/>
+</wsdl:definitions>