Oracle Application Server Integration B2B Callouts Java API Reference
10g Release 2 (10.1.2)

B14417-01
November 2004

oracle.tip.callout
Interface Callout


public interface Callout

Callout interface for creating callouts


Method Summary
 void execute(oracle.tip.callout.CalloutContext calloutContext, java.util.List input, java.util.List output)
          The execute() method contains the actual business logic of a callout.

 

Method Detail

execute

public void execute(oracle.tip.callout.CalloutContext calloutContext,
                    java.util.List input,
                    java.util.List output)
             throws CalloutDomainException,
                    CalloutSystemException
The execute() method contains the actual business logic of a callout.
Parameters:
calloutContext - contains callout and usage properties. The B2B Engine provides a default implementation of this interface and hence the user is not expected to implement this interface.
input - contains the input callout messages for the callout.
output - contains the return callout messages. If one of the return message is a functional acknowledgment, then that callout message should have a message property functional_ack=true
Returns:
void
Throws:
CalloutDomainException - when there are domain exceptions
CalloutSystemException - when there are system exceptions

The following code fragment demonstrates a sample XSLT Callout implementation

  (1) Retrieve the callout properties from CalloutContext
      String xsltFile     = context.getStringProperty("xsltFile");

  (2) Get the input callout message
      CalloutMessage cmIn = (CalloutMessage)input.get(0);
    
  (3) Process the message
      // instantiate a stylesheet
      URL xslURL = new URL("file://" + xsltFile);     
      XSLProcessor processor = new XSLProcessor();
      XSLStylesheet xsl = processor.newXSLStylesheet(xslURL);

      // parser input XML content
      DOMParser parser = new DOMParser();
      parser.setPreserveWhitespace(true);   
      parser.parse(new StringReader(cmIn.getBodyAsString()));
      XMLDocument xml = parser.getDocument();
      processor.showWarnings(true);
      processor.setErrorStream(System.err);

      // Transform the document
      StringWriter strWriter = new  StringWriter();
      processor.processXSL(xsl, xml, new PrintWriter(strWriter));

  (4) Create a output callout message
      // create a callout output message
      CalloutMessage cmOut = 
          new CalloutMessage(strWriter.getBuffer().toString());
      strWriter.close();
      output.add(cmOut);

  (5) Throw an exception, if any
      try {} catch (Exception e) { throw new CalloutDomainException(e)};
 

Oracle Application Server Integration B2B Callouts Java API Reference
10g Release 2 (10.1.2)

B14417-01
November 2004

Copyright © 2004, Oracle. All rights reserved.