I have an application that I generated from a WSDL (running on axis 1.2).  The Faults that it generates doesn’t seem to make sense to me.  I would appreciate if any one can tell me if the fault messages shown below are valid or not.

 

 

The method getPastTradePrice can throw two possible exceptions.  Here are the messages that Axis sends in case of the exceptions:
 

MyOtherException:

 

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Body>
        <soapenv:Fault>
            <faultcode>soapenv:Server.generalException</faultcode>
            <faultstring />
            <detail>
                <web.MyOtherException>
                    <ns1:myOtherString xmlns:ns1="http://web">xxxx</ns1:myOtherString>
                    <ns2:myString xmlns:ns2="http://web">2ndString</ns2:myString>
                </web.MyOtherException>
                <ns3:exceptionName xmlns:ns3="http://xml.apache.org/axis/">web.MyOtherException</ns3:exceptionName>
                <ns4:hostname xmlns:ns4="http://xml.apache.org/axis/">DMEHRTAS02</ns4:hostname>
            </detail>
        </soapenv:Fault>
    </soapenv:Body>
</soapenv:Envelope>

 

 

 

InvalidTickerException:

 

 

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Body>
        <soapenv:Fault>
            <faultcode>soapenv:Server.generalException</faultcode>
            <faultstring />
            <detail>
                <ns1:fault xmlns:ns1="http://web">
                    <ns1:tickerSymbol>xxx</ns1:tickerSymbol>
                </ns1:fault>
                <ns2:exceptionName xmlns:ns2="http://xml.apache.org/axis/">web.InvalidTickerException</ns2:exceptionName>
                <ns3:hostname xmlns:ns3="http://xml.apache.org/axis/">DMEHRTAS02</ns3:hostname>
            </detail>
        </soapenv:Fault>
    </soapenv:Body>
</soapenv:Envelope>

 

 

I have the following questions:

 

 

1)  Why is it that one of the exceptions is serialized under <ns1:fault xmlns:ns1="http://web">   and the other under <web.MyOtherException> ?
 
 
 
 
2)  What is the relationship between the detail and the wsdl,  in case of   <web.MyOtherException> ?

 

The WSDL for the Fault message is defined as:

 
 
<schema…..>

 

<complexType name="MyOtherException">
    <sequence>
     <element name="myOtherString" nillable="true" type="xsd:string"/>
     <element name="myString" nillable="true" type="xsd:string"/>
    </sequence>
   </complexType>

 

   <element name="fault1" type="impl:MyOtherException"/>
</schema>

            …………….

 

  <wsdl:message name="MyOtherException">
           <wsdl:part element="impl:fault1" name="fault"/>
         </wsdl:message>

 

Doesn’t this mean that the detail should look something like:

 

             <detail>
                <ns1:MyOtherException xmlns:ns1="http://web">
                    <ns1:myOtherString>xxxx</ns1:myOtherString>
                    <ns1:myString>2ndString </ns1:myString>
                </ns1:MyOtherException>
            </detail>

 

 

 

 

Thanks,

 

Daryoush Mehrtash

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://web"; xmlns:apachesoap="http://xml.apache.org/xml-soap"; xmlns:impl="http://web"; xmlns:intf="http://web"; xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"; xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"; xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
<!--WSDL created by Apache Axis version: 1.2
Built on May 26, 2005 (06:14:06 PDT)-->
 <wsdl:types>
  <schema elementFormDefault="qualified" targetNamespace="http://web"; xmlns="http://www.w3.org/2001/XMLSchema";>
   <element name="getPastTradePrice">
    <complexType>
     <sequence>
      <element name="tickerSymbol" type="xsd:string"/>
     </sequence>
    </complexType>
   </element>
   <element name="getPastTradePriceResponse">
    <complexType>
     <sequence>
      <element name="return" type="xsd:float"/>
     </sequence>
    </complexType>
   </element>
   <complexType name="InvalidTickerException">
    <sequence>
     <element name="tickerSymbol" nillable="true" type="xsd:string"/>
    </sequence>
   </complexType>
   <element name="fault" type="impl:InvalidTickerException"/>
   <complexType name="MyOtherException">
    <sequence>
     <element name="myOtherString" nillable="true" type="xsd:string"/>
     <element name="myString" nillable="true" type="xsd:string"/>
    </sequence>
   </complexType>
   <element name="fault1" type="impl:MyOtherException"/>
  </schema>
 </wsdl:types>

   <wsdl:message name="getPastTradePriceResponse">

      <wsdl:part element="impl:getPastTradePriceResponse" name="parameters"/>

   </wsdl:message>

   <wsdl:message name="getPastTradePriceRequest">

      <wsdl:part element="impl:getPastTradePrice" name="parameters"/>

   </wsdl:message>

   <wsdl:message name="MyOtherException">

      <wsdl:part element="impl:fault1" name="fault"/>

   </wsdl:message>

   <wsdl:message name="InvalidTickerException">

      <wsdl:part element="impl:fault" name="fault"/>

   </wsdl:message>

   <wsdl:portType name="StockQuoteProvider">

      <wsdl:operation name="getPastTradePrice">

         <wsdl:input message="impl:getPastTradePriceRequest" name="getPastTradePriceRequest"/>

         <wsdl:output message="impl:getPastTradePriceResponse" name="getPastTradePriceResponse"/>

         <wsdl:fault message="impl:MyOtherException" name="MyOtherException"/>

         <wsdl:fault message="impl:InvalidTickerException" name="InvalidTickerException"/>

      </wsdl:operation>

   </wsdl:portType>

   <wsdl:binding name="StockQuoteProviderSoapBinding" type="impl:StockQuoteProvider">

      <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>

      <wsdl:operation name="getPastTradePrice">

         <wsdlsoap:operation soapAction=""/>

         <wsdl:input name="getPastTradePriceRequest">

            <wsdlsoap:body use="literal"/>

         </wsdl:input>

         <wsdl:output name="getPastTradePriceResponse">

            <wsdlsoap:body use="literal"/>

         </wsdl:output>

         <wsdl:fault name="MyOtherException">

            <wsdlsoap:fault name="MyOtherException" use="literal"/>

         </wsdl:fault>

         <wsdl:fault name="InvalidTickerException">

            <wsdlsoap:fault name="InvalidTickerException" use="literal"/>

         </wsdl:fault>

      </wsdl:operation>

   </wsdl:binding>

   <wsdl:service name="StockQuoteProviderService">

      <wsdl:port binding="impl:StockQuoteProviderSoapBinding" name="StockQuoteProvider">

         <wsdlsoap:address location="http://localhost:8080/beehive133/web/StockQuoteProvider.jws"/>

      </wsdl:port>

   </wsdl:service>

</wsdl:definitions>

Reply via email to