You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Dave Cowing <dc...@enpresence.com> on 2006/07/27 16:51:10 UTC

[AXIS2] WSDL2Java not generating multiple faults

All,
 
First, I apologize for not following the appropriate process when I filed
this as a bug (AXIS2-922) before appropriately investigating it.
 
I'm trying to generate a skeleton and stub from my wsdl.  This works fine
when I only have a single fault.  But when I have multiple faults (3 in this
case), the generated skeleton is incorrect:
1) The service call in the skeleton declares the same fault class 3 times in
the throws section
2) Only one fault class is generated in the skeleton (the same on declared
in 1)
3) The stub adds the same fault class 3 times to the faultExceptionNameMap
and the faultExceptionClassNameMap
 
Any thoughts as to what I'm doing wrong?
 
WSDL:
 
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="CommunityIntegrationServices"
 targetNamespace="http://cis.example.com/2006/wsdl/cis/"
 xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
 xmlns:tns="http://cis.example.com/2006/wsdl/cis/"
 xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
 xmlns:xsd="http://www.w3.org/2001/XMLSchema"
 xmlns:ens="http://cis.example.com/2006/schemas/cis/">
 <wsdl:types>
  <xsd:schema
   targetNamespace="http://cis.example.com/2006/schemas/cis/"
   blockDefault="#all"
   xmlns:tns="http://cis.example.com/2006/schemas/cis/">
 
   <xsd:element name="updateMemberResponseMsg" type="xsd:int" />
   <xsd:element name="updateMemberRequestMsg"
    type="tns:UpdateMemberRequestType" />
 
   <xsd:complexType name="UpdateMemberRequestType">
    <xsd:complexContent>
     <xsd:extension
      base="tns:AbstractMemberRequestType">
      <xsd:sequence>
       <xsd:element name="userGalleryImage"
        type="tns:UserGalleryImageType" maxOccurs="unbounded"
        minOccurs="0">
       </xsd:element>
      </xsd:sequence>
     </xsd:extension>
    </xsd:complexContent>
   </xsd:complexType>
 
   <xsd:simpleType name="MemberIdType">
    <xsd:restriction base="xsd:string"></xsd:restriction>
   </xsd:simpleType>
 
   <xsd:simpleType name="PartnerIdType">
    <xsd:restriction base="xsd:long"></xsd:restriction>
   </xsd:simpleType>
 
   <xsd:complexType name="UserGalleryImageType">
    <xsd:complexContent>
     <xsd:extension base="tns:AbstractActionType">
      <xsd:sequence>
       <xsd:element name="imageId"
        type="xsd:string" maxOccurs="1" minOccurs="1">
       </xsd:element>
       <xsd:element name="title" type="xsd:string"
        maxOccurs="1" minOccurs="0">
       </xsd:element>
       <xsd:element name="description"
        type="xsd:string" maxOccurs="1" minOccurs="0">
       </xsd:element>
       <xsd:element name="image"
        type="xsd:base64Binary">
       </xsd:element>
      </xsd:sequence>
     </xsd:extension>
    </xsd:complexContent>
   </xsd:complexType>
 
   <xsd:complexType name="AbstractActionType">
    <xsd:sequence>
     <xsd:element name="action"
      type="tns:ActionCodeType">
     </xsd:element>
    </xsd:sequence>
   </xsd:complexType>
 
   <xsd:simpleType name="ActionCodeType">
    <xsd:restriction base="xsd:token">
     <xsd:enumeration value="AddOrUpdate"></xsd:enumeration>
     <xsd:enumeration value="Delete"></xsd:enumeration>
    </xsd:restriction>
   </xsd:simpleType>
 
   <xsd:complexType name="AbstractRequestType">
    <xsd:sequence>
     <xsd:element name="partnerId"
      type="tns:PartnerIdType">
     </xsd:element>
    </xsd:sequence>
   </xsd:complexType>
 
   <xsd:complexType name="AbstractMemberRequestType">
    <xsd:complexContent>
     <xsd:extension base="tns:AbstractRequestType">
      <xsd:sequence>
       <xsd:element name="memberId"
        type="tns:MemberIdType">
       </xsd:element>
      </xsd:sequence>
     </xsd:extension>
    </xsd:complexContent>
   </xsd:complexType>
   <xsd:element name="ErrorElement" type="tns:ErrorType"></xsd:element>
 
   <xsd:complexType name="ErrorType">
    <xsd:sequence>
     <xsd:element name="reason" type="xsd:string"/>
    </xsd:sequence>
   </xsd:complexType>
 
  </xsd:schema>
 </wsdl:types>
 
 <wsdl:message name="updateMemberResponseMsg">
  <wsdl:part name="updateMemberResponseMsg"
   element="ens:updateMemberResponseMsg" />
 </wsdl:message>
 <wsdl:message name="updateMemberRequestMsg">
  <wsdl:part name="updateMemberRequestMsg"
   element="ens:updateMemberRequestMsg" />
 </wsdl:message>
 <wsdl:message name="invalidDataFault">
  <wsdl:part name="invalidDataFault" element="ens:ErrorElement"></wsdl:part>
 </wsdl:message>
 <wsdl:message name="invalidMemberIdFault">
  <wsdl:part name="invalidMemberIdFault"
element="ens:ErrorElement"></wsdl:part>
 </wsdl:message>
 <wsdl:message name="invalidPartnerIdFault">
  <wsdl:part name="invalidPartnerIdFault"
element="ens:ErrorElement"></wsdl:part>
 </wsdl:message>
 <wsdl:portType name="updateMemberPort">
  <wsdl:operation name="updateMember">
   <wsdl:input message="tns:updateMemberRequestMsg" />
   <wsdl:output message="tns:updateMemberResponseMsg" />
   <wsdl:fault name="DataFault" message="tns:invalidDataFault" />
   <wsdl:fault name="InvalidMemberIdFault"
message="tns:invalidMemberIdFault" />
   <wsdl:fault name="InvalidPartnerIdFault"
message="tns:invalidPartnerIdFault" />
  </wsdl:operation>
 </wsdl:portType>
 <wsdl:binding name="updateMemberSOAP" type="tns:updateMemberPort">
  <soap:binding style="document"
   transport="http://schemas.xmlsoap.org/soap/http" />
  <wsdl:operation name="updateMember">
   <soap:operation soapAction="urn:updateMember"
    style="document" />
   <wsdl:input>
    <soap:body use="literal" />
   </wsdl:input>
   <wsdl:output>
    <soap:body use="literal" />
   </wsdl:output>
   <wsdl:fault name="DataFault">
    <soap:fault name="DataFault" use="literal" />
   </wsdl:fault>
   <wsdl:fault name="InvalidMemberIdFault">
    <soap:fault name="InvalidMemberIdFault" use="literal" />
   </wsdl:fault>
   <wsdl:fault name="InvalidPartnerIdFault">
    <soap:fault name="InvalidPartnerIdFault" use="literal" />
   </wsdl:fault>
  </wsdl:operation>
 </wsdl:binding>
 <wsdl:service name="updateMember">
  <wsdl:port binding="tns:updateMemberSOAP"
   name="updateMemberSOAP">
   <soap:address
    location="http://localhost:8080/axis2/services/updateMember" />
  </wsdl:port>
 </wsdl:service>
</wsdl:definitions>
 

RE: [AXIS2] WSDL2Java not generating multiple faults

Posted by Dave Cowing <dc...@enpresence.com>.
Thanks Anne, that fixed it.

Best,
Dave 

-----Original Message-----
From: Anne Thomas Manes [mailto:atmanes@gmail.com] 
Sent: Thursday, July 27, 2006 11:30 AM
To: axis-user@ws.apache.org
Subject: Re: [AXIS2] WSDL2Java not generating multiple faults

I imagine it's because you're using the same element for all three faults.
Anne

On 7/27/06, Dave Cowing <dc...@enpresence.com> wrote:
>
>
> All,
>
> First, I apologize for not following the appropriate process when I 
> filed this as a bug (AXIS2-922) before appropriately investigating it.
>
> I'm trying to generate a skeleton and stub from my wsdl.  This works 
> fine when I only have a single fault.  But when I have multiple faults 
> (3 in this case), the generated skeleton is incorrect:
> 1) The service call in the skeleton declares the same fault class 3 
> times in the throws section
> 2) Only one fault class is generated in the skeleton (the same on 
> declared in 1)
> 3) The stub adds the same fault class 3 times to the 
> faultExceptionNameMap and the faultExceptionClassNameMap
>
> Any thoughts as to what I'm doing wrong?
>
> WSDL:
>
> <?xml version="1.0" encoding="UTF-8"?> <wsdl:definitions 
> name="CommunityIntegrationServices"
>  targetNamespace="http://cis.example.com/2006/wsdl/cis/"
>  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
>  xmlns:tns="http://cis.example.com/2006/wsdl/cis/"
>  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
>  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>  xmlns:ens="http://cis.example.com/2006/schemas/cis/">
>  <wsdl:types>
>   <xsd:schema
>
> targetNamespace="http://cis.example.com/2006/schemas/cis/"
>    blockDefault="#all"
>    xmlns:tns="http://cis.example.com/2006/schemas/cis/">
>
>    <xsd:element name="updateMemberResponseMsg" type="xsd:int" />
>    <xsd:element name="updateMemberRequestMsg"
>     type="tns:UpdateMemberRequestType" />
>
>    <xsd:complexType name="UpdateMemberRequestType">
>     <xsd:complexContent>
>      <xsd:extension
>       base="tns:AbstractMemberRequestType">
>       <xsd:sequence>
>        <xsd:element name="userGalleryImage"
>         type="tns:UserGalleryImageType"
> maxOccurs="unbounded"
>         minOccurs="0">
>        </xsd:element>
>       </xsd:sequence>
>      </xsd:extension>
>     </xsd:complexContent>
>    </xsd:complexType>
>
>    <xsd:simpleType name="MemberIdType">
>     <xsd:restriction base="xsd:string"></xsd:restriction>
>    </xsd:simpleType>
>
>    <xsd:simpleType name="PartnerIdType">
>     <xsd:restriction base="xsd:long"></xsd:restriction>
>    </xsd:simpleType>
>
>    <xsd:complexType name="UserGalleryImageType">
>     <xsd:complexContent>
>      <xsd:extension base="tns:AbstractActionType">
>       <xsd:sequence>
>        <xsd:element name="imageId"
>         type="xsd:string" maxOccurs="1" minOccurs="1">
>        </xsd:element>
>        <xsd:element name="title" type="xsd:string"
>         maxOccurs="1" minOccurs="0">
>        </xsd:element>
>        <xsd:element name="description"
>         type="xsd:string" maxOccurs="1" minOccurs="0">
>        </xsd:element>
>        <xsd:element name="image"
>         type="xsd:base64Binary">
>        </xsd:element>
>       </xsd:sequence>
>      </xsd:extension>
>     </xsd:complexContent>
>    </xsd:complexType>
>
>    <xsd:complexType name="AbstractActionType">
>     <xsd:sequence>
>      <xsd:element name="action"
>       type="tns:ActionCodeType">
>      </xsd:element>
>     </xsd:sequence>
>    </xsd:complexType>
>
>    <xsd:simpleType name="ActionCodeType">
>     <xsd:restriction base="xsd:token">
>      <xsd:enumeration
> value="AddOrUpdate"></xsd:enumeration>
>      <xsd:enumeration value="Delete"></xsd:enumeration>
>     </xsd:restriction>
>    </xsd:simpleType>
>
>    <xsd:complexType name="AbstractRequestType">
>     <xsd:sequence>
>      <xsd:element name="partnerId"
>       type="tns:PartnerIdType">
>      </xsd:element>
>     </xsd:sequence>
>    </xsd:complexType>
>
>    <xsd:complexType name="AbstractMemberRequestType">
>     <xsd:complexContent>
>      <xsd:extension base="tns:AbstractRequestType">
>       <xsd:sequence>
>        <xsd:element name="memberId"
>         type="tns:MemberIdType">
>        </xsd:element>
>       </xsd:sequence>
>      </xsd:extension>
>     </xsd:complexContent>
>    </xsd:complexType>
>    <xsd:element name="ErrorElement"
> type="tns:ErrorType"></xsd:element>
>
>    <xsd:complexType name="ErrorType">
>     <xsd:sequence>
>      <xsd:element name="reason" type="xsd:string"/>
>     </xsd:sequence>
>    </xsd:complexType>
>
>   </xsd:schema>
>  </wsdl:types>
>
>  <wsdl:message name="updateMemberResponseMsg">
>   <wsdl:part name="updateMemberResponseMsg"
>    element="ens:updateMemberResponseMsg" />  </wsdl:message>  
> <wsdl:message name="updateMemberRequestMsg">
>   <wsdl:part name="updateMemberRequestMsg"
>    element="ens:updateMemberRequestMsg" />  </wsdl:message>  
> <wsdl:message name="invalidDataFault">
>   <wsdl:part name="invalidDataFault"
> element="ens:ErrorElement"></wsdl:part>
>  </wsdl:message>
>  <wsdl:message name="invalidMemberIdFault">
>   <wsdl:part name="invalidMemberIdFault"
> element="ens:ErrorElement"></wsdl:part>
>  </wsdl:message>
>  <wsdl:message name="invalidPartnerIdFault">
>   <wsdl:part name="invalidPartnerIdFault"
> element="ens:ErrorElement"></wsdl:part>
>  </wsdl:message>
>  <wsdl:portType name="updateMemberPort">
>   <wsdl:operation name="updateMember">
>    <wsdl:input message="tns:updateMemberRequestMsg" />
>    <wsdl:output message="tns:updateMemberResponseMsg" />
>    <wsdl:fault name="DataFault" message="tns:invalidDataFault" />
>    <wsdl:fault name="InvalidMemberIdFault"
> message="tns:invalidMemberIdFault" />
>    <wsdl:fault name="InvalidPartnerIdFault"
> message="tns:invalidPartnerIdFault" />
>   </wsdl:operation>
>  </wsdl:portType>
>  <wsdl:binding name="updateMemberSOAP" type="tns:updateMemberPort">
>   <soap:binding style="document"
>    transport="http://schemas.xmlsoap.org/soap/http" />
>   <wsdl:operation name="updateMember">
>    <soap:operation soapAction="urn:updateMember"
>     style="document" />
>    <wsdl:input>
>     <soap:body use="literal" />
>    </wsdl:input>
>    <wsdl:output>
>     <soap:body use="literal" />
>    </wsdl:output>
>    <wsdl:fault name="DataFault">
>     <soap:fault name="DataFault" use="literal" />
>    </wsdl:fault>
>    <wsdl:fault name="InvalidMemberIdFault">
>     <soap:fault name="InvalidMemberIdFault" use="literal" />
>    </wsdl:fault>
>    <wsdl:fault name="InvalidPartnerIdFault">
>     <soap:fault name="InvalidPartnerIdFault" use="literal" />
>    </wsdl:fault>
>   </wsdl:operation>
>  </wsdl:binding>
>  <wsdl:service name="updateMember">
>   <wsdl:port binding="tns:updateMemberSOAP"
>    name="updateMemberSOAP">
>    <soap:address
>
> location="http://localhost:8080/axis2/services/updateMember"
> />
>   </wsdl:port>
>  </wsdl:service>
> </wsdl:definitions>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: [AXIS2] WSDL2Java not generating multiple faults

Posted by Anne Thomas Manes <at...@gmail.com>.
I imagine it's because you're using the same element for all three faults.
Anne

On 7/27/06, Dave Cowing <dc...@enpresence.com> wrote:
>
>
> All,
>
> First, I apologize for not following the appropriate process when I filed
> this as a bug (AXIS2-922) before appropriately investigating it.
>
> I'm trying to generate a skeleton and stub from my wsdl.  This works fine
> when I only have a single fault.  But when I have multiple faults (3 in this
> case), the generated skeleton is incorrect:
> 1) The service call in the skeleton declares the same fault class 3 times in
> the throws section
> 2) Only one fault class is generated in the skeleton (the same on declared
> in 1)
> 3) The stub adds the same fault class 3 times to the faultExceptionNameMap
> and the faultExceptionClassNameMap
>
> Any thoughts as to what I'm doing wrong?
>
> WSDL:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <wsdl:definitions name="CommunityIntegrationServices"
>  targetNamespace="http://cis.example.com/2006/wsdl/cis/"
>  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
>  xmlns:tns="http://cis.example.com/2006/wsdl/cis/"
>  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
>  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>  xmlns:ens="http://cis.example.com/2006/schemas/cis/">
>  <wsdl:types>
>   <xsd:schema
>
> targetNamespace="http://cis.example.com/2006/schemas/cis/"
>    blockDefault="#all"
>    xmlns:tns="http://cis.example.com/2006/schemas/cis/">
>
>    <xsd:element name="updateMemberResponseMsg" type="xsd:int" />
>    <xsd:element name="updateMemberRequestMsg"
>     type="tns:UpdateMemberRequestType" />
>
>    <xsd:complexType name="UpdateMemberRequestType">
>     <xsd:complexContent>
>      <xsd:extension
>       base="tns:AbstractMemberRequestType">
>       <xsd:sequence>
>        <xsd:element name="userGalleryImage"
>         type="tns:UserGalleryImageType"
> maxOccurs="unbounded"
>         minOccurs="0">
>        </xsd:element>
>       </xsd:sequence>
>      </xsd:extension>
>     </xsd:complexContent>
>    </xsd:complexType>
>
>    <xsd:simpleType name="MemberIdType">
>     <xsd:restriction base="xsd:string"></xsd:restriction>
>    </xsd:simpleType>
>
>    <xsd:simpleType name="PartnerIdType">
>     <xsd:restriction base="xsd:long"></xsd:restriction>
>    </xsd:simpleType>
>
>    <xsd:complexType name="UserGalleryImageType">
>     <xsd:complexContent>
>      <xsd:extension base="tns:AbstractActionType">
>       <xsd:sequence>
>        <xsd:element name="imageId"
>         type="xsd:string" maxOccurs="1" minOccurs="1">
>        </xsd:element>
>        <xsd:element name="title" type="xsd:string"
>         maxOccurs="1" minOccurs="0">
>        </xsd:element>
>        <xsd:element name="description"
>         type="xsd:string" maxOccurs="1" minOccurs="0">
>        </xsd:element>
>        <xsd:element name="image"
>         type="xsd:base64Binary">
>        </xsd:element>
>       </xsd:sequence>
>      </xsd:extension>
>     </xsd:complexContent>
>    </xsd:complexType>
>
>    <xsd:complexType name="AbstractActionType">
>     <xsd:sequence>
>      <xsd:element name="action"
>       type="tns:ActionCodeType">
>      </xsd:element>
>     </xsd:sequence>
>    </xsd:complexType>
>
>    <xsd:simpleType name="ActionCodeType">
>     <xsd:restriction base="xsd:token">
>      <xsd:enumeration
> value="AddOrUpdate"></xsd:enumeration>
>      <xsd:enumeration value="Delete"></xsd:enumeration>
>     </xsd:restriction>
>    </xsd:simpleType>
>
>    <xsd:complexType name="AbstractRequestType">
>     <xsd:sequence>
>      <xsd:element name="partnerId"
>       type="tns:PartnerIdType">
>      </xsd:element>
>     </xsd:sequence>
>    </xsd:complexType>
>
>    <xsd:complexType name="AbstractMemberRequestType">
>     <xsd:complexContent>
>      <xsd:extension base="tns:AbstractRequestType">
>       <xsd:sequence>
>        <xsd:element name="memberId"
>         type="tns:MemberIdType">
>        </xsd:element>
>       </xsd:sequence>
>      </xsd:extension>
>     </xsd:complexContent>
>    </xsd:complexType>
>    <xsd:element name="ErrorElement"
> type="tns:ErrorType"></xsd:element>
>
>    <xsd:complexType name="ErrorType">
>     <xsd:sequence>
>      <xsd:element name="reason" type="xsd:string"/>
>     </xsd:sequence>
>    </xsd:complexType>
>
>   </xsd:schema>
>  </wsdl:types>
>
>  <wsdl:message name="updateMemberResponseMsg">
>   <wsdl:part name="updateMemberResponseMsg"
>    element="ens:updateMemberResponseMsg" />
>  </wsdl:message>
>  <wsdl:message name="updateMemberRequestMsg">
>   <wsdl:part name="updateMemberRequestMsg"
>    element="ens:updateMemberRequestMsg" />
>  </wsdl:message>
>  <wsdl:message name="invalidDataFault">
>   <wsdl:part name="invalidDataFault"
> element="ens:ErrorElement"></wsdl:part>
>  </wsdl:message>
>  <wsdl:message name="invalidMemberIdFault">
>   <wsdl:part name="invalidMemberIdFault"
> element="ens:ErrorElement"></wsdl:part>
>  </wsdl:message>
>  <wsdl:message name="invalidPartnerIdFault">
>   <wsdl:part name="invalidPartnerIdFault"
> element="ens:ErrorElement"></wsdl:part>
>  </wsdl:message>
>  <wsdl:portType name="updateMemberPort">
>   <wsdl:operation name="updateMember">
>    <wsdl:input message="tns:updateMemberRequestMsg" />
>    <wsdl:output message="tns:updateMemberResponseMsg" />
>    <wsdl:fault name="DataFault" message="tns:invalidDataFault" />
>    <wsdl:fault name="InvalidMemberIdFault"
> message="tns:invalidMemberIdFault" />
>    <wsdl:fault name="InvalidPartnerIdFault"
> message="tns:invalidPartnerIdFault" />
>   </wsdl:operation>
>  </wsdl:portType>
>  <wsdl:binding name="updateMemberSOAP" type="tns:updateMemberPort">
>   <soap:binding style="document"
>    transport="http://schemas.xmlsoap.org/soap/http" />
>   <wsdl:operation name="updateMember">
>    <soap:operation soapAction="urn:updateMember"
>     style="document" />
>    <wsdl:input>
>     <soap:body use="literal" />
>    </wsdl:input>
>    <wsdl:output>
>     <soap:body use="literal" />
>    </wsdl:output>
>    <wsdl:fault name="DataFault">
>     <soap:fault name="DataFault" use="literal" />
>    </wsdl:fault>
>    <wsdl:fault name="InvalidMemberIdFault">
>     <soap:fault name="InvalidMemberIdFault" use="literal" />
>    </wsdl:fault>
>    <wsdl:fault name="InvalidPartnerIdFault">
>     <soap:fault name="InvalidPartnerIdFault" use="literal" />
>    </wsdl:fault>
>   </wsdl:operation>
>  </wsdl:binding>
>  <wsdl:service name="updateMember">
>   <wsdl:port binding="tns:updateMemberSOAP"
>    name="updateMemberSOAP">
>    <soap:address
>
> location="http://localhost:8080/axis2/services/updateMember"
> />
>   </wsdl:port>
>  </wsdl:service>
> </wsdl:definitions>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org