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 ra...@jpmchase.com on 2005/08/25 20:08:27 UTC

Trying to throw a Custom Exception by declaring it in WSDL

Hello,

Here is my WSDL  .

After I run  WSDL2Java  (axis 1.2)    .. when I look into the generated 
Interface(DataInquiry.java) I am expecting that to throw my custom 
exception  "InvalidDataFormatException"  along with RemoteException. but I 
could see only RemoteException being thrown..  ( WSDL2Java  creates 
InvalidDataFormatException.java) . Please let me know what is wrong with 
my WSDL? 

Your help is highly appreciated!


<?xml version="1.0" ?>

<definitions name="urn:DataInquiry"
             targetNamespace="urn:DataInquiry2"
             xmlns:tns="urn:DataInquiry2"
             xmlns:typens="urn:DataInquiry2"
                  xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
             xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
 
             xmlns="http://schemas.xmlsoap.org/wsdl/" 
xmlns:xsd1="java:com.ws.exceptions">

  <!-- type defs -->
  <import namespace="java:com.ws.exceptions" 
location="ExceptionSchema.xsd"></import>
  <types>
    <xsd:schema targetNamespace="urn:DataInquiry2"
                xmlns:xsd="http://www.w3.org/2001/XMLSchema">


      <xsd:complexType name="inquiryRequest">
        <xsd:all>
            <xsd:element name="recordNumber" type="xsd:string"/>
            <xsd:element name="lNumber" type="xsd:string"/>
        </xsd:all>
      </xsd:complexType>

      <xsd:complexType name="inquiryResponse">
        <xsd:all>
            <xsd:element name="statusCode" type="xsd:string"/>
            <xsd:element name="mNumber" type="xsd:string"/>
            <xsd:element name="mFlag" type="xsd:string"/>
            <xsd:element name="mFlag" type="xsd:string"/>
            <xsd:element name="LAFlag" type="xsd:string"/>
        </xsd:all>
      </xsd:complexType>
 
 
    </xsd:schema>
  </types>

  <!-- message declns -->
  <message name="empty"/>

 
 
  <!-- Raj -->
 
   <message name="GetInquiryDataRequest">
    <part  name="inquiryRequest" type="typens:inquiryRequest"/>
  </message>

   <message name="GetInquiryDataResponse">
    <part  name="inquiryResponse" type="typens:inquiryResponse"/>
  </message>
 
  <message name="InvalidDataFormatException">
  <part  name="InvalidDataFormatException" 
type="xsd1:InvalidDataFormatException">
  </part>
  </message>
 
 
  <!-- port type declns -->
  <portType name="DataInquiry">
 
    <operation name="getInquiryData">
      <input name="input" message="tns:GetInquiryDataRequest"/>
      <output name="output" message="tns:GetInquiryDataResponse"/>
      <fault name="InvalidDataFormatException" 
message="tns:InvalidDataFormatException"/>
 
    </operation>
  </portType>

  <!-- binding declns -->
  <binding name="DataInquirySOAPBinding" type="tns:DataInquiry">
    <soap:binding style="document"
                  transport="http://schemas.xmlsoap.org/soap/http"/>
 
    <operation name="getInquiryData">
 
       <soap:operation soapAction=""/> 
      <input name="input"> 
        <soap:body use="literal"/> 
      </input> 
      <output name="output"> 
        <soap:body use="literal"/> 
      </output>
 
    </operation>
  </binding>

  <!-- service decln -->
  <service name="DataInquiryService">
    <port name="DataInquiry" binding="tns:DataInquirySOAPBinding">
      <soap:address 
location="http://localhost:8080/InquiryWSWAR/services/DataInquiry"/>
    </port>
  </service>

</definitions>