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 Jarmo Doc <ja...@hotmail.com> on 2006/01/12 20:16:15 UTC

Exceptions are killing me

My Axis 1.3 server operations throw MyException which is defined something 
like this (though in reality it's more complex):

public class MyException extends AxisFault implements Serializable
{
  private String mytext;
  public String getMytext() {return mytext;}
  public void setMytext(String mytext) {this.mytext = mytext;}
  // the normal wsdl2java generated stuff such
  // as constructor, getSerializer(), getDeserializer()
}

I see this serialized on the line as:

<soapenv:Fault xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <faultcode>soapenv:Server.userException</faultcode>
   <faultstring>mypackage.MyException</faultstring>
   <detail>
    <faultData>
     <mytext>testing exceptions</mytext>
    </faultData>
    <ns1:stackTrace
    ... stack trace here ...
    </ns1:stackTrace>
    <ns2:hostname 
xmlns:ns2="http://xml.apache.org/axis/">myhostname</ns2:hostname>
    </detail>
</soapenv:Fault>

I'm not an expert here, obviously, but I'm pretty sure that this 
serialization is wrong.  In particular:

1. the fault string is the name of the exception class, which is odd
2. it refers to <faultData> when I'd expect to see <ns1:MyException> or 
similar
3. it should not contain a server-side stack trace

As it stands, a client that attempts to deserialize this has no clue what 
type the contained exception is and thus fails.

My cubicle wall now has a large hole from me banging my head into it on a 
regular basis ;-) so could someone please offer a clue as to what could be 
going wrong.  What could cause Axis to serialize my exception in this way?

Thanks.

_________________________________________________________________
On the road to retirement? Check out MSN Life Events for advice on how to 
get there! http://lifeevents.msn.com/category.aspx?cid=Retirement


Re: Exceptions are killing me

Posted by iksrazal <ik...@gmail.com>.
TestServiceResponse has nothing to do with the rest of the services. The one 
common denominator is ReturnWebBase. The wsdl I enclosed has all those - 
arrays of objects, and single objects. As for pure void, that'd be Robust 
one-way that returns 200, 404 or 500, etc. IIRC axis2 doesn't have a pure 
'fire and forget'  - yet. 

Anyways, for non-void, the idea is: 

extension base="tns:ReturnWebBase" 

on your responses. See 'wiseLoginResponse' and 'testServiceResponse' for two 
examples. 

That would require a change to the wsdl. You may have to leave it for next 
time, but as I said its worked wonders for me. 

HTH,
iksrazal
http://www.braziloutsource.com/

Em Quinta 12 Janeiro 2006 18:40, o Jarmo Doc escreveu:
> Thanks very much for the good idea.  If I understand you, every object that
> your operations return would be derived from (or explicilty include)
> TestServiceResponse.  If so then that would have a big impact on my WSDL
> (which right now has operations that return arrays of objects, single
> objects, and even void in some cases).
>
> Having said that, if I don't get exceptions working very soon then I may
> think seriously about your idea.  Thanks for taking the time to help.
>
> >From: iksrazal <ik...@gmail.com>
> >Reply-To: axis-user@ws.apache.org
> >To: axis-user@ws.apache.org
> >Subject: Re: Exceptions are killing me
> >Date: Thu, 12 Jan 2006 17:19:26 -0200
> >
> >You know, I often see people banging their head against a wall when it
> >comes
> >to Exceptions and SOAP. So let me give you a hint that has worked
> >splendidly
> >for me over several projects: Don't even use them. Return an error code
> > and message, generated in your try / catch block.
> >
> >Allow the code to explain ( axis2, but I've used the idea in both axis 1.x
> >and
> >Sun's JWSDP):
> >
> >  public  TestServiceResponseDocument testService(
> >             TestServiceDocument testServiceDocument) {
> >    // prepare output
> >         TestServiceResponseDocument retDoc =
> >             TestServiceResponseDocument.Factory.newInstance();
> >
> >         TestServiceResponse retElement =
> >             TestServiceResponse.Factory.newInstance();
> >                     TestService testService =
> >testServiceDocument.getTestService();
> >             String soapSessionId = testService.getSoapSessionId();
> >             String webUserName = testService.getWebUserName();
> >         try {
> >
> >             if (!authenticator.validateSoapSessionId(soapSessionId,
> >                     webUserName)) {
> >                 wiseMobilAdapter.handleDefaultTimeout(retElement,
> >webUserName);
> >             } else {
> >                 wiseMobilAdapter.testService(retElement);
> >             }
> >
> >         } catch (Exception ex) {
> >             logger.error("SWAWiseEndpointSkeleton.testService:"
> >                     + ex.getMessage(), ex);
> >             retElement.setErrorMessage(ex.getMessage());
> >             retElement.setSuccessErrorCode(MessagesCodes.FAILURE);
> >         }
> >         retDoc.setTestServiceResponse(retElement);
> >         return retDoc;
> >     }
> >
> >The idea here is retElement is passed in to the adapter, which sets the
> >pass /
> >fail status and any other variables needed to return. Or, the try catch in
> >the skeleton does the error handling in case of session timeout, login
> >problems etc.
>
> [snip]
>
> _________________________________________________________________
> Express yourself instantly with MSN Messenger! Download today - it's FREE!
> http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

-- 

Re: Exceptions are killing me

Posted by Jarmo Doc <ja...@hotmail.com>.
Thanks very much for the good idea.  If I understand you, every object that 
your operations return would be derived from (or explicilty include) 
TestServiceResponse.  If so then that would have a big impact on my WSDL 
(which right now has operations that return arrays of objects, single 
objects, and even void in some cases).

Having said that, if I don't get exceptions working very soon then I may 
think seriously about your idea.  Thanks for taking the time to help.


>From: iksrazal <ik...@gmail.com>
>Reply-To: axis-user@ws.apache.org
>To: axis-user@ws.apache.org
>Subject: Re: Exceptions are killing me
>Date: Thu, 12 Jan 2006 17:19:26 -0200
>
>You know, I often see people banging their head against a wall when it 
>comes
>to Exceptions and SOAP. So let me give you a hint that has worked 
>splendidly
>for me over several projects: Don't even use them. Return an error code and
>message, generated in your try / catch block.
>
>Allow the code to explain ( axis2, but I've used the idea in both axis 1.x 
>and
>Sun's JWSDP):
>
>  public  TestServiceResponseDocument testService(
>             TestServiceDocument testServiceDocument) {
>    // prepare output
>         TestServiceResponseDocument retDoc =
>             TestServiceResponseDocument.Factory.newInstance();
>
>         TestServiceResponse retElement =
>             TestServiceResponse.Factory.newInstance();
>                     TestService testService =
>testServiceDocument.getTestService();
>             String soapSessionId = testService.getSoapSessionId();
>             String webUserName = testService.getWebUserName();
>         try {
>
>             if (!authenticator.validateSoapSessionId(soapSessionId,
>                     webUserName)) {
>                 wiseMobilAdapter.handleDefaultTimeout(retElement,
>webUserName);
>             } else {
>                 wiseMobilAdapter.testService(retElement);
>             }
>
>         } catch (Exception ex) {
>             logger.error("SWAWiseEndpointSkeleton.testService:"
>                     + ex.getMessage(), ex);
>             retElement.setErrorMessage(ex.getMessage());
>             retElement.setSuccessErrorCode(MessagesCodes.FAILURE);
>         }
>         retDoc.setTestServiceResponse(retElement);
>         return retDoc;
>     }
>
>The idea here is retElement is passed in to the adapter, which sets the 
>pass /
>fail status and any other variables needed to return. Or, the try catch in
>the skeleton does the error handling in case of session timeout, login
>problems etc.
>
[snip]

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/


Re: Exceptions are killing me

Posted by iksrazal <ik...@gmail.com>.
You know, I often see people banging their head against a wall when it comes 
to Exceptions and SOAP. So let me give you a hint that has worked splendidly 
for me over several projects: Don't even use them. Return an error code and 
message, generated in your try / catch block. 

Allow the code to explain ( axis2, but I've used the idea in both axis 1.x and 
Sun's JWSDP): 

 public  TestServiceResponseDocument testService(
            TestServiceDocument testServiceDocument) {
   // prepare output
        TestServiceResponseDocument retDoc =
            TestServiceResponseDocument.Factory.newInstance();
        
        TestServiceResponse retElement =
            TestServiceResponse.Factory.newInstance();
                    TestService testService = 
testServiceDocument.getTestService();
            String soapSessionId = testService.getSoapSessionId();
            String webUserName = testService.getWebUserName();
        try {
            
            if (!authenticator.validateSoapSessionId(soapSessionId, 
                    webUserName)) {
                wiseMobilAdapter.handleDefaultTimeout(retElement, 
webUserName);
            } else {
                wiseMobilAdapter.testService(retElement);
            }
            
        } catch (Exception ex) {
            logger.error("SWAWiseEndpointSkeleton.testService:"
                    + ex.getMessage(), ex);
            retElement.setErrorMessage(ex.getMessage());
            retElement.setSuccessErrorCode(MessagesCodes.FAILURE);
        }
        retDoc.setTestServiceResponse(retElement);
        return retDoc;
    }

The idea here is retElement is passed in to the adapter, which sets the pass / 
fail status and any other variables needed to return. Or, the try catch in 
the skeleton does the error handling in case of session timeout, login 
problems etc. 

As far as the wsdl goes, just define the error login once, and use 'extension 
base' with all your services. I'll post an entire wsdl - not too large - to 
prevent skipping something relevant: 

<?xml version="1.0" encoding="UTF-8"?>

<definitions name="SWAWiseService" targetNamespace="http://swaWiseNS" 
xmlns:tns="http://swaWiseNS" xmlns="http://schemas.xmlsoap.org/wsdl/" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
xmlns:ns2="http://swaWiseNS/types">
  <types>
    <schema targetNamespace="http://swaWiseNS/types" 
xmlns:tns="http://swaWiseNS/types" 
xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
xmlns="http://www.w3.org/2001/XMLSchema">
      <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
      <complexType name="ReturnWebBase">
        <sequence>
          <element name="errorMessage" type="xsd:string"/>
          <element name="successErrorCode" type="xsd:int"/>
        </sequence>
      </complexType>
      <element name="wiseLogin">
        <complexType>
          <sequence>
            <element name="user_name" type="xsd:string"/>
            <element name="user_password" type="xsd:string"/>
          </sequence>
        </complexType>
      </element>
      <element name="wiseLoginResponse">
        <complexType>
          <complexContent>
            <extension base="tns:ReturnWebBase">
              <sequence>
                <element name="soap_session_id" type="xsd:string"/>
                <element name="web_user_name" type="xsd:string"/>
              </sequence>
            </extension>
          </complexContent>
        </complexType>
      </element>
      <element name="testService">
        <complexType>
          <sequence>
            <element name="soap_session_id" type="xsd:string"/>
            <element name="web_user_name" type="xsd:string"/>
          </sequence>
        </complexType>
      </element>
      <element name="testServiceResponse">
        <complexType>
          <complexContent>
            <extension base="tns:ReturnWebBase">
              <sequence>
                <element name="testId" type="xsd:long"/>
              </sequence>
            </extension>
          </complexContent>
        </complexType>
      </element>
      <!-- 13a --> 
      <element name="acionarAutomatico">
        <complexType>
          <sequence>
            <element name="soap_session_id" type="xsd:string"/>
            <element name="web_user_name" type="xsd:string"/>
            <element name="NumeroOS" type="xsd:string"/>
            <element name="DataHoraDoAcionamento" type="xsd:dateTime"/>
          </sequence>
        </complexType>
      </element>
      <!-- 13b --> 
      <element name="deslocarAutomatico">
        <complexType>
          <sequence>
            <element name="soap_session_id" type="xsd:string"/>
            <element name="web_user_name" type="xsd:string"/>
            <element name="NumeroOSStc" type="xsd:string"/>
            <element name="DataHoraDoDeslocamento" type="xsd:dateTime"/>
            <element name="KmFinalDeDeslocamento" type="xsd:string"/>
          </sequence>
        </complexType>
      </element>
      <!-- 13c --> 
      <element name="receberMsgTecnicoFinalDeslocamento">
        <complexType>
          <sequence>
            <element name="soap_session_id" type="xsd:string"/>
            <element name="web_user_name" type="xsd:string"/>
            <element name="NumeroOSStc" type="xsd:string"/>
            <element name="DataHoraFinalDaAtividade" type="xsd:dateTime"/>
            <element name="kmFinalDeExecucao" type="xsd:string"/>
          </sequence>
        </complexType>
      </element>
      <!-- 13d --> 
      <element name="receberMsgTecnicoInicioExec">
        <complexType>
          <sequence>
            <element name="soap_session_id" type="xsd:string"/>
            <element name="web_user_name" type="xsd:string"/>
            <element name="NumeroOSStc" type="xsd:string"/>
            <element name="DataHoraFinalDaAtividade" type="xsd:dateTime"/>
          </sequence>
        </complexType>
      </element>
      <!-- 13e --> 
      <element name="receberMsgTecnicoFinalAtividade">
        <complexType>
          <sequence>
            <element name="soap_session_id" type="xsd:string"/>
            <element name="web_user_name" type="xsd:string"/>
            <element name="NumeroOSStc" type="xsd:string"/>
            <element name="DataHoraFinalDaAtividade" type="xsd:dateTime"/>
          </sequence>
        </complexType>
      </element>
      <complexType name="ArrayOfItemQtyConsumido">
        <sequence>
          <element minOccurs="0" maxOccurs="unbounded" name="ItemQtyConsumido" 
nillable="false" type="tns:ItemQtyConsumido" />
        </sequence>
      </complexType>
      <complexType name="ItemQtyConsumido">
        <sequence>
          <element minOccurs="1" maxOccurs="1" name="ItemConsumido" 
type="xsd:string"/>
          <element minOccurs="1" maxOccurs="1" name="QuantidadeItemConsumido" 
type="xsd:int"/>
        </sequence>
      </complexType>
      <!-- 14 --> 
      <element name="encerrarAutomatico">
        <complexType>
          <sequence>
            <element name="soap_session_id" type="xsd:string"/>
            <element name="web_user_name" type="xsd:string"/>
            <element name="NumeroOSStc" type="xsd:string"/>
            <element name="Status" type="xsd:string"/>
            <element name="InformacoesComplementares" type="xsd:string"/>
            <element name="CodigoDeEncerramento" type="xsd:string"/>
            <element name="DataHoraEncerramento" type="xsd:dateTime"/>
            <element name="ProprietarioModem" type="xsd:string"/>
            <element name="ModemRetirado" type="xsd:string"/>
            <element name="NumRAT" type="xsd:string"/>
            <element name="NotaFiscal" type="xsd:string"/>
            <element name="ModemSemID" type="xsd:string"/>
            <element name="Fonte" type="xsd:string"/>
            <element name="USB" type="xsd:string"/>
            <element name="Cbfonte" type="xsd:string"/>
            <element name="Manual" type="xsd:string"/>
            <element name="Cbrede" type="xsd:string"/>
            <element name="CD" type="xsd:string"/>
            <element name="Cbvoz" type="xsd:string"/>
            <element name="Filtro" type="xsd:string"/>
            <element name="QtdFiltro" type="xsd:string"/>
            <element name="NaoAplicavel" type="xsd:string"/>
            <element name="ATT" type="xsd:string"/>
            <element name="CX" type="xsd:string"/>
            <element name="SNR" type="xsd:string"/>
            <element name="CB" type="xsd:string"/>
            <element name="MAXT" type="xsd:string"/>
            <element name="LAT" type="xsd:string"/>
            <element name="DIST" type="xsd:string"/>
            <element name="PAR" type="xsd:string"/>
            <element name="SEC" type="xsd:string"/>
            <element name="ARM" type="xsd:string"/>
            <element name="ItemQtyConsumido" minOccurs="0" maxOccurs="1" 
type="tns:ArrayOfItemQtyConsumido"/>
            <element name="SN" type="xsd:string"/>
          </sequence>
        </complexType>
      </element>
      <element name="ReturnWebBaseResponse" type="ns2:ReturnWebBase"/>
</schema></types>
  <message name="SWAWiseEndpoint_encerrarAutomatico">
    <part name="parameters" element="ns2:encerrarAutomatico"/>
  </message>
  <message name="SWAWiseEndpoint_encerrarAutomaticoResponse">
    <part name="result" element="ns2:ReturnWebBaseResponse"/>
  </message>
  <message name="SWAWiseEndpoint_receberMsgTecnicoFinalDeslocamento">
    <part name="parameters" element="ns2:receberMsgTecnicoFinalDeslocamento"/>
  </message>
  <message name="SWAWiseEndpoint_receberMsgTecnicoFinalDeslocamentoResponse">
    <part name="result" element="ns2:ReturnWebBaseResponse"/>
  </message>
  <message name="SWAWiseEndpoint_receberMsgTecnicoInicioExec">
    <part name="parameters" element="ns2:receberMsgTecnicoInicioExec"/>
  </message>
  <message name="SWAWiseEndpoint_receberMsgTecnicoInicioExecResponse">
    <part name="result" element="ns2:ReturnWebBaseResponse"/>
  </message>
  <message name="SWAWiseEndpoint_receberMsgTecnicoFinalAtividade">
    <part name="parameters" element="ns2:receberMsgTecnicoFinalAtividade"/>
  </message>
  <message name="SWAWiseEndpoint_receberMsgTecnicoFinalAtividadeResponse">
    <part name="result" element="ns2:ReturnWebBaseResponse"/>
  </message>
  <message name="SWAWiseEndpoint_deslocarAutomatico">
    <part name="parameters" element="ns2:deslocarAutomatico"/>
  </message>
  <message name="SWAWiseEndpoint_deslocarAutomaticoResponse">
    <part name="result" element="ns2:ReturnWebBaseResponse"/>
  </message>
  <message name="SWAWiseEndpoint_acionarAutomatico">
     <part name="parameters" element="ns2:acionarAutomatico"/>
  </message>
  <message name="SWAWiseEndpoint_acionarAutomaticoResponse">
    <part name="result" element="ns2:ReturnWebBaseResponse"/>
  </message>
  <message name="SWAWiseEndpoint_testService">
     <part name="parameters" element="ns2:testService"/>
  </message>
  <message name="SWAWiseEndpoint_testServiceResponse">
    <part name="result" element="ns2:testServiceResponse"/>
  </message>
  <message name="SWAWiseEndpoint_wiseLogin">
     <part name="parameters" element="ns2:wiseLogin"/>
  </message>
  <message name="SWAWiseEndpoint_wiseLoginResponse">
    <part name="result" element="ns2:wiseLoginResponse"/>
  </message>
  <portType name="SWAWiseEndpoint">
    <operation name="encerrarAutomatico">
      <input message="tns:SWAWiseEndpoint_encerrarAutomatico" 
name="SWAWiseEndpoint_encerrarAutomatico"/>
      <output message="tns:SWAWiseEndpoint_encerrarAutomaticoResponse" 
name="SWAWiseEndpoint_encerrarAutomaticoResponse"/>
    </operation>
    <operation name="receberMsgTecnicoFinalDeslocamento">
      <input message="tns:SWAWiseEndpoint_receberMsgTecnicoFinalDeslocamento" 
name="SWAWiseEndpoint_receberMsgTecnicoFinalDeslocamento"/>
      <output 
message="tns:SWAWiseEndpoint_receberMsgTecnicoFinalDeslocamentoResponse" 
name="SWAWiseEndpoint_receberMsgTecnicoFinalDeslocamentoResponse"/>
    </operation>
    <operation name="receberMsgTecnicoInicioExec">
      <input message="tns:SWAWiseEndpoint_receberMsgTecnicoInicioExec" 
name="SWAWiseEndpoint_receberMsgTecnicoInicioExec"/>
      <output 
message="tns:SWAWiseEndpoint_receberMsgTecnicoInicioExecResponse" 
name="SWAWiseEndpoint_receberMsgTecnicoInicioExecResponse"/>
    </operation>
    <operation name="receberMsgTecnicoFinalAtividade">
      <input message="tns:SWAWiseEndpoint_receberMsgTecnicoFinalAtividade" 
name="SWAWiseEndpoint_receberMsgTecnicoFinalAtividade"/>
      <output 
message="tns:SWAWiseEndpoint_receberMsgTecnicoFinalAtividadeResponse" 
name="SWAWiseEndpoint_receberMsgTecnicoFinalAtividadeResponse"/>
    </operation>
    <operation name="deslocarAutomatico">
      <input message="tns:SWAWiseEndpoint_deslocarAutomatico" 
name="SWAWiseEndpoint_deslocarAutomatico"/>
      <output message="tns:SWAWiseEndpoint_deslocarAutomaticoResponse" 
name="SWAWiseEndpoint_deslocarAutomaticoResponse"/>
    </operation>
    <operation name="acionarAutomatico">
      <input message="tns:SWAWiseEndpoint_acionarAutomatico" 
name="SWAWiseEndpoint_acionarAutomatico"/>
      <output message="tns:SWAWiseEndpoint_acionarAutomaticoResponse" 
name="SWAWiseEndpoint_acionarAutomaticoResponse"/>
    </operation>
    <operation name="testService">
      <input message="tns:SWAWiseEndpoint_testService" 
name="SWAWiseEndpoint_testService"/>
      <output message="tns:SWAWiseEndpoint_testServiceResponse" 
name="SWAWiseEndpoint_testServiceResponse"/>
    </operation>
    <operation name="wiseLogin">
      <input message="tns:SWAWiseEndpoint_wiseLogin" 
name="SWAWiseEndpoint_wiseLogin"/>
      <output message="tns:SWAWiseEndpoint_wiseLoginResponse" 
name="SWAWiseEndpoint_wiseLoginResponse"/>
    </operation>
  </portType>
  <binding name="SWAWiseEndpointBinding" type="tns:SWAWiseEndpoint">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" 
style="document"/>
    <operation name="receberMsgTecnicoFinalDeslocamento">
      <soap:operation soapAction="receberMsgTecnicoFinalDeslocamento"/>
      <input name="SWAWiseEndpoint_receberMsgTecnicoFinalDeslocamento">
        <soap:body use="literal"/>
      </input>
      <output 
name="SWAWiseEndpoint_receberMsgTecnicoFinalDeslocamentoResponse">
        <soap:body use="literal"/>
      </output>
    </operation>
    <operation name="receberMsgTecnicoInicioExec">
      <soap:operation soapAction="receberMsgTecnicoInicioExec"/>
      <input name="SWAWiseEndpoint_receberMsgTecnicoInicioExec">
        <soap:body use="literal"/>
      </input>
      <output name="SWAWiseEndpoint_receberMsgTecnicoInicioExecResponse">
        <soap:body use="literal"/>
      </output>
    </operation>
    <operation name="receberMsgTecnicoFinalAtividade">
      <soap:operation soapAction="receberMsgTecnicoFinalAtividade"/>
      <input name="SWAWiseEndpoint_receberMsgTecnicoFinalAtividade">
        <soap:body use="literal"/>
      </input>
      <output name="SWAWiseEndpoint_receberMsgTecnicoFinalAtividadeResponse">
        <soap:body use="literal"/>
      </output>
    </operation>
    <operation name="encerrarAutomatico">
      <soap:operation soapAction="encerrarAutomatico"/>
      <input name="SWAWiseEndpoint_encerrarAutomatico">
        <soap:body use="literal"/>
      </input>
      <output name="SWAWiseEndpoint_encerrarAutomaticoResponse">
        <soap:body use="literal"/>
      </output>
    </operation>
    <operation name="receberMsgTecnicoInicioExec">
      <soap:operation soapAction="receberMsgTecnicoInicioExec"/>
      <input name="SWAWiseEndpoint_receberMsgTecnicoInicioExec">
        <soap:body use="literal"/>
      </input>
      <output name="SWAWiseEndpoint_receberMsgTecnicoInicioExecResponse">
        <soap:body use="literal"/>
      </output>
    </operation>
    <operation name="wiseLogin">
      <soap:operation soapAction="wiseLogin"/>
      <input name="SWAWiseEndpoint_wiseLogin">
        <soap:body use="literal"/>
      </input>
      <output name="SWAWiseEndpoint_wiseLoginResponse">
        <soap:body use="literal"/>
      </output>
    </operation>
    <operation name="testService">
      <soap:operation soapAction="testService"/>
      <input name="SWAWiseEndpoint_testService">
        <soap:body use="literal"/>
      </input>
      <output name="SWAWiseEndpoint_testServiceResponse">
        <soap:body use="literal"/>
      </output>
    </operation>
    <operation name="acionarAutomatico">
      <soap:operation soapAction="acionarAutomatico"/>
      <input name="SWAWiseEndpoint_acionarAutomatico">
        <soap:body use="literal"/>
      </input>
      <output name="SWAWiseEndpoint_acionarAutomaticoResponse">
        <soap:body use="literal"/>
      </output>
    </operation>
    <operation name="deslocarAutomatico">
      <soap:operation soapAction="deslocarAutomatico"/>
      <input name="SWAWiseEndpoint_deslocarAutomatico">
        <soap:body use="literal"/>
      </input>
      <output name="SWAWiseEndpoint_deslocarAutomaticoResponse">
        <soap:body use="literal"/>
      </output>
    </operation>
  </binding>
  <service name="SWAWiseService">
    <port name="SWAWiseEndpointPort" binding="tns:SWAWiseEndpointBinding">
      <soap:address 
location="http://10.129.63.33/swa_ws_test/services/SWAWiseEndpoint"/></port></service></definitions>

Take a look at testServiceResponse. 

HTH,
iksrazal
http://www.braziloutsource.com/

Em Quinta 12 Janeiro 2006 17:16, o Jarmo Doc escreveu:
> My Axis 1.3 server operations throw MyException which is defined something
> like this (though in reality it's more complex):
>
> public class MyException extends AxisFault implements Serializable
> {
>   private String mytext;
>   public String getMytext() {return mytext;}
>   public void setMytext(String mytext) {this.mytext = mytext;}
>   // the normal wsdl2java generated stuff such
>   // as constructor, getSerializer(), getDeserializer()
> }
>
> I see this serialized on the line as:
>
> <soapenv:Fault xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
>    <faultcode>soapenv:Server.userException</faultcode>
>    <faultstring>mypackage.MyException</faultstring>
>    <detail>
>     <faultData>
>      <mytext>testing exceptions</mytext>
>     </faultData>
>     <ns1:stackTrace
>     ... stack trace here ...
>     </ns1:stackTrace>
>     <ns2:hostname
> xmlns:ns2="http://xml.apache.org/axis/">myhostname</ns2:hostname>
>     </detail>
> </soapenv:Fault>
>
> I'm not an expert here, obviously, but I'm pretty sure that this
> serialization is wrong.  In particular:
>
> 1. the fault string is the name of the exception class, which is odd
> 2. it refers to <faultData> when I'd expect to see <ns1:MyException> or
> similar
> 3. it should not contain a server-side stack trace
>
> As it stands, a client that attempts to deserialize this has no clue what
> type the contained exception is and thus fails.
>
> My cubicle wall now has a large hole from me banging my head into it on a
> regular basis ;-) so could someone please offer a clue as to what could be
> going wrong.  What could cause Axis to serialize my exception in this way?
>
> Thanks.
>
> _________________________________________________________________
> On the road to retirement? Check out MSN Life Events for advice on how to
> get there! http://lifeevents.msn.com/category.aspx?cid=Retirement

-- 
http://www.braziloutsource.com/

Re: Exceptions are killing me

Posted by Davanum Srinivas <da...@gmail.com>.
better if you can repro with the standard tests in axis 1.x...see
test/wsdl/fault and test/wsdl/fault2

thanks,
dims

On 1/12/06, Jarmo Doc <ja...@hotmail.com> wrote:
> It's many thousands of lines of text so let me work on a minimal sample that
> also exhibits the problem and I'll get back to you.  Thanks for the offer of
> help dims.
>
>
> >From: Davanum Srinivas <da...@gmail.com>
> >Reply-To: dims@apache.org
> >To: axis-user@ws.apache.org
> >Subject: Re: Exceptions are killing me
> >Date: Thu, 12 Jan 2006 14:37:59 -0500
> >
> >Can u please post the wsdl?
>
> _________________________________________________________________
> Is your PC infected? Get a FREE online computer virus scan from McAfee(r)
> Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
>
>


--
Davanum Srinivas : http://wso2.com/blogs/

Re: Exceptions are killing me

Posted by Jarmo Doc <ja...@hotmail.com>.
It's many thousands of lines of text so let me work on a minimal sample that 
also exhibits the problem and I'll get back to you.  Thanks for the offer of 
help dims.


>From: Davanum Srinivas <da...@gmail.com>
>Reply-To: dims@apache.org
>To: axis-user@ws.apache.org
>Subject: Re: Exceptions are killing me
>Date: Thu, 12 Jan 2006 14:37:59 -0500
>
>Can u please post the wsdl?

_________________________________________________________________
Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ 
Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963


Re: Exceptions are killing me

Posted by Davanum Srinivas <da...@gmail.com>.
Can u please post the wsdl?

thanks,
dims

On 1/12/06, Jarmo Doc <ja...@hotmail.com> wrote:
> My Axis 1.3 server operations throw MyException which is defined something
> like this (though in reality it's more complex):
>
> public class MyException extends AxisFault implements Serializable
> {
>   private String mytext;
>   public String getMytext() {return mytext;}
>   public void setMytext(String mytext) {this.mytext = mytext;}
>   // the normal wsdl2java generated stuff such
>   // as constructor, getSerializer(), getDeserializer()
> }
>
> I see this serialized on the line as:
>
> <soapenv:Fault xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
>    <faultcode>soapenv:Server.userException</faultcode>
>    <faultstring>mypackage.MyException</faultstring>
>    <detail>
>     <faultData>
>      <mytext>testing exceptions</mytext>
>     </faultData>
>     <ns1:stackTrace
>     ... stack trace here ...
>     </ns1:stackTrace>
>     <ns2:hostname
> xmlns:ns2="http://xml.apache.org/axis/">myhostname</ns2:hostname>
>     </detail>
> </soapenv:Fault>
>
> I'm not an expert here, obviously, but I'm pretty sure that this
> serialization is wrong.  In particular:
>
> 1. the fault string is the name of the exception class, which is odd
> 2. it refers to <faultData> when I'd expect to see <ns1:MyException> or
> similar
> 3. it should not contain a server-side stack trace
>
> As it stands, a client that attempts to deserialize this has no clue what
> type the contained exception is and thus fails.
>
> My cubicle wall now has a large hole from me banging my head into it on a
> regular basis ;-) so could someone please offer a clue as to what could be
> going wrong.  What could cause Axis to serialize my exception in this way?
>
> Thanks.
>
> _________________________________________________________________
> On the road to retirement? Check out MSN Life Events for advice on how to
> get there! http://lifeevents.msn.com/category.aspx?cid=Retirement
>
>


--
Davanum Srinivas : http://wso2.com/blogs/

Re: Exceptions are killing me

Posted by Jarmo Doc <ja...@hotmail.com>.
OK Dims, here's the XML from the standard Axis 1.3 test/wsdl/faults2 (which 
is a doc/lit testcase, thus relevant to my situation).

I'd say that it's substantially similar to the XML that I personally see 
with my custom exceptions, and therefore I would venture to say that it's 
*not* fully deserializable by a gSOAP client (because it does not correctly 
indicate the embedded exception type).

<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>
    <msg>
     <a>throw</a>
     <b>0</b>
     <c>throw</c>
    </msg>
    <ns1:exceptionName 
xmlns:ns1="http://xml.apache.org/axis/">test.wsdl.faults2.TestFault</ns1:exceptionName>
    <ns2:hostname 
xmlns:ns2="http://xml.apache.org/axis/">myhostname</ns2:hostname>
   </detail>
  </soapenv:Fault></soapenv:Body></soapenv:Envelope>

This is essentially what I was seeing earlier.  What do you think?  Thanks.


>From: Davanum Srinivas <da...@gmail.com>
>Reply-To: dims@apache.org
>To: axis-user@ws.apache.org
>Subject: Re: Exceptions are killing me
>Date: Thu, 12 Jan 2006 15:06:57 -0500
>
>Can u try to see the on the wire serialization is for test\wsdl\faults
>example? in a servlet environment? last i check that was fine. it
>starts from a wsdl.
>
>You may need to switch off the hostname and stack trace stuff (see
>axis.development.system in
>http://ws.apache.org/axis/java/reference.html) for interop with other
>stacks.
>
>thanks,
>dims
>
>
>On 1/12/06, Jarmo Doc <ja...@hotmail.com> wrote:
> > Apologies, I attached the wrong serialization -- that one was from an
> > exception that derived from Exception rather thanAxisFault (I've tried 
>both
> > and neither works unless you happening to be talking to an Axis cleint).
> >
> > Here's the serialization (that's still wrong) derving from AxisFault:
> >
> > <soapenv:Fault 
>xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
> >    <faultcode>soapenv:Server.generalException</faultcode>
> >    <faultstring/>
> >    <detail>
> >     <ns1:fault xmlns:ns1="mypackage">
> >      <ns2:mytext xmlns:ns2="mypackage">testing exceptions</ns2:mytext>
> >     </ns1:fault>
> >     <ns4:exceptionName
> > 
>xmlns:ns4="http://xml.apache.org/axis/">mypackage.MyException</ns4:exceptionName>
> >     <ns5:stackTrace xmlns:ns5="http://xml.apache.org/axis/">
> >     ... stack trace here ...
> >     </ns5:stackTrace>
> >     <ns6:hostname
> > xmlns:ns6="http://xml.apache.org/axis/">myhostname</ns6:hostname>
> >    </detail>
> > </soapenv:Fault>
> >
> > Aside from 'exceptionName' which I believe is an old hack to allow Axis
> > clients (and only Axis clients) to work out what type the exception is, 
>this
> > fault does not indicate the type of the embedded exception.
> >
> > Should not:
> >
> >   <ns1:fault xmlns:ns1="mypackage">
> >
> > instead be something like this:
> >
> >   <ns1:fault xmlns:ns1="mypackage" type="MyException">
> >
> > How do I correct this behavior?
> >
> > >From: "Jarmo Doc" <ja...@hotmail.com>
> > >Reply-To: axis-user@ws.apache.org
> > >To: axis-user@ws.apache.org
> > >Subject: Exceptions are killing me
> > >Date: Thu, 12 Jan 2006 11:16:15 -0800
> > >
> > >My Axis 1.3 server operations throw MyException which is defined 
>something
> > >like this (though in reality it's more complex):
> > >
> > >public class MyException extends AxisFault implements Serializable
> > >{
> > >  private String mytext;
> > >  public String getMytext() {return mytext;}
> > >  public void setMytext(String mytext) {this.mytext = mytext;}
> > >  // the normal wsdl2java generated stuff such
> > >  // as constructor, getSerializer(), getDeserializer()
> > >}
> > >
> > >I see this serialized on the line as:
> > >
> > ><soapenv:Fault 
>xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
> > >   <faultcode>soapenv:Server.userException</faultcode>
> > >   <faultstring>mypackage.MyException</faultstring>
> > >   <detail>
> > >    <faultData>
> > >     <mytext>testing exceptions</mytext>
> > >    </faultData>
> > >    <ns1:stackTrace
> > >    ... stack trace here ...
> > >    </ns1:stackTrace>
> > >    <ns2:hostname
> > >xmlns:ns2="http://xml.apache.org/axis/">myhostname</ns2:hostname>
> > >    </detail>
> > ></soapenv:Fault>
> > >
> > >I'm not an expert here, obviously, but I'm pretty sure that this
> > >serialization is wrong.  In particular:
> > >
> > >1. the fault string is the name of the exception class, which is odd
> > >2. it refers to <faultData> when I'd expect to see <ns1:MyException> or
> > >similar
> > >3. it should not contain a server-side stack trace
> > >
> > >As it stands, a client that attempts to deserialize this has no clue 
>what
> > >type the contained exception is and thus fails.
> > >
> > >My cubicle wall now has a large hole from me banging my head into it on 
>a
> > >regular basis ;-) so could someone please offer a clue as to what could 
>be
> > >going wrong.  What could cause Axis to serialize my exception in this 
>way?
> > >
> > >Thanks.
> >
> > _________________________________________________________________
> > On the road to retirement? Check out MSN Life Events for advice on how 
>to
> > get there! http://lifeevents.msn.com/category.aspx?cid=Retirement
> >
> >
>
>
>--
>Davanum Srinivas : http://wso2.com/blogs/

_________________________________________________________________
Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ 
Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963


Re: Exceptions are killing me

Posted by Davanum Srinivas <da...@gmail.com>.
Jarmo,

the runtime generated wsdl should match the soap message on the wire.
The wsdl says there is an element <msg> within the detail. which is
true. So Axis is not at fault. Also AFAIK, Since this is doc/lit,
there should not be a xsi:type (unless it is a derived fault). Only
remaining issue is the extra infromation which soap processors usually
ignore if they don't grok it. So i do stand by the assertion that this
is a gSOAP issue.

This is not the first time gSOAP is giving us grief...see for example
(http://issues.apache.org/jira/browse/AXIS-1836).

Could u try switching to Axis/C++?

thanks,
dims

On 1/13/06, Jarmo Doc <ja...@hotmail.com> wrote:
> OK, adding elementFormDefault="qualified" to the ?WSDL output file caused
> the gSOAP "Warning: part 'msg' uses literal style and must refer to an
> element rather than a type." message to go away.
>
> However, going back to what I consider to be the main issue: the XML below.
> The only place that it indicates 'test.wsdl.faults2.TestFault' is in the
> exceptionName tag.  I'm under the impression that exceptionName is an
> Axis-specific hack and therefore there is no way that any non-Axis client is
> going to be able to deserialize this exception.  Sorry to press you on this,
> but is my diagnosis correct and is this a bug in Axis?
>
>
> >From: Davanum Srinivas <da...@gmail.com>
> >Reply-To: dims@apache.org
> >To: axis-user@ws.apache.org
> >Subject: Re: Exceptions are killing me
> >Date: Fri, 13 Jan 2006 11:33:34 -0500
> >
> >2 tips worth trying: (note that Axis has gone thru so many interops
> >and tck's so i feel this is a gsoap problem)
> >
> >- try editing the schema and add elementFormDefault="qualified" and
> >*THEN* generate the code, then use the generated code
> >- After the prev step, save the dyanmic wsdl
> >http://localhost:8080/axis/services/FaultService?wsdl, make sure it
> >still has the qualified (if not add it) then run the gSOAP's
> >wsdl-to-code generator.
> >
> >thanks,
> >dims
> >
> >On 1/13/06, Jarmo Doc <ja...@hotmail.com> wrote:
> > > Note that gSOAP 2.7.6c doesn't like test/wsdl/faults2/FaultService.wsdl.
> >  In
> > > particular it complains that:
> > >
> > > Warning: part 'msg' uses literal style and must refer to an element
> >rather
> > > than a type
> > >
> > >
> > > >From: "Jarmo Doc" <ja...@hotmail.com>
> > > >Reply-To: axis-user@ws.apache.org
> > > >To: dims@apache.org, axis-user@ws.apache.org
> > > >Subject: Re: Exceptions are killing me
> > > >Date: Thu, 12 Jan 2006 18:41:39 -0800
> > > >
> > > >[Re-sending]
> > > >
> > > >OK Dims, here's the XML from the standard Axis 1.3 test/wsdl/faults2
> >(which
> > > >is a doc/lit testcase, thus relevant to my situation).
> > > >
> > > >I'd say that it's substantially similar to the XML that I personally
> >see
> > > >with my custom exceptions, and therefore I would venture to say that
> >it's
> > > >*not* fully deserializable by a gSOAP client (because it does not
> >correctly
> > > >indicate the embedded exception type).
> > > >
> > > ><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>
> > > >    <msg>
> > > >     <a>throw</a>
> > > >     <b>0</b>
> > > >     <c>throw</c>
> > > >    </msg>
> > > >    <ns1:exceptionName
> > >
> > >xmlns:ns1="http://xml.apache.org/axis/">test.wsdl.faults2.TestFault</ns1:exceptionName>
> > > >    <ns2:hostname
> > > >xmlns:ns2="http://xml.apache.org/axis/">myhostname</ns2:hostname>
> > > >   </detail>
> > > >  </soapenv:Fault></soapenv:Body></soapenv:Envelope>
> > > >
> > > >This is essentially what I was seeing earlier.  What do you think?
> >Thanks.
> > > >
> > > >
> > > >
> > > >>From: Davanum Srinivas <da...@gmail.com>
> > > >>Reply-To: dims@apache.org
> > > >>To: axis-user@ws.apache.org
> > > >>Subject: Re: Exceptions are killing me
> > > >>Date: Thu, 12 Jan 2006 15:06:57 -0500
> > > >>
> > > >>Can u try to see the on the wire serialization is for test\wsdl\faults
> > > >>example? in a servlet environment? last i check that was fine. it
> > > >>starts from a wsdl.
> > > >>
> > > >>You may need to switch off the hostname and stack trace stuff (see
> > > >>axis.development.system in
> > > >>http://ws.apache.org/axis/java/reference.html) for interop with other
> > > >>stacks.
> > > >>
> > > >>thanks,
> > > >>dims
> > > >
> > > >_________________________________________________________________
> > > >Express yourself instantly with MSN Messenger! Download today - it's
> >FREE!
> > > >http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
> > > >
> > >
> > > _________________________________________________________________
> > > Don't just search. Find. Check out the new MSN Search!
> > > http://search.msn.click-url.com/go/onm00200636ave/direct/01/
> > >
> > >
> >
> >
> >--
> >Davanum Srinivas : http://wso2.com/blogs/
>
> _________________________________________________________________
> Is your PC infected? Get a FREE online computer virus scan from McAfee(r)
> Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
>
>


--
Davanum Srinivas : http://wso2.com/blogs/

Re: Exceptions are killing me

Posted by Jarmo Doc <ja...@hotmail.com>.
OK, adding elementFormDefault="qualified" to the ?WSDL output file caused 
the gSOAP "Warning: part 'msg' uses literal style and must refer to an 
element rather than a type." message to go away.

However, going back to what I consider to be the main issue: the XML below.  
The only place that it indicates 'test.wsdl.faults2.TestFault' is in the 
exceptionName tag.  I'm under the impression that exceptionName is an 
Axis-specific hack and therefore there is no way that any non-Axis client is 
going to be able to deserialize this exception.  Sorry to press you on this, 
but is my diagnosis correct and is this a bug in Axis?


>From: Davanum Srinivas <da...@gmail.com>
>Reply-To: dims@apache.org
>To: axis-user@ws.apache.org
>Subject: Re: Exceptions are killing me
>Date: Fri, 13 Jan 2006 11:33:34 -0500
>
>2 tips worth trying: (note that Axis has gone thru so many interops
>and tck's so i feel this is a gsoap problem)
>
>- try editing the schema and add elementFormDefault="qualified" and
>*THEN* generate the code, then use the generated code
>- After the prev step, save the dyanmic wsdl
>http://localhost:8080/axis/services/FaultService?wsdl, make sure it
>still has the qualified (if not add it) then run the gSOAP's
>wsdl-to-code generator.
>
>thanks,
>dims
>
>On 1/13/06, Jarmo Doc <ja...@hotmail.com> wrote:
> > Note that gSOAP 2.7.6c doesn't like test/wsdl/faults2/FaultService.wsdl. 
>  In
> > particular it complains that:
> >
> > Warning: part 'msg' uses literal style and must refer to an element 
>rather
> > than a type
> >
> >
> > >From: "Jarmo Doc" <ja...@hotmail.com>
> > >Reply-To: axis-user@ws.apache.org
> > >To: dims@apache.org, axis-user@ws.apache.org
> > >Subject: Re: Exceptions are killing me
> > >Date: Thu, 12 Jan 2006 18:41:39 -0800
> > >
> > >[Re-sending]
> > >
> > >OK Dims, here's the XML from the standard Axis 1.3 test/wsdl/faults2 
>(which
> > >is a doc/lit testcase, thus relevant to my situation).
> > >
> > >I'd say that it's substantially similar to the XML that I personally 
>see
> > >with my custom exceptions, and therefore I would venture to say that 
>it's
> > >*not* fully deserializable by a gSOAP client (because it does not 
>correctly
> > >indicate the embedded exception type).
> > >
> > ><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>
> > >    <msg>
> > >     <a>throw</a>
> > >     <b>0</b>
> > >     <c>throw</c>
> > >    </msg>
> > >    <ns1:exceptionName
> > 
> >xmlns:ns1="http://xml.apache.org/axis/">test.wsdl.faults2.TestFault</ns1:exceptionName>
> > >    <ns2:hostname
> > >xmlns:ns2="http://xml.apache.org/axis/">myhostname</ns2:hostname>
> > >   </detail>
> > >  </soapenv:Fault></soapenv:Body></soapenv:Envelope>
> > >
> > >This is essentially what I was seeing earlier.  What do you think?  
>Thanks.
> > >
> > >
> > >
> > >>From: Davanum Srinivas <da...@gmail.com>
> > >>Reply-To: dims@apache.org
> > >>To: axis-user@ws.apache.org
> > >>Subject: Re: Exceptions are killing me
> > >>Date: Thu, 12 Jan 2006 15:06:57 -0500
> > >>
> > >>Can u try to see the on the wire serialization is for test\wsdl\faults
> > >>example? in a servlet environment? last i check that was fine. it
> > >>starts from a wsdl.
> > >>
> > >>You may need to switch off the hostname and stack trace stuff (see
> > >>axis.development.system in
> > >>http://ws.apache.org/axis/java/reference.html) for interop with other
> > >>stacks.
> > >>
> > >>thanks,
> > >>dims
> > >
> > >_________________________________________________________________
> > >Express yourself instantly with MSN Messenger! Download today - it's 
>FREE!
> > >http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
> > >
> >
> > _________________________________________________________________
> > Don't just search. Find. Check out the new MSN Search!
> > http://search.msn.click-url.com/go/onm00200636ave/direct/01/
> >
> >
>
>
>--
>Davanum Srinivas : http://wso2.com/blogs/

_________________________________________________________________
Is your PC infected? Get a FREE online computer virus scan from McAfeeŽ 
Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963


Re: Exceptions are killing me

Posted by Davanum Srinivas <da...@gmail.com>.
2 tips worth trying: (note that Axis has gone thru so many interops
and tck's so i feel this is a gsoap problem)

- try editing the schema and add elementFormDefault="qualified" and
*THEN* generate the code, then use the generated code
- After the prev step, save the dyanmic wsdl
http://localhost:8080/axis/services/FaultService?wsdl, make sure it
still has the qualified (if not add it) then run the gSOAP's
wsdl-to-code generator.

thanks,
dims

On 1/13/06, Jarmo Doc <ja...@hotmail.com> wrote:
> Note that gSOAP 2.7.6c doesn't like test/wsdl/faults2/FaultService.wsdl.  In
> particular it complains that:
>
> Warning: part 'msg' uses literal style and must refer to an element rather
> than a type
>
>
> >From: "Jarmo Doc" <ja...@hotmail.com>
> >Reply-To: axis-user@ws.apache.org
> >To: dims@apache.org, axis-user@ws.apache.org
> >Subject: Re: Exceptions are killing me
> >Date: Thu, 12 Jan 2006 18:41:39 -0800
> >
> >[Re-sending]
> >
> >OK Dims, here's the XML from the standard Axis 1.3 test/wsdl/faults2 (which
> >is a doc/lit testcase, thus relevant to my situation).
> >
> >I'd say that it's substantially similar to the XML that I personally see
> >with my custom exceptions, and therefore I would venture to say that it's
> >*not* fully deserializable by a gSOAP client (because it does not correctly
> >indicate the embedded exception type).
> >
> ><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>
> >    <msg>
> >     <a>throw</a>
> >     <b>0</b>
> >     <c>throw</c>
> >    </msg>
> >    <ns1:exceptionName
> >xmlns:ns1="http://xml.apache.org/axis/">test.wsdl.faults2.TestFault</ns1:exceptionName>
> >    <ns2:hostname
> >xmlns:ns2="http://xml.apache.org/axis/">myhostname</ns2:hostname>
> >   </detail>
> >  </soapenv:Fault></soapenv:Body></soapenv:Envelope>
> >
> >This is essentially what I was seeing earlier.  What do you think?  Thanks.
> >
> >
> >
> >>From: Davanum Srinivas <da...@gmail.com>
> >>Reply-To: dims@apache.org
> >>To: axis-user@ws.apache.org
> >>Subject: Re: Exceptions are killing me
> >>Date: Thu, 12 Jan 2006 15:06:57 -0500
> >>
> >>Can u try to see the on the wire serialization is for test\wsdl\faults
> >>example? in a servlet environment? last i check that was fine. it
> >>starts from a wsdl.
> >>
> >>You may need to switch off the hostname and stack trace stuff (see
> >>axis.development.system in
> >>http://ws.apache.org/axis/java/reference.html) for interop with other
> >>stacks.
> >>
> >>thanks,
> >>dims
> >
> >_________________________________________________________________
> >Express yourself instantly with MSN Messenger! Download today - it's FREE!
> >http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
> >
>
> _________________________________________________________________
> Don't just search. Find. Check out the new MSN Search!
> http://search.msn.click-url.com/go/onm00200636ave/direct/01/
>
>


--
Davanum Srinivas : http://wso2.com/blogs/

Re: Exceptions are killing me

Posted by Jarmo Doc <ja...@hotmail.com>.
Note that gSOAP 2.7.6c doesn't like test/wsdl/faults2/FaultService.wsdl.  In 
particular it complains that:

Warning: part 'msg' uses literal style and must refer to an element rather 
than a type


>From: "Jarmo Doc" <ja...@hotmail.com>
>Reply-To: axis-user@ws.apache.org
>To: dims@apache.org, axis-user@ws.apache.org
>Subject: Re: Exceptions are killing me
>Date: Thu, 12 Jan 2006 18:41:39 -0800
>
>[Re-sending]
>
>OK Dims, here's the XML from the standard Axis 1.3 test/wsdl/faults2 (which 
>is a doc/lit testcase, thus relevant to my situation).
>
>I'd say that it's substantially similar to the XML that I personally see 
>with my custom exceptions, and therefore I would venture to say that it's 
>*not* fully deserializable by a gSOAP client (because it does not correctly 
>indicate the embedded exception type).
>
><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>
>    <msg>
>     <a>throw</a>
>     <b>0</b>
>     <c>throw</c>
>    </msg>
>    <ns1:exceptionName 
>xmlns:ns1="http://xml.apache.org/axis/">test.wsdl.faults2.TestFault</ns1:exceptionName>
>    <ns2:hostname 
>xmlns:ns2="http://xml.apache.org/axis/">myhostname</ns2:hostname>
>   </detail>
>  </soapenv:Fault></soapenv:Body></soapenv:Envelope>
>
>This is essentially what I was seeing earlier.  What do you think?  Thanks.
>
>
>
>>From: Davanum Srinivas <da...@gmail.com>
>>Reply-To: dims@apache.org
>>To: axis-user@ws.apache.org
>>Subject: Re: Exceptions are killing me
>>Date: Thu, 12 Jan 2006 15:06:57 -0500
>>
>>Can u try to see the on the wire serialization is for test\wsdl\faults
>>example? in a servlet environment? last i check that was fine. it
>>starts from a wsdl.
>>
>>You may need to switch off the hostname and stack trace stuff (see
>>axis.development.system in
>>http://ws.apache.org/axis/java/reference.html) for interop with other
>>stacks.
>>
>>thanks,
>>dims
>
>_________________________________________________________________
>Express yourself instantly with MSN Messenger! Download today - it's FREE! 
>http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
>

_________________________________________________________________
Don’t just search. Find. Check out the new MSN Search! 
http://search.msn.click-url.com/go/onm00200636ave/direct/01/


Re: Exceptions are killing me

Posted by Jarmo Doc <ja...@hotmail.com>.
[Re-sending]

OK Dims, here's the XML from the standard Axis 1.3 test/wsdl/faults2 (which 
is a doc/lit testcase, thus relevant to my situation).

I'd say that it's substantially similar to the XML that I personally see 
with my custom exceptions, and therefore I would venture to say that it's 
*not* fully deserializable by a gSOAP client (because it does not correctly 
indicate the embedded exception type).

<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>
    <msg>
     <a>throw</a>
     <b>0</b>
     <c>throw</c>
    </msg>
    <ns1:exceptionName 
xmlns:ns1="http://xml.apache.org/axis/">test.wsdl.faults2.TestFault</ns1:exceptionName>
    <ns2:hostname 
xmlns:ns2="http://xml.apache.org/axis/">myhostname</ns2:hostname>
   </detail>
  </soapenv:Fault></soapenv:Body></soapenv:Envelope>

This is essentially what I was seeing earlier.  What do you think?  Thanks.



>From: Davanum Srinivas <da...@gmail.com>
>Reply-To: dims@apache.org
>To: axis-user@ws.apache.org
>Subject: Re: Exceptions are killing me
>Date: Thu, 12 Jan 2006 15:06:57 -0500
>
>Can u try to see the on the wire serialization is for test\wsdl\faults
>example? in a servlet environment? last i check that was fine. it
>starts from a wsdl.
>
>You may need to switch off the hostname and stack trace stuff (see
>axis.development.system in
>http://ws.apache.org/axis/java/reference.html) for interop with other
>stacks.
>
>thanks,
>dims

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/


Re: Exceptions are killing me

Posted by Davanum Srinivas <da...@gmail.com>.
Can u try to see the on the wire serialization is for test\wsdl\faults
example? in a servlet environment? last i check that was fine. it
starts from a wsdl.

You may need to switch off the hostname and stack trace stuff (see
axis.development.system in
http://ws.apache.org/axis/java/reference.html) for interop with other
stacks.

thanks,
dims


On 1/12/06, Jarmo Doc <ja...@hotmail.com> wrote:
> Apologies, I attached the wrong serialization -- that one was from an
> exception that derived from Exception rather thanAxisFault (I've tried both
> and neither works unless you happening to be talking to an Axis cleint).
>
> Here's the serialization (that's still wrong) derving from AxisFault:
>
> <soapenv:Fault xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
>    <faultcode>soapenv:Server.generalException</faultcode>
>    <faultstring/>
>    <detail>
>     <ns1:fault xmlns:ns1="mypackage">
>      <ns2:mytext xmlns:ns2="mypackage">testing exceptions</ns2:mytext>
>     </ns1:fault>
>     <ns4:exceptionName
> xmlns:ns4="http://xml.apache.org/axis/">mypackage.MyException</ns4:exceptionName>
>     <ns5:stackTrace xmlns:ns5="http://xml.apache.org/axis/">
>     ... stack trace here ...
>     </ns5:stackTrace>
>     <ns6:hostname
> xmlns:ns6="http://xml.apache.org/axis/">myhostname</ns6:hostname>
>    </detail>
> </soapenv:Fault>
>
> Aside from 'exceptionName' which I believe is an old hack to allow Axis
> clients (and only Axis clients) to work out what type the exception is, this
> fault does not indicate the type of the embedded exception.
>
> Should not:
>
>   <ns1:fault xmlns:ns1="mypackage">
>
> instead be something like this:
>
>   <ns1:fault xmlns:ns1="mypackage" type="MyException">
>
> How do I correct this behavior?
>
> >From: "Jarmo Doc" <ja...@hotmail.com>
> >Reply-To: axis-user@ws.apache.org
> >To: axis-user@ws.apache.org
> >Subject: Exceptions are killing me
> >Date: Thu, 12 Jan 2006 11:16:15 -0800
> >
> >My Axis 1.3 server operations throw MyException which is defined something
> >like this (though in reality it's more complex):
> >
> >public class MyException extends AxisFault implements Serializable
> >{
> >  private String mytext;
> >  public String getMytext() {return mytext;}
> >  public void setMytext(String mytext) {this.mytext = mytext;}
> >  // the normal wsdl2java generated stuff such
> >  // as constructor, getSerializer(), getDeserializer()
> >}
> >
> >I see this serialized on the line as:
> >
> ><soapenv:Fault xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
> >   <faultcode>soapenv:Server.userException</faultcode>
> >   <faultstring>mypackage.MyException</faultstring>
> >   <detail>
> >    <faultData>
> >     <mytext>testing exceptions</mytext>
> >    </faultData>
> >    <ns1:stackTrace
> >    ... stack trace here ...
> >    </ns1:stackTrace>
> >    <ns2:hostname
> >xmlns:ns2="http://xml.apache.org/axis/">myhostname</ns2:hostname>
> >    </detail>
> ></soapenv:Fault>
> >
> >I'm not an expert here, obviously, but I'm pretty sure that this
> >serialization is wrong.  In particular:
> >
> >1. the fault string is the name of the exception class, which is odd
> >2. it refers to <faultData> when I'd expect to see <ns1:MyException> or
> >similar
> >3. it should not contain a server-side stack trace
> >
> >As it stands, a client that attempts to deserialize this has no clue what
> >type the contained exception is and thus fails.
> >
> >My cubicle wall now has a large hole from me banging my head into it on a
> >regular basis ;-) so could someone please offer a clue as to what could be
> >going wrong.  What could cause Axis to serialize my exception in this way?
> >
> >Thanks.
>
> _________________________________________________________________
> On the road to retirement? Check out MSN Life Events for advice on how to
> get there! http://lifeevents.msn.com/category.aspx?cid=Retirement
>
>


--
Davanum Srinivas : http://wso2.com/blogs/

RE: Exceptions are killing me

Posted by Jarmo Doc <ja...@hotmail.com>.
Apologies, I attached the wrong serialization -- that one was from an 
exception that derived from Exception rather thanAxisFault (I've tried both 
and neither works unless you happening to be talking to an Axis cleint).

Here's the serialization (that's still wrong) derving from AxisFault:

<soapenv:Fault xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <faultcode>soapenv:Server.generalException</faultcode>
   <faultstring/>
   <detail>
    <ns1:fault xmlns:ns1="mypackage">
     <ns2:mytext xmlns:ns2="mypackage">testing exceptions</ns2:mytext>
    </ns1:fault>
    <ns4:exceptionName 
xmlns:ns4="http://xml.apache.org/axis/">mypackage.MyException</ns4:exceptionName>
    <ns5:stackTrace xmlns:ns5="http://xml.apache.org/axis/">
    ... stack trace here ...
    </ns5:stackTrace>
    <ns6:hostname 
xmlns:ns6="http://xml.apache.org/axis/">myhostname</ns6:hostname>
   </detail>
</soapenv:Fault>

Aside from 'exceptionName' which I believe is an old hack to allow Axis 
clients (and only Axis clients) to work out what type the exception is, this 
fault does not indicate the type of the embedded exception.

Should not:

  <ns1:fault xmlns:ns1="mypackage">

instead be something like this:

  <ns1:fault xmlns:ns1="mypackage" type="MyException">

How do I correct this behavior?

>From: "Jarmo Doc" <ja...@hotmail.com>
>Reply-To: axis-user@ws.apache.org
>To: axis-user@ws.apache.org
>Subject: Exceptions are killing me
>Date: Thu, 12 Jan 2006 11:16:15 -0800
>
>My Axis 1.3 server operations throw MyException which is defined something 
>like this (though in reality it's more complex):
>
>public class MyException extends AxisFault implements Serializable
>{
>  private String mytext;
>  public String getMytext() {return mytext;}
>  public void setMytext(String mytext) {this.mytext = mytext;}
>  // the normal wsdl2java generated stuff such
>  // as constructor, getSerializer(), getDeserializer()
>}
>
>I see this serialized on the line as:
>
><soapenv:Fault xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
>   <faultcode>soapenv:Server.userException</faultcode>
>   <faultstring>mypackage.MyException</faultstring>
>   <detail>
>    <faultData>
>     <mytext>testing exceptions</mytext>
>    </faultData>
>    <ns1:stackTrace
>    ... stack trace here ...
>    </ns1:stackTrace>
>    <ns2:hostname 
>xmlns:ns2="http://xml.apache.org/axis/">myhostname</ns2:hostname>
>    </detail>
></soapenv:Fault>
>
>I'm not an expert here, obviously, but I'm pretty sure that this 
>serialization is wrong.  In particular:
>
>1. the fault string is the name of the exception class, which is odd
>2. it refers to <faultData> when I'd expect to see <ns1:MyException> or 
>similar
>3. it should not contain a server-side stack trace
>
>As it stands, a client that attempts to deserialize this has no clue what 
>type the contained exception is and thus fails.
>
>My cubicle wall now has a large hole from me banging my head into it on a 
>regular basis ;-) so could someone please offer a clue as to what could be 
>going wrong.  What could cause Axis to serialize my exception in this way?
>
>Thanks.

_________________________________________________________________
On the road to retirement? Check out MSN Life Events for advice on how to 
get there! http://lifeevents.msn.com/category.aspx?cid=Retirement