6 Replies Latest reply: Aug 23, 2012 6:30 PM by user5108636 RSS

    Java API document for SOA developer

      Hi All,
      I have a SOA composite application. I need to notify any process failures via email to the support group. I am able to send a mediator instance failure via email. The challenge is to provide a meaningful content, so that it helps the support group. My current content is as below


      Dear Administrator,

      An ORTD Process instance has faulted.
      Fault policy id: ORTDFaultPolicy
      Fault type: mediator
      Partnerlink: ODS_COMMENTS
      Port type: null
      Fault: FaultImpl:{
      bindingType = null
      componentInstanceId = mediator:2F0F4840ECD711E19F748DF93DD101B7
      componentName = HandleRealTimeRequests
      compositeDN = default/RealTimeService!3.0 compositeInstanceId = 60001 creationDate = 2012-08-23 14:01:19.231 ECID = 3212bd6148b741d8:1d074ac2:139519b67d0:-8000-0000000000000369
      engineType = mediator
      id = 2F3F0AD0ECD711E19F748DF93DD101B7
      *message = {faultMessage=oracle.xml.parser.v2.XMLElement@211dc32e, mediatorErrorCode=oracle.xml.parser.v2.XMLElement@211dc915, faultCode=oracle.xml.parser.v2.XMLElement@211deac7}*
      name = {http://schemas.oracle.com/mediator/faults}mediatorFault
      recoverable = false
      referenceName = null
      serviceName = null
      type = 0}

      As highlighted in bold above, how do I parse the Java object received by calling

      MediatorRecoveryContext ctx = (MediatorRecoveryContext)iFaultRecoveryContext;
      msg.append("Fault: " + ctx.getFault().getMessage()); // This returns a Java object which might hold the key error content. How do I parse it to display to the support group.

        • 1. Re: Java API document for SOA developer
          This may help...
          • 2. Re: Java API document for SOA developer
            Does not help. I am posting my code which generate the email content.

            StringBuffer msg = new StringBuffer("Dear Administrator, \n\n");
            msg.append("An ORTD Process instance has faulted. \n");
            msg.append("Fault policy id: " + iFaultRecoveryContext.getPolicyId() +
            msg.append("Fault type: " + iFaultRecoveryContext.getType()+"\n");
            msg.append("Partnerlink: " + iFaultRecoveryContext.getReferenceName()+"\n");
            msg.append("Port type: " + iFaultRecoveryContext.getPortType() + "\n");

            Map props = iFaultRecoveryContext.getProperties();
            Properties properties = new Properties();
            String mailTo = getProperty("emailToAddress", props);
            String from = getProperty("emailFromAddress", props);
            properties.put("mail.smtp.host", getProperty("emailServer", props));
            properties.put("mail.smtp.port", getProperty("emailPort", props));
            properties.put("mail.smtp.auth", "true");

            String title = null;

            if (iFaultRecoveryContext instanceof MediatorRecoveryContext) {
            MediatorRecoveryContext ctx =
            msg.append("Fault: " + ctx.getFault().getMessage() + "\n");
            msg.append("Instance Title: " + ctx.getType() + "\n");
            msg.append("Mediator Message: " + ctx.getMediatorMessage()+ "\n");


            Please suggest
            • 3. Re: Java API document for SOA developer
              All Oracle SOA Suite APIs (B2B, BPEL, Rules, OSB, infrastructure, UMS, etc.) javadocs are available in the Oracle SOA Suite API References section in the document library.

              The link is...

              Hope this helps...

              • 4. Re: Java API document for SOA developer
                It does not have mediator specific fault handling java api.

                • 5. Re: Java API document for SOA developer
                  Anuj Dwivedi
                  Can you try this -

                  if (iFaultRecoveryContext instanceof MediatorRecoveryContext) {
                  MediatorRecoveryContext ctx =
                  Map mp = (Map)(ctx.getFault().getMessage());
                  String faultMessage= convertXMLElemToString(mp.get("faultMessage"));
                  String mediatorErrorCode = convertXMLElemToString(mp.get("mediatorErrorCode"));
                  String faultCode = convertXMLElemToString(mp.get("faultCode"));

                  Have not tested it but it should work.

                  • 6. Re: Java API document for SOA developer
                    Hi Anuj,

                    Which object is this method convertXMLElemToString part of.