JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Oracle Java CAPS FTP Binding Component Tutorial     Java CAPS Documentation
search filter icon
search icon

Document Information

Understanding the FTP Binding Component

Tutorial Overview

Tutorial Requirement

Software Needed for the Tutorial

Tutorial Plan

FTP Binding Component Project in a Nutshell

Starting the GlassFish Application Server

To Start the GlassFish Application Server

Working With JBI Runtime Environment

To Start JBI Components

FTP Binding Component Runtime Configuration Properties

Creating a BPEL Module Project : SendInventory

To Create a BPEL Module Project

Creating a WSDL Document : Using FTP

To Create a WSDL Document : ftpTransfer

To Modify ftp:message Properties

Poll Request Wizard Properties

FTP MessageActivePassive Element (<ftp:messageActivePassive>)

FTP Binding Component Extensibility Elements

Runtime Configuration

FTP Operation Element (<ftp:operation>)

FTP Binding Element (<ftp:binding>)

FTP Transfer Element (<ftp:transfer>)

Pattern Matching

FTP Address Element (<ftp:address>)

FTP Message Element (<ftp:message>)

Creating a WSDL Document : Using FILE

To Create a WSDL Document : fileTrigger

Creating a BPEL Process

To Create a BPEL Process

To Add a Partner Link

To Add Web Services and Basic Activities

To Edit Web Service : Receive1

To Edit the Web Service : Invoke1

To Edit the Basic Activities : Assign1

Validating BPEL

To Invoke Explicit Validation

Design View : Notifications

The Design View

Creating a Composite Application

To Create a Composite Application

Deploying the Composite Application

To Deploy the Composite Application

Working With Various Binding Types

Exploring the XML Schema

About the Schema View

Creating the XML Schema

To Create XML Schema

To Add a Complex and a Global Complex Type to the XML Schema

To Add Element to the XML Schema

To Add Elements to the XML Schema

Creating a WSDL Document : Using FTP

In this section, you will add a WSDL Document. In this example, you will add ftpTransfer.wsdl to the BPEL Module. Use the Partner view of the WSDL editor to configure the components of the WSDL document. A WSDL document defines a web service and is bound to the FTP transportation.

To Create a WSDL Document : ftpTransfer

  1. Expand the SendInventory BPEL Module project node in the Projects tab.
  2. Right-click the project node or Process Files node. Point to New and click WSDL Document.
    image:WSDL Document

    The New WSDL Document wizard appears.

  3. In the File Name field, enter ftpTransfer.wsdl.
  4. Select Concrete WSDL Document.

    Note - When creating or editing a WSDL file, you may be prompted to select a binding type and a binding subtype. A binding contains protocol and data format information for the operations and messages of a port type. If you select the FTP binding type, then you must select one of the following binding subtypes. Both subtypes provide basic FTP functionality, such as a directory from which to read or write files, filename pattern matching, and message correlation.

    • FTP Message. Select this binding subtype if you plan to rely on default values.

    • FTP Transport. Select this binding subtype if you want to add customization such as specifying custom directories on the FTP server and specifying pre-transfer and post-transfer operations.


  5. In the Binding field, select FTP.
  6. Choose any one of the following Types from the drop-down list.
    • Poll Request Message: Choose this scenario when the FTP BC polls for request messages from a dedicated subdirectory (inbox). In this example, the subdirectory is under the remote FTP directory (message repository) and invokes a JBI service with the message.

    • Poll Request Message and Put Response: Choose this scenario when the FTP BC polls for request messages from a dedicated subdirectory (inbox). In this example, the subdirectory is under the remote FTP directory (messaging repository) and invokes a JBI service. It puts the responses back to a dedicated subdirectory (outbox) under a remote FTP directory (messaging repository).

    • Put Request Message: Choose this scenario when a JBI service invokes FTP BC to put a request message to a dedicated subdirectory (outbox). In this example, the subdirectory is under the remote FTP directory (messaging repository).

    • Put Request Message and Poll Response: Choose this scenario when a JBI service invokes FTP BC to put request messages to a dedicated subdirectory (inbox). In this example, the subdirectory is under the remote FTP directory (messaging repository). It polls the responses back from a dedicated subdirectory (outbox) under a remote FTP directory (messaging repository).

    • On Demand Get Message: Outbound Get Messaging.

    • Receive Request: Choose this scenario when the FTP BC polls (receiving) for request messages from a remote FTP target (source) and invokes a JBI service with the messages. This option is more customized than the Poll Request Message option.

    • Receive Request and Send Response: Choose this scenario when the FTP BC polls (receiving) for a request messages from a remote FTP target (source). The FTP target invokes a JBI service and puts (sending) the responses back to another remote FTP target (destination). This option is more customized than the Poll Request Message and Put Response option.

    • Send Request: Choose this scenario when a JBI service invokes FTP BC to put (sending) a message to a remote FTP target (destination). This option is more customized than the Poll Request Message option.

    • Send Request and Receive Response: Choose this scenario when a JBI service invokes FTP BC to put (sending) request messages to a remote FTP target (destination). It polls (receives) the responses back from another remote FTP target (source). This option is more customized than the Put Request Message and Poll Response option.

    • On Demand Receive Transfer: Outbound Receiving Transferring.

  7. Select Type — Put Request Message from the drop-down list.
    image:FTP Transfer Put Request
  8. Click Next.

    The New WSDL Document — FTP Configuration wizard appears.


    image:FTP Configuration
  9. Click the FTP Connection tab.
  10. Enter the following:
    1. Host Name: localhost
    2. Host Port: 21
    3. User Id: anonymous
    4. Password: Enter Password
    5. Directory List Style: UNIX
    6. Transfer Mode: BINARY
    7. Message Repository: Enter text in the Message Repository text area. This is optional.

      Note - The option Correlate Request Response is selected by default.


  11. Click Next.

    The New WSDL Document — Poll Request wizard appears.

  12. Enter the following fields:
    • Message Repository: book_updates

    • Message Name: inventory%d.xml

    • Message Name Prefix: This is optional.

    • Enable Overwrite Protect: This option is selected, by default.

    • Enable Staging When Put Message: This option is selected, by default.

    • Payload Processing: The radio button xml is selected by default.


    image:Poll Request
  13. Click Finish.

    This action opens the Project tree structure. In the current example, this action displays the WSDL editor for ftpTransfer along with its properties.


    image:FTP Transfer
  14. Click Save All.

To Modify ftp:message Properties

  1. Double-click ftpTransfer.wsdl.

    This action opens the WSDL Editor.

  2. Expand Bindings —> OutboundOneWayMessagingBinding —> OutboundOneWayMessagingOperation —> input1 —> ftp:message.
  3. Double-click ftp:message.

    The ftp:message Properties window appears.


    Note - Click Window —> Properties if the Properties window is not visible.


  4. Click Message Correlate. Choose the Property — false from the drop-down list.
    image:ftp_message properties
  5. Click Save All.

Poll Request Wizard Properties

The table describes the various FTP Poll Request attributes.

Table 2 Poll Request

Attribute Name
Description
Message Repository
The directory on the remote FTP server where messages will be processed and archived. For more information, see Table 3.

For example, book_updates

Message Name
The filename where a message is put into, usually in the form of a name pattern. Pattern is a string containing special characters preceded by a percentage sign. For more information, see Table 4.
  1. UUID %u is substituted by a UUID value compliant with Java 1.5 UUID.

  2. In sequence number references, such as %0, %1, %2, %3, %4, %5, %6, %7, %8, %9, the symbol is replaced by the current value of that sequence number, which is an integer count that increments after each reference.

    For example, inventory%d.xml

    %d — This symbol is an integer count that increments after each reference.

Message Name Prefix
The prefix for the outbound (OB) message name.
Enable Overwrite Protect
Indicates if overwrite protection is required for message send. When this is sent to true, existing messages are moved to a dedicated directory before the current message is put to the target; otherwise, the current message overwrites the existing message. The checkbox is selected by default.
Enable Staging When Put Message
Indicates if staging is enabled for message transfer. The check box is selected by default.
Payload Processing
  1. text: Text Data

    This radio button is selected by default.

  2. xml: XML Data

    Click the ellipsis to select an Element or Type.

  3. encoded data: Encoded Data

    Click the ellipsis to select an Element or Type.

The following table describes the various FTP message repository directories.

Table 3 Message Repository Directories

Directory
Description
/inbox
The default location where the consumer puts the request message and the provider polls for a request message.
/instage
The default location where the consumer stages a request message before it is completely uploaded.
/inprotect
The default location where consumer moves an existing request message so that it is not overwritten by current request message.
/inarchive
The default location where provider archives request message after it is processed.
/outbox
The default location where the provider puts a response message and the consumer polls for the response message.
/outstage
The default location where the provider stages the response message before it is completely uploaded.
/outprotect
The default location where provider moves an existing response message to so that it is not overwritten by current response message.
/outarchive
The default location where consumer archives response message after it is processed.

The following table describes the various Java Timestamp Patterns.

Table 4 Java Timestamp Patterns

Letter
Data or Time Component
Presentation
Examples
G
Era designator
Text
AD
y
Year
Year
1996; 96
M
Month in year
Month
July; Jul; 07
w
Week in year
Number
27
W
Week in month
Number
2
D
Day in year
Number
189
d
Day in month
Number
10
F
Day of week in month
Number
2
E
Day in week
Text
Tuesday; Tue
a
Am/pm marker
Text
PM
H
Hour in day (0-23)
Number
0
k
Hour in day (1-24)
Number
24
K
Hour in am/pm (0-11)
Number
0
h
Hour in am/pm (1-12)
Number
12
m
Minute in hour
Number
30
s
Second in minute
Number
55
S
Millisecond
Number
978
z
Time zone
General time zone
Pacific Standard Time; PST; GMT-08:00
Z
Time zone
RFC 822 time zone
-0800

FTP MessageActivePassive Element (<ftp:messageActivePassive>)

The FTP Message Active/Passive element for the WSDL binding element functions the same as the FTP message element, but contains flags that allow you to set passive FTP messaging for both the consumer and the provider. The following table lists the properties that enable passive FTP messaging for the FTP Message Active/Passive element.

Table 5 FTP MessageActivePassive Element

Attribute Name
Description
consumerUsePassive
Specifies whether to use passive FTP on the consumer side.

Default value: true

providerUsePassive
Specifies whether to use passive FTP on the provider side.

Default value: true