cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Mao <james....@iona.com>
Subject Re: Annotation names being ignored in wsdl generation...
Date Fri, 10 Aug 2007 02:41:18 GMT
Hi Ray,

Add @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE) just 
after the @WebService, see if you can get the wsdl right


James

> I am working from the following interface...
>
> @WebService(targetNamespace = CurrencyExchangeNamespace.URI, name =
> "CurrencyExchange")
> public interface CurrencyExchange {
>
>     @WebResult(targetNamespace = CurrencyExchangeNamespace.URI,
>             name = "ExchangeResponse", partName = "ExchangeResponse")
>     ExchangeResponse getExchangeRate(
>
>             @WebParam(targetNamespace = CurrencyExchangeNamespace.URI,
>                     name = "ExchangeRequest", partName = "ExchangeRequest")
>             ExchangeRequest exchangeRequest
>
>     ) throws ExchangeFault;
>
> }
>
> Where Namespace.URI is a constant for
> http://ws.example.com/schemas/2007/08/CurrencyExchange
>
> Now the WSDL cxf generates from this gets all messed up. It seems to
> ignore my @WebParam name and partName properties.
>
> It creates an input called getExchangeRate and an output called
> getExchangeRateResponse. It then actually adds complexTypes and
> Elements to go along with it. Then it actually generates bad wsdl in
> that it contains...
>             <xs:element name="ExchangeFault" nillable="true"/>
>             <xs:element name="ExchangeFault" nillable="true"/>
>
>
> I really have no idea why, the ExchangeRequest and ExchangeResponse
> are JAXB2 generated classes, and they are included in the schema
> section just fine, but not used.
>
> I've attached the ?wsdl output. I'm pasting it below assuming it will
> be trashed.
>
> <?xml version="1.0" encoding="utf-8"?>
> <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> xmlns:ns1="http://ws.example.com/schemas/2007/08/CurrencyExchange"
> xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> name="CurrencyExchangeService"
> targetNamespace="http://ws.example.com/schemas/2007/08/CurrencyExchange">
>     <wsdl:types>
>         <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
> xmlns="http://ws.example.com/schemas/2007/08/CurrencyExchange"
> attributeFormDefault="unqualified" elementFormDefault="qualified"
> targetNamespace="http://ws.example.com/schemas/2007/08/CurrencyExchange">
>             <xs:element name="ExchangeRequest">
>                 <xs:complexType>
>                     <xs:all>
>                         <xs:element name="fromCurrency" type="xs:string"/>
>                         <xs:element name="toCurrency" type="xs:string"/>
>                     </xs:all>
>                 </xs:complexType>
>             </xs:element>
>             <xs:element name="ExchangeResponse">
>                 <xs:complexType>
>                     <xs:sequence>
>                         <xs:element name="rate" type="xs:double"/>
>                     </xs:sequence>
>
>                 </xs:complexType>
>             </xs:element>
>             <xs:element name="FaultDetail">
>                 <xs:complexType>
>                     <xs:all>
>                         <xs:element name="errorCode" type="xs:string"/>
>                         <xs:element name="message" type="xs:string"/>
>                     </xs:all>
>                 </xs:complexType>
>             </xs:element>
>             <xs:element name="ExchangeFault" nillable="true"/>
>             <xs:element name="ExchangeFault" nillable="true"/>
>             <xs:element name="getExchangeRate" type="getExchangeRate"/>
>             <xs:complexType name="getExchangeRate">
>                 <xs:sequence>
>                     <xs:element minOccurs="0" ref="ExchangeRequest"/>
>                 </xs:sequence>
>
>             </xs:complexType>
>             <xs:element name="getExchangeRateResponse"
> type="getExchangeRateResponse"/>
>             <xs:complexType name="getExchangeRateResponse">
>                 <xs:sequence>
>                     <xs:element minOccurs="0" ref="ExchangeResponse"/>
>                 </xs:sequence>
>             </xs:complexType>
>         </xs:schema>
>     </wsdl:types>
>     <wsdl:message name="getExchangeRate">
>         <wsdl:part element="ns1:getExchangeRate" name="parameters">
>         </wsdl:part>
>     </wsdl:message>
>
>     <wsdl:message name="getExchangeRateResponse">
>         <wsdl:part element="ns1:getExchangeRateResponse" name="result">
>         </wsdl:part>
>     </wsdl:message>
>     <wsdl:message name="ExchangeFault">
>         <wsdl:part element="ns1:ExchangeFault" name="fault">
>         </wsdl:part>
>     </wsdl:message>
>     <wsdl:portType name="CurrencyExchange">
>
>         <wsdl:operation name="getExchangeRate">
>             <wsdl:input message="ns1:getExchangeRate" name="getExchangeRate">
>             </wsdl:input>
>             <wsdl:output message="ns1:getExchangeRateResponse"
> name="getExchangeRateResponse">
>             </wsdl:output>
>             <wsdl:fault message="ns1:ExchangeFault" name="ExchangeFault">
>             </wsdl:fault>
>         </wsdl:operation>
>     </wsdl:portType>
>
>     <wsdl:binding name="CurrencyExchangeServiceSoapBinding"
> type="ns1:CurrencyExchange">
>         <soap:binding style="document"
> transport="http://schemas.xmlsoap.org/soap/http"/>
>         <wsdl:operation name="getExchangeRate">
>             <soap:operation soapAction="" style="document"/>
>             <wsdl:input name="getExchangeRate">
>                 <soap:body use="literal"/>
>             </wsdl:input>
>             <wsdl:output name="getExchangeRateResponse">
>                 <soap:body use="literal"/>
>
>             </wsdl:output>
>             <wsdl:fault name="ExchangeFault">
>                 <soap:fault name="ExchangeFault" use="literal"/>
>             </wsdl:fault>
>         </wsdl:operation>
>     </wsdl:binding>
>     <wsdl:service name="CurrencyExchangeService">
>         <wsdl:port binding="ns1:CurrencyExchangeServiceSoapBinding"
> name="CurrencyExchange">
>             <soap:address
> location="http://localhost:8181/ws/soap/CurrencyExchange"/>
>
>         </wsdl:port>
>     </wsdl:service>
> </wsdl:definitions>
>   
> ------------------------------------------------------------------------
>
> <?xml version="1.0" encoding="utf-8"?>
> <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ns1="http://ws.example.com/schemas/2007/08/CurrencyExchange"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
name="CurrencyExchangeService" targetNamespace="http://ws.example.com/schemas/2007/08/CurrencyExchange">
>     <wsdl:types>
>         <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://ws.example.com/schemas/2007/08/CurrencyExchange"
attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://ws.example.com/schemas/2007/08/CurrencyExchange">
>             <xs:element name="ExchangeRequest">
>                 <xs:complexType>
>                     <xs:all>
>                         <xs:element name="fromCurrency" type="xs:string"/>
>                         <xs:element name="toCurrency" type="xs:string"/>
>                     </xs:all>
>                 </xs:complexType>
>             </xs:element>
>             <xs:element name="ExchangeResponse">
>                 <xs:complexType>
>                     <xs:sequence>
>                         <xs:element name="rate" type="xs:double"/>
>                     </xs:sequence>
>
>                 </xs:complexType>
>             </xs:element>
>             <xs:element name="FaultDetail">
>                 <xs:complexType>
>                     <xs:all>
>                         <xs:element name="errorCode" type="xs:string"/>
>                         <xs:element name="message" type="xs:string"/>
>                     </xs:all>
>                 </xs:complexType>
>             </xs:element>
>             <xs:element name="ExchangeFault" nillable="true"/>
>             <xs:element name="ExchangeFault" nillable="true"/>
>             <xs:element name="getExchangeRate" type="getExchangeRate"/>
>             <xs:complexType name="getExchangeRate">
>                 <xs:sequence>
>                     <xs:element minOccurs="0" ref="ExchangeRequest"/>
>                 </xs:sequence>
>
>             </xs:complexType>
>             <xs:element name="getExchangeRateResponse" type="getExchangeRateResponse"/>
>             <xs:complexType name="getExchangeRateResponse">
>                 <xs:sequence>
>                     <xs:element minOccurs="0" ref="ExchangeResponse"/>
>                 </xs:sequence>
>             </xs:complexType>
>         </xs:schema>
>     </wsdl:types>
>     <wsdl:message name="getExchangeRate">
>         <wsdl:part element="ns1:getExchangeRate" name="parameters">
>         </wsdl:part>
>     </wsdl:message>
>
>     <wsdl:message name="getExchangeRateResponse">
>         <wsdl:part element="ns1:getExchangeRateResponse" name="result">
>         </wsdl:part>
>     </wsdl:message>
>     <wsdl:message name="ExchangeFault">
>         <wsdl:part element="ns1:ExchangeFault" name="fault">
>         </wsdl:part>
>     </wsdl:message>
>     <wsdl:portType name="CurrencyExchange">
>
>         <wsdl:operation name="getExchangeRate">
>             <wsdl:input message="ns1:getExchangeRate" name="getExchangeRate">
>             </wsdl:input>
>             <wsdl:output message="ns1:getExchangeRateResponse" name="getExchangeRateResponse">
>             </wsdl:output>
>             <wsdl:fault message="ns1:ExchangeFault" name="ExchangeFault">
>             </wsdl:fault>
>         </wsdl:operation>
>     </wsdl:portType>
>
>     <wsdl:binding name="CurrencyExchangeServiceSoapBinding" type="ns1:CurrencyExchange">
>         <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
>         <wsdl:operation name="getExchangeRate">
>             <soap:operation soapAction="" style="document"/>
>             <wsdl:input name="getExchangeRate">
>                 <soap:body use="literal"/>
>             </wsdl:input>
>             <wsdl:output name="getExchangeRateResponse">
>                 <soap:body use="literal"/>
>
>             </wsdl:output>
>             <wsdl:fault name="ExchangeFault">
>                 <soap:fault name="ExchangeFault" use="literal"/>
>             </wsdl:fault>
>         </wsdl:operation>
>     </wsdl:binding>
>     <wsdl:service name="CurrencyExchangeService">
>         <wsdl:port binding="ns1:CurrencyExchangeServiceSoapBinding" name="CurrencyExchange">
>             <soap:address location="http://localhost:8181/ws/soap/CurrencyExchange"/>
>
>         </wsdl:port>
>     </wsdl:service>
> </wsdl:definitions>

Mime
View raw message