Thanks for the suggestions guys...

I tried the Aegis approach using 2.0.4 (we don't want to use 2.1 yet).
Running Java2Wsdl on the WSDL it generated had the same problem of
PingMeSubclassFault not inheriting from PingMeFault. Is this something that
is changing in 2.1?

As a workaround, I followed Dan's suggestion and just used my own fault
classes (with proper annotations and the appropriate inheritance hierarchy)
instead of the fault classes generated from the WSDL. 

This seems like a pretty common scenario. It's a shame that JAX-WS doesn't
cover it :(


dkulp wrote:
> 
> 
> I don't think so using "normal" looking java exception.  You could do it 
> if you model your exceptions exactly like the exceptions would look like 
> if you generated code from wsdl.   Basically, put the data in JAXB Beans 
> that implement the heiarchy you want to see in the wsdl, then add "Bean 
> getFaultInfo()" methods to the exceptions to return the JAXB Beans.
> 
> Even then, I'm not sure if it will actually work.
> 
> Dan
> 
> 
> On Tuesday 18 March 2008, Joel_Turkel wrote:
>> Hi,
>>
>> Is there anyway to get CXF to generate an inheritance hierarchy of
>> users defined exceptions? For example, I'd like to generate something
>> like the following from a WSDL:
>>
>> public interface Greeter {
>>
>>     public void pingMe() throws PingMeSubclassFault, PingMeFault;
>>
>> }
>>
>> where PingMeSubclassFault is a subclass of PingMeFault. The WSDL below
>> doesn't seem to do the trick i.e. PingMeFault and PingMeSubclassFault
>> are not related via inheritance. The actually WSDL I'm working with
>> has a rich hierarchy of exception so the lack of exception inheritance
>> makes the generated code hard to work with.
>>
>> Thanks,
>> Joel
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <wsdl:definitions name="HelloWorld"
>>      targetNamespace="http://apache.org/hello_world_soap_http";
>>      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";>
>>      <wsdl:types>
>>              <schema
>>                      
>> targetNamespace="http://apache.org/hello_world_soap_http/types";
>>                      xmlns="http://www.w3.org/2001/XMLSchema";
>>                      
>> xmlns:tns="http://apache.org/hello_world_soap_http/types";
>>                      elementFormDefault="qualified">
>>                      <element name="pingMe">
>>                              <complexType />
>>                      </element>
>>                      <element name="pingMeResponse">
>>                              <complexType />
>>                      </element>
>>                      <element name="faultDetail" type="tns:faultDetail" />
>>                      <complexType name="faultDetail">
>>                              <sequence>
>>                                      <element name="minor" type="short" />
>>                                      <element name="major" type="short" />
>>                              </sequence>
>>                      </complexType>
>>                      <element name="subclassFaultDetail">
>>                              <complexType>
>>                                      <complexContent>
>>                                              <extension 
>> base="tns:faultDetail">
>>                                                      <sequence />
>>                                              </extension>
>>                                      </complexContent>
>>                              </complexType>
>>                      </element>
>>              </schema>
>>      </wsdl:types>
>>      <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:message name="pingMeSubclassFault">
>>              <wsdl:part name="faultDetail" element="x1:subclassFaultDetail" 
>> />
>>      </wsdl:message>
>>      <wsdl:portType name="Greeter">
>>              <wsdl:operation name="pingMe">
>>                      <wsdl:input name="pingMeRequest"
>>                              message="tns:pingMeRequest" />
>>                      <wsdl:output name="pingMeResponse"
>>                              message="tns:pingMeResponse" />
>>                      <wsdl:fault name="pingMeFault" 
>> message="tns:pingMeFault" />
>>                      <wsdl:fault name="pingMeSubclassFault"
>>                              message="tns:pingMeSubclassFault" />
>>              </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="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:fault name="pingMeSubclassFault">
>>                              <soap:fault name="pingMeSubclassFault" 
>> use="literal" />
>>                      </wsdl:fault>
>>              </wsdl:operation>
>>      </wsdl:binding>
>>      <wsdl:service name="SOAPService">
>>              <wsdl:port binding="tns:Greeter_SOAPBinding" name="SoapPort">
>>                      <soap:address
>>                              
>> location="http://localhost:9000/SoapContext/SoapPort"; />
>>              </wsdl:port>
>>      </wsdl:service>
>> </wsdl:definitions>
> 
> 
> 
> -- 
> J. Daniel Kulp
> Principal Engineer, IONA
> [EMAIL PROTECTED]
> http://www.dankulp.com/blog
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Generated-Faults-and-Inheritance-tp16133913p16291480.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to