Uploaded image for project: 'ODE'
  1. ODE
  2. ODE-194

Ode cannot handle own defined wsdl faults

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 1.1
    • 1.1.1
    • Axis2 Integration
    • None
    • Windows XP SP2
      Tomcat 5.5.23
      Ode 1.1

    Description

      Ok, I have made further analysis. I tested the service with a generated axis2-client and I see that I am getting back the fault correctly, i.e. I can access the self-defined faultcode, faultActor and so on.

      My wsdl definition for this wsdl fault contains following:

      <xsd:element name="faultCode" type="xsd:string">
      <xsd:annotation>
      <xsd:documentation>
      faultCode consists of a five letter identifier plus a
      three digit id (serial number). For example, "GENEX001"
      is a generic error and "AUTEX001" is a authenification
      error
      </xsd:documentation>
      </xsd:annotation>
      </xsd:element>
      <xsd:element name="faultString" type="xsd:string">
      <xsd:annotation>
      <xsd:documentation>
      corresponding description of the faultCode
      </xsd:documentation>
      </xsd:annotation>
      </xsd:element>
      <xsd:element name="faultActor" type="xsd:string">
      <xsd:annotation>
      <xsd:documentation>
      element displays url of the webservice where the
      exception occured
      </xsd:documentation>
      </xsd:annotation>
      </xsd:element>
      <xsd:element name="faultDetail" type="xsd:string">
      <xsd:annotation>
      <xsd:documentation>
      element pictures the actual exception message and
      complete stack trace.
      </xsd:documentation>
      </xsd:annotation>
      </xsd:element>

      <xsd:element name="LogFault">
      <xsd:annotation>
      <xsd:documentation>
      fault element for handling errors during the logservice
      </xsd:documentation>
      </xsd:annotation>
      <xsd:complexType>
      <xsd:sequence>
      <xsd:element ref="types:faultCode"/>
      <xsd:element ref="types:faultString"/>
      <xsd:element ref="types:faultActor"/>
      <xsd:element ref="types:faultDetail"/>
      </xsd:sequence>
      </xsd:complexType>
      </xsd:element>

      I send a response and I am getting back following response:

      <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
      <soapenv:Body>
      <soapenv:Fault>
      <faultcode>soapenv:Server</faultcode>
      <faultstring>LogFaultException</faultstring>
      <detail>
      <ns2:LogFault xmlns:ns2="http://cis.log.interface.de.ibm.com/types">
      <s547:faultCode xmlns:s547="http://cis.de.ibm.com/simpleTypes">LOGEX002</s547:faultCode>
      <s548:faultString xmlns:s548="http://cis.de.ibm.com/simpleTypes">Database for LogService not available.</s548:faultString>
      <s549:faultActor xmlns:s549="http://cis.de.ibm.com/simpleTypes">logRun</s549:faultActor>
      <s550:faultDetail xmlns:s550="http://cis.de.ibm.com/simpleTypes">no stacktrace.</s550:faultDetail>
      </ns2:LogFault>
      </detail>
      </soapenv:Fault>
      </soapenv:Body>
      </soapenv:Envelope>

      I have tested it with an autogenerated axis-client and a junit-testmethod. If the logfaultexception is thrown by the service, I can output the faultActor, faultString, detail and code in the catch-block.

      /**

      • Auto generated test method
        */
        public void testlogRun() {

      LogRunResponseVO logRun = null;
      try

      { com.ibm.de.cis.log.client.CisLogServiceStub stub = new com.ibm.de.cis.log.client.CisLogServiceStub( endpoint); com.ibm.de.cis.log.client.CisLogServiceStub.LogRunRequestVO logRunRequestVO18 = (com.ibm.de.cis.log.client.CisLogServiceStub.LogRunRequestVO) getTestObject(com.ibm.de.cis.log.client.CisLogServiceStub.LogRunRequestVO.class); logRunRequestVO18.setEmptyparam( logRun = stub.logRun(logRunRequestVO18); }

      catch (AxisFault e)

      { e.printStackTrace(); } catch (RemoteException e) { e.printStackTrace(); }

      catch (LogFaultException e)

      { LogFault fault = e.getFaultMessage(); System.out.println("Actor: " + fault.getFaultActor()); System.out.println("Code:" + fault.getFaultCode()); System.out.println("Detail:" + fault.getFaultDetail()); System.out.println("FaultString:" + fault.getFaultString()); e.printStackTrace(); }

      catch (Exception e)

      { e.printStackTrace(); }

      System.out.println(logRun.getRunId());

      }

      Question is why Ode cannot access these information? Following stacktrace is available in Ode.

      <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Header><addr:To xmlns:addr="http://www.w3.org/2005/08/addressing">http://localhost:8180/cisLogWeb/services/cisLogService</addr:To><addr:Action xmlns:addr="http://www.w3.org/2005/08/addressing">http://cis.log.interface.de.ibm.com/service/logRun</addr:Action><addr:ReplyTo xmlns:addr="http://www.w3.org/2005/08/addressing"><addr:Address>http://www.w3.org/2005/08/addressing/anonymous</addr:Address></addr:ReplyTo><addr:MessageID xmlns:addr="http://www.w3.org/2005/08/addressing">uuid:hqejbhcnphr2n1qwgjen65</addr:MessageID></soapenv:Header><soapenv:Body><axis2ns2:LogRunRequestVO xmlns:axis2ns2="http://cis.log.interface.de.ibm.com/types" xmlns:types="http://cis.log.interface.de.ibm.com/types">
      <xsd:emptyparam xmlns:xsd="http://cis.de.ibm.com/simpleTypes">true</xsd:emptyparam>
      </axis2ns2:LogRunRequestVO></soapenv:Body></soapenv:Envelope>
      10:48:58,462 DEBUG [SessionOutHandler] <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Header><addr:To xmlns:addr="http://www.w3.org/2005/08/addressing">http://localhost:8180/cisLogWeb/services/cisLogService</addr:To><addr:Action xmlns:addr="http://www.w3.org/2005/08/addressing">http://cis.log.interface.de.ibm.com/service/logRun</addr:Action><addr:ReplyTo xmlns:addr="http://www.w3.org/2005/08/addressing"><addr:Address>http://www.w3.org/2005/08/addressing/anonymous</addr:Address></addr:ReplyTo><addr:MessageID xmlns:addr="http://www.w3.org/2005/08/addressing">uuid:hqejbhcnphr2n1qwgjen65</addr:MessageID></soapenv:Header><soapenv:Body><axis2ns2:LogRunRequestVO xmlns:axis2ns2="http://cis.log.interface.de.ibm.com/types" xmlns:types="http://cis.log.interface.de.ibm.com/types">
      <xsd:emptyparam xmlns:xsd="http://cis.de.ibm.com/simpleTypes">true</xsd:emptyparam>
      </axis2ns2:LogRunRequestVO></soapenv:Body></soapenv:Envelope>
      DEBUG - GeronimoLog.debug(66) | Found a header in incoming message, checking if there are endpoints there.
      10:48:59,503 DEBUG [SessionInHandler] Found a header in incoming message, checking if there are endpoints there.
      ERROR - GeronimoLog.error(108) | Error sending message (mex={PartnerRoleMex#hqejbhcnphr2n1qwgjen64 [PID

      {http://com.ibm.de.cis/archive}

      cisArchive-40] calling org.apache.ode.bpel.epr.URLEndpoint@c88805.logRun(...)}): LogFaultException
      org.apache.axis2.AxisFault: LogFaultException
      at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:486)
      at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:343)
      at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:389)
      at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:211)
      at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
      at org.apache.ode.axis2.ExternalService$1$1.call(ExternalService.java:148)
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
      at java.util.concurrent.FutureTask.run(FutureTask.java:123)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
      at java.lang.Thread.run(Thread.java:595)
      10:48:59,513 ERROR [ExternalService] Error sending message (mex={PartnerRoleMex#hqejbhcnphr2n1qwgjen64 [PID

      {http://com.ibm.de.cis/archive}

      cisArchive-40] calling org.apache.ode.bpel.epr.URLEndpoint@c88805.logRun(...)}): LogFaultException
      org.apache.axis2.AxisFault: LogFaultException
      at org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:486)
      at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:343)
      at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:389)
      at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:211)
      at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
      at org.apache.ode.axis2.ExternalService$1$1.call(ExternalService.java:148)
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
      at java.util.concurrent.FutureTask.run(FutureTask.java:123)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
      at java.lang.Thread.run(Thread.java:595)
      DEBUG - GeronimoLog.trace(54) | Mex[hqejbhcnphr2n1qwgjen64].setPortOp(...)
      10:48:59,663 DEBUG [MessageExchangeImpl] Mex[hqejbhcnphr2n1qwgjen64].setPortOp(...)

      For more details are avialable, see http://www.nabble.com/Error-handling-in-bpel-processes-tf4555881.html

      Attachments

        1. cisTest2.zip
          7 kB
          Jens Goldhammer

        Activity

          People

            mriou Matthieu Riou
            jollero Jens Goldhammer
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: