2 Replies Latest reply on May 14, 2004 3:20 AM by schachi

    SoapException - InnerException is zero

    schachi

      My webservice runs under jboss-net, the client is vb.net.

      If the webservice throws an exception, the client shows a SoapException:
      System.Web.Services.Protocols.SoapException: ch.e_act.common.util.EActException: Test
      at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
      at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
      at WindowsApplication1.WebReference1.VerwPartnerBeanService.storePartner(Int32 beratungID, String schluessel, String partner)
      at WindowsApplication1.Partner.speichern()

      The original error message (ch.e_act.common.util.EActException:Test) was packed into the stacktrace. The InnerException of the
      SoapException is zero !

      Can anyone tell me where the SoapException is created (axis ?) and how can I forward the original error message to the client?

      kind regards

        • 1. Re: SoapException - InnerException is zero
          jvogele

          Hello,

          if your server is throwing an exception, the exceptions is packed into a soap-fault like this:

           <soapenv:Body>
           <soapenv:Fault>
           <faultcode xmlns:ns1="http://xml.apache.org/axis/">ns1:Server.userException</faultcode>
           <faultstring>Exception.toString()-Methode called here</faultstring>
           <detail> ...
           </detail>
           </soapenv:Fault>
           </soapenv:Body>
          </soapenv:Envelope>
          


          so i guess your SOAPException is created by vb.net ... to see the original errormessage you could overwrite the toString() in your Java-Exception.

          regards,
          jv

          • 2. Re: SoapException - InnerException is zero
            schachi

            now, it works:

            Server:

             try {
             ...
             } catch (EActException ex) {
             Element ele[] = new Element[1];
             String xml = "<fault>"
             + "<category>" + ex.getCategory() + "</category>"
             + "<code>" + new Integer(ex.getErrorCode()).toString() + "</code>"
             + "</fault>";
             ele[0] = XMLKit.createDocumentFromString(xml).getDocumentElement();
            
             throw new AxisFault(new QName( "",""), //?
             ex.getMessage(),
             "info on the actor", //?
             ele);
             }
            

            Client:
            Try
             Dim omath As New WebReference1.VerwPartnerBeanService
             omath.storePartner(beratungid, schluessel, xml)
            
             Catch ex As System.Web.Services.Protocols.SoapException
             Console.WriteLine("message:>" & ex.Message)
             Console.WriteLine("detail:>" & ex.Detail.InnerXml)
             ...
             End try
            


            Output Client:
            message:> test
            detail:>
             <fault>
             <category>S</category>
             <code>900</code>
             </fault>