Hi,
I have a wsdl defining a fault. When I run the cxf-codegen plugin I get
two classes in Java NoSuchCustomerException and
NoSuchCustomerException_Exception.
The first thing I don“t like is that the Exception is a checked
Exception, no RuntimeException. Can I configure this somewhere?
The other thing is the the real Exception has the name
Exception_Exception .. this looks ugly.
The wsdl was generated from Java code. In the Java code I used a Runtime
Exception NoSuchCustomerException without any special settings.
Best regards
Christian
--
Christian Schneider
---
http://www.liquid-reality.de
----
package com.example.customerservice;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "NoSuchCustomerException")
public class NoSuchCustomerException {
}
----
package com.example.customerservice;
import javax.xml.ws.WebFault;
@WebFault(name = "NoSuchCustomerException", targetNamespace =
"http://customerservice.example.com/")
public class NoSuchCustomerException_Exception extends Exception {
public static final long serialVersionUID = 20080819224917L;
private com.example.customerservice.NoSuchCustomerException
noSuchCustomerException;
public NoSuchCustomerException_Exception() {
super();
}
public NoSuchCustomerException_Exception(String message) {
super(message);
}
public NoSuchCustomerException_Exception(String message, Throwable cause) {
super(message, cause);
}
public NoSuchCustomerException_Exception(String message,
com.example.customerservice.NoSuchCustomerException
noSuchCustomerException) {
super(message);
this.noSuchCustomerException = noSuchCustomerException;
}
public NoSuchCustomerException_Exception(String message,
com.example.customerservice.NoSuchCustomerException
noSuchCustomerException, Throwable cause) {
super(message, cause);
this.noSuchCustomerException = noSuchCustomerException;
}
public com.example.customerservice.NoSuchCustomerException getFaultInfo() {
return this.noSuchCustomerException;
}
}
----
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="CustomerServiceService"
targetNamespace="http://customerservice.example.com/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns="http://customerservice.example.com/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
<wsdl:types>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:tns="http://customerservice.example.com/"
attributeFormDefault="unqualified" elementFormDefault="unqualified"
targetNamespace="http://customerservice.example.com/">
<xs:element name="getCustomersByName" type="tns:getCustomersByName"/>
<xs:element name="getCustomersByNameResponse"
type="tns:getCustomersByNameResponse"/>
<xs:complexType name="getCustomersByName">
<xs:sequence>
<xs:element minOccurs="0" name="name" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="getCustomersByNameResponse">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="return"
type="tns:customer"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="customer">
<xs:sequence>
<xs:element minOccurs="0" name="name" type="xs:string"/>
<xs:element maxOccurs="unbounded" minOccurs="0" name="address"
nillable="true" type="xs:string"/>
<xs:element name="numOrders" type="xs:int"/>
<xs:element name="revenue" type="xs:double"/>
<xs:element minOccurs="0" name="test" type="xs:decimal"/>
<xs:element minOccurs="0" name="birthDate" type="xs:dateTime"/>
<xs:element minOccurs="0" name="type" type="tns:customerType"/>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="customerType">
<xs:restriction base="xs:string">
<xs:enumeration value="PRIVATE"/>
<xs:enumeration value="BUSINESS"/>
</xs:restriction>
</xs:simpleType>
<xs:element name="NoSuchCustomerException"
type="tns:NoSuchCustomerException"/>
<xs:complexType name="NoSuchCustomerException">
<xs:sequence/>
</xs:complexType>
</xs:schema>
</wsdl:types>
<wsdl:message name="getCustomersByNameResponse">
<wsdl:part name="parameters" element="tns:getCustomersByNameResponse">
</wsdl:part>
</wsdl:message>
<wsdl:message name="getCustomersByName">
<wsdl:part name="parameters" element="tns:getCustomersByName">
</wsdl:part>
</wsdl:message>
<wsdl:message name="NoSuchCustomerException">
<wsdl:part name="NoSuchCustomerException"
element="tns:NoSuchCustomerException">
</wsdl:part>
</wsdl:message>
<wsdl:portType name="CustomerService">
<wsdl:operation name="getCustomersByName">
<wsdl:input name="getCustomersByName" message="tns:getCustomersByName">
</wsdl:input>
<wsdl:output name="getCustomersByNameResponse"
message="tns:getCustomersByNameResponse">
</wsdl:output>
<wsdl:fault name="NoSuchCustomerException"
message="tns:NoSuchCustomerException">
</wsdl:fault>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="CustomerServiceServiceSoapBinding"
type="tns:CustomerService">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="getCustomersByName">
<soap:operation soapAction="" style="document"/>
<wsdl:input name="getCustomersByName">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="getCustomersByNameResponse">
<soap:body use="literal"/>
</wsdl:output>
<wsdl:fault name="NoSuchCustomerException">
<soap:fault name="NoSuchCustomerException" use="literal"/>
</wsdl:fault>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="CustomerServiceService">
<wsdl:port name="CustomerServicePort"
binding="tns:CustomerServiceServiceSoapBinding">
<soap:address location="http://localhost:9090/CustomerServicePort"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>