You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by rf...@apache.org on 2008/06/05 01:04:38 UTC

svn commit: r663406 - in /incubator/tuscany/java/sca/modules/interface-java-jaxws: pom.xml src/test/resources/wsdl/Stock.wsdl

Author: rfeng
Date: Wed Jun  4 16:04:37 2008
New Revision: 663406

URL: http://svn.apache.org/viewvc?rev=663406&view=rev
Log:
Add cxf configuration to generate java artifacts from a wsdl without service/binding element (not activated)

Added:
    incubator/tuscany/java/sca/modules/interface-java-jaxws/src/test/resources/wsdl/Stock.wsdl
Modified:
    incubator/tuscany/java/sca/modules/interface-java-jaxws/pom.xml

Modified: incubator/tuscany/java/sca/modules/interface-java-jaxws/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/interface-java-jaxws/pom.xml?rev=663406&r1=663405&r2=663406&view=diff
==============================================================================
--- incubator/tuscany/java/sca/modules/interface-java-jaxws/pom.xml (original)
+++ incubator/tuscany/java/sca/modules/interface-java-jaxws/pom.xml Wed Jun  4 16:04:37 2008
@@ -164,9 +164,6 @@
                             <packageName>com.example.stock</packageName>
                             <wsdlDirectory>${basedir}/src/test/resources/wsdl</wsdlDirectory>
                             <wsdlFiles>
-                                <!-- 
-                                    <wsdlFile>StockQuotes.wsdl</wsdlFile>
-                                -->
                                 <wsdlFile>StockExceptionTest.wsdl</wsdlFile>
                             </wsdlFiles>
                             <sourceDestDir>${project.build.directory}/jaxws-source</sourceDestDir>
@@ -174,6 +171,7 @@
                             <xnocompile>true</xnocompile>
                         </configuration>
                     </execution>
+
                     <!-- 
                     <execution>
                         <id>wsgen</id>
@@ -191,7 +189,7 @@
                     </execution>
                     -->
                 </executions>
- 
+
                 <dependencies>
                     <dependency>
                         <groupId>com.sun</groupId>
@@ -201,9 +199,44 @@
                         <systemPath>${java.home}/../lib/tools.jar</systemPath>
                     </dependency>
                 </dependencies>
-                
+
             </plugin>
 
+            <!-- 
+            wsimport cannot handle WSDL files without a service/binding element.
+            CXF wsdl2java plugin does support that. I had to override the default 
+            value of wsdlRoot/testWsdlRoot to a non-existent file to avoid NPE -->
+            <!-- 
+            <plugin>
+                <groupId>org.apache.cxf</groupId>
+                <artifactId>cxf-codegen-plugin</artifactId>
+                <version>2.1</version>
+                <executions>
+                    <execution>
+                        <id>generate-sources</id>
+                        <phase>generate-sources</phase>
+
+                        <configuration>
+                            <sourceRoot>${basedir}/target/jaxws-source</sourceRoot>
+                            <wsdlRoot>NONE</wsdlRoot>
+                            <testWsdlRoot>NONE</testWsdlRoot>
+                            <wsdlOptions>
+                                <wsdlOption>
+                                    <wsdl>${basedir}/src/test/resources/wsdl/Stock.wsdl</wsdl>
+                                    <outputDir>${basedir}/target/jaxws-source</outputDir>
+                                    <packagenames>
+                                        <packagename>com.example.stock.cxf</packagename>
+                                    </packagenames>
+                                </wsdlOption>
+                            </wsdlOptions>
+                        </configuration>
+                        <goals>
+                            <goal>wsdl2java</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+             -->
 
             <plugin>
                 <groupId>org.apache.felix</groupId>

Added: incubator/tuscany/java/sca/modules/interface-java-jaxws/src/test/resources/wsdl/Stock.wsdl
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/modules/interface-java-jaxws/src/test/resources/wsdl/Stock.wsdl?rev=663406&view=auto
==============================================================================
--- incubator/tuscany/java/sca/modules/interface-java-jaxws/src/test/resources/wsdl/Stock.wsdl (added)
+++ incubator/tuscany/java/sca/modules/interface-java-jaxws/src/test/resources/wsdl/Stock.wsdl Wed Jun  4 16:04:37 2008
@@ -0,0 +1,142 @@
+<?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 targetNamespace="http://www.example.com/stock" xmlns:impl="http://www.example.com/stock"
+    xmlns:tns="http://www.example.com/stock" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+    xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsi="http://ws-i.org/profiles/basic/1.1/xsd"
+    xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="StockExceptionTest">
+    <wsdl:types>
+        <schema targetNamespace="http://www.example.com/stock" xmlns="http://www.w3.org/2001/XMLSchema"
+            xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+            <complexType name="StockOffer">
+                <sequence>
+                    <element name="symbol" minOccurs="1" type="xsd:string" />
+                    <element name="price" minOccurs="1" type="xsd:float" nillable="true" /><!-- max price reqested, actual response -->
+                    <element name="name" minOccurs="0" type="xsd:string" />
+                    <element name="list" minOccurs="0" maxOccurs="unbounded" type="xsd:string" />
+                </sequence>
+            </complexType>
+
+            <element name="stockQuoteOffer">
+                <complexType>
+                    <sequence>
+                        <element name="input" minOccurs="0" maxOccurs="unbounded" type="tns:StockOffer" />
+                    </sequence>
+                </complexType>
+            </element>
+            <element name="stockQuoteOfferResponse">
+                <complexType>
+                    <sequence>
+                        <element name="stockQuoteOfferReturn" minOccurs="0" type="tns:StockOffer" />
+                    </sequence>
+                </complexType>
+            </element>
+
+            <!-- Faults -->
+            <element name="InvalidSymbolFault">
+                <complexType>
+                    <sequence>
+                        <element name="message" minOccurs="1" type="xsd:string" />
+                        <element name="offer" minOccurs="1" type="tns:StockOffer" />
+                    </sequence>
+                </complexType>
+            </element>
+
+            <element name="MarketClosedFault" type="xsd:int" />
+
+            <element name="TestNotDeclaredAtSourceFault" type="xsd:string" />
+
+        </schema>
+    </wsdl:types>
+
+
+    <wsdl:message name="stockQuoteOfferRequest">
+        <wsdl:part element="tns:stockQuoteOffer" name="parameters" />
+    </wsdl:message>
+
+    <wsdl:message name="stockQuoteOfferResponse">
+        <wsdl:part element="tns:stockQuoteOfferResponse" name="parameters" />
+    </wsdl:message>
+
+    <wsdl:message name="InvalidSymbolFault">
+        <wsdl:part element="tns:InvalidSymbolFault" name="fault" />
+    </wsdl:message>
+
+    <wsdl:message name="MarketClosedFault">
+        <wsdl:part element="tns:MarketClosedFault" name="fault" />
+    </wsdl:message>
+
+    <wsdl:message name="TestNotDeclaredAtSourceFault">
+        <wsdl:part element="tns:TestNotDeclaredAtSourceFault" name="fault" />
+    </wsdl:message>
+
+
+    <wsdl:portType name="StockExceptionTest">
+        <wsdl:operation name="stockQuoteOffer">
+            <wsdl:input message="tns:stockQuoteOfferRequest" name="stockQuoteOfferRequest" />
+
+            <wsdl:output message="tns:stockQuoteOfferResponse" name="stockQuoteOfferResponse" />
+
+            <wsdl:fault message="tns:InvalidSymbolFault" name="InvalidSymbolException" />
+
+            <wsdl:fault message="tns:MarketClosedFault" name="MarketClosedException" />
+
+            <wsdl:fault message="tns:TestNotDeclaredAtSourceFault" name="TestNotDeclaredAtSourceException" />
+        </wsdl:operation>
+
+
+    </wsdl:portType>
+
+    <wsdl:binding name="StockExceptionTestServiceSoapBinding" type="tns:StockExceptionTest">
+        <!-- <wsaw:UsingAddressing wsdl:required="false" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"/> -->
+
+        <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
+
+        <wsdl:operation name="stockQuoteOffer">
+            <wsdlsoap:operation soapAction="" />
+
+            <wsdl:input name="stockQuoteOfferRequest">
+                <wsdlsoap:body use="literal" />
+            </wsdl:input>
+
+            <wsdl:output name="stockQuoteOfferResponse">
+                <wsdlsoap:body use="literal" />
+            </wsdl:output>
+
+            <wsdl:fault name="InvalidSymbolException">
+                <wsdlsoap:fault name="InvalidSymbolException" use="literal" />
+            </wsdl:fault>
+
+            <wsdl:fault name="MarketClosedException">
+                <wsdlsoap:fault name="MarketClosedException" use="literal" />
+            </wsdl:fault>
+
+            <wsdl:fault name="TestNotDeclaredAtSourceException">
+                <wsdlsoap:fault name="TestNotDeclaredAtSourceException" use="literal" />
+            </wsdl:fault>
+
+
+
+        </wsdl:operation>
+
+
+    </wsdl:binding>
+
+
+</wsdl:definitions>
\ No newline at end of file