Hello Hans,
there`s no need to have WsExceptionFault twice defined as element, if
you have different messages getAFault and getBFault. Simply remove one
definition of WsExceptionFault element.
Regards,
Roman Heinrich
Hans Benedict wrote:
Hi,
I am building a simple POJO based web service offering two methods
which both throw the same custom exception:
public String getA(String x) throws WsException {...}
public String getB(String y) throws WsException {...}
WsException is extending AxisFault.
The generated wsdl file (.../axis2/services/ab?wsdl - see attachment)
then contains *two* elements named WsExceptionFault. On validation of
the file this leads to an error:
Duplicate key value [WsExceptionFault] declared for identity
constraint "element" of element "schema".
Is this a bug or am I missing something?
My environment:
axis2 1.2
tomcat 5.5.23
jdk-1_5_0_11
debian sarge
Kind regards,
Hans Benedict
------------------------------------------------------------------------
<wsdl:definitions xmlns:axis2="http://test.ws.cms.zedat.de"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:ns0="http://test.ws.cms.zedat.de/xsd"
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:ns1="http://org.apache.axis2/xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
targetNamespace="http://test.ws.cms.zedat.de">
<wsdl:documentation>ab</wsdl:documentation>
<wsdl:types>
<xs:schema xmlns:ns="http://test.ws.cms.zedat.de/xsd"
attributeFormDefault="qualified"
elementFormDefault="qualified"
targetNamespace="http://test.ws.cms.zedat.de/xsd">
<xs:element name="WsExceptionFault">
<xs:complexType>
<xs:sequence>
<xs:element name="WsException"
nillable="true"
type="ns:WsException" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="WsException" type="ns:WsException" />
<xs:complexType name="WsException">
<xs:sequence />
</xs:complexType>
<xs:element name="getA">
<xs:complexType>
<xs:sequence>
<xs:element name="x"
nillable="true"
type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="getAResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="return"
nillable="true"
type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="WsExceptionFault">
<xs:complexType>
<xs:sequence>
<xs:element name="WsException"
nillable="true"
type="ns:WsException" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="getB">
<xs:complexType>
<xs:sequence>
<xs:element name="y"
nillable="true"
type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="getBResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="return"
nillable="true"
type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
</wsdl:types>
<wsdl:message name="getBMessage">
<wsdl:part name="part1" element="ns0:getB" />
</wsdl:message>
<wsdl:message name="getBResponse">
<wsdl:part name="part1" element="ns0:getBResponse" />
</wsdl:message>
<wsdl:message name="getBFault">
<wsdl:part name="part1" element="ns0:WsExceptionFault" />
</wsdl:message>
<wsdl:message name="getAMessage">
<wsdl:part name="part1" element="ns0:getA" />
</wsdl:message>
<wsdl:message name="getAResponse">
<wsdl:part name="part1" element="ns0:getAResponse" />
</wsdl:message>
<wsdl:message name="getAFault">
<wsdl:part name="part1" element="ns0:WsExceptionFault" />
</wsdl:message>
<wsdl:portType name="abPortType">
<wsdl:operation name="getB">
<wsdl:input
xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
message="axis2:getBMessage" wsaw:Action="urn:getB"
/>
<wsdl:output message="axis2:getBResponse" />
<wsdl:fault message="axis2:getBFault" name="getBFault"
/>
</wsdl:operation>
<wsdl:operation name="getA">
<wsdl:input
xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
message="axis2:getAMessage" wsaw:Action="urn:getA"
/>
<wsdl:output message="axis2:getAResponse" />
<wsdl:fault message="axis2:getAFault" name="getAFault"
/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="abSOAP11Binding" type="axis2:abPortType">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"
style="document" />
<wsdl:operation name="getB">
<soap:operation soapAction="urn:getB" style="document"
/>
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
<wsdl:fault name="getBFault">
<soap12:fault use="literal" name="getBFault" />
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="getA">
<soap:operation soapAction="urn:getA" style="document"
/>
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
<wsdl:fault name="getAFault">
<soap12:fault use="literal" name="getAFault" />
</wsdl:fault>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="abSOAP12Binding" type="axis2:abPortType">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http"
style="document" />
<wsdl:operation name="getB">
<soap12:operation soapAction="urn:getB" style="document"
/>
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
<wsdl:fault name="getBFault">
<soap12:fault use="literal" name="getBFault" />
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="getA">
<soap12:operation soapAction="urn:getA" style="document"
/>
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
<wsdl:fault name="getAFault">
<soap12:fault use="literal" name="getAFault" />
</wsdl:fault>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="abHttpBinding" type="axis2:abPortType">
<http:binding verb="POST" />
<wsdl:operation name="getB">
<http:operation location="getB" />
<wsdl:input>
<mime:content type="text/xml" />
</wsdl:input>
<wsdl:output>
<mime:content type="text/xml" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="getA">
<http:operation location="getA" />
<wsdl:input>
<mime:content type="text/xml" />
</wsdl:input>
<wsdl:output>
<mime:content type="text/xml" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="ab">
<wsdl:port name="abSOAP11port_http"
binding="axis2:abSOAP11Binding">
<soap:address
location="http://130.133.2.83:8080/axis212/services/ab" />
</wsdl:port>
<wsdl:port name="abSOAP12port_http"
binding="axis2:abSOAP12Binding">
<soap12:address
location="http://130.133.2.83:8080/axis212/services/ab" />
</wsdl:port>
<wsdl:port name="abHttpport" binding="axis2:abHttpBinding">
<http:address
location="http://130.133.2.83:8080/axis212/services/ab" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
------------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
__________ Informacia od NOD32 2347 (20070623) __________
Tato sprava bola preverena antivirusovym systemom NOD32.
http://www.eset.sk
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]