Understanding the FTP Binding Component

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 is created to define a web service and is bound to the FTP transportation.

ProcedureTo Create a WSDL Document : ftpTransfer

  1. Expand the BPEL Module project node in the Projects tab.

    For example, SendInventory

  2. Right-click the project node or Process Files node. Select New —> WSDL Document...

    WSDL Document

    This opens the New WSDL Document wizard.

  3. Type the File Name in the File Name field.

    For example, 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. Choose the Binding — FTP from the drop-down list.

  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 message(s) from a dedicated sub-directory (inbox). In this example, the sub-directory is under the remote FTP directory (message repository) and invokes a JBI service with the message(s).

    • Poll Request Message and Put Response: Choose this scenario when the FTP BC polls for request message(s) from a dedicated sub-directory (inbox). In this example, the sub-directory is under the remote FTP directory (messaging repository) and invokes a JBI service. It puts the response(s) back to a dedicated sub-directory (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 sub-directory (outbox). In this example, the sub-directory 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 message(s) to a dedicated sub-directory (inbox). In this example, the sub-directory is under the remote FTP directory (messaging repository). It polls the response(s) back from a dedicated sub-directory (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 message(s) from a remote FTP target (source) and invokes a JBI service with the message(s).

      This option is more customized compared to option "Poll Request Message".

    • Receive Request and Send Response: Choose this scenario when the FTP BC polls (receiving) for a request message(s) from a remote FTP target (source). The FTP target invokes a JBI service and puts (sending) the response(s) back to another remote FTP target (destination).

      This option is more customized compared to option "Poll Request Message and Put Response".

    • 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 compared to option "Poll Request Message".

    • Send Request and Receive Response: Choose this scenario when a JBI service invokes FTP BC to put (sending) request message(s) to a remote FTP target (destination). It polls (received) the response(s) back from another remote FTP target (source).

      This option is more customized compared to option "Put Request Message and Poll Response".

    • On Demand Receive Transfer: Outbound Receiving Transferring.

  7. Select Type — Put Request Message from the drop-down list.

    FTP Transfer Put Request
  8. Click Next.

    This opens New WSDL Document — FTP Configuration wizard.

    FTP Configuration
  9. Click 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.

    This opens New WSDL Dcoument — Poll Request wizard.

  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.

    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.

    FTP Transfer
  14. Click Save All.

ProcedureTo 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.

    This action opens the ftp:message Properties window.


    Note –

    Choose Window —> Properties, if the Properties window is not visible.


  4. Click Message Correlate. Choose the Property — false from the drop-down list.

    ftp_message properties
  5. Click Save All.

Poll Request Wizard Properties

The table describes the various attributes.

Table 2 Poll Request

Attribute Name 

Description 

Message Repository 

The Message Repository path pointing to a 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 

Message Name is 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, will be substituted by a UUID value compliant with Java 1.5 UUID.

  2. sequence number reference %0, %1, %2, %3, %4, %5, %6, %7, %8, %9, this symbol will be replaced by the current value of sequence number which is an integer count that increment after each reference.

    For example, inventory%d.xml

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

Message Name Prefix 

Prefix for outbound (OB) message name. 

Enable Overwrite Protect 

Indicate if overwrite protection is required for message send, when true, existing message will be moved to dedicated directory before the current message is put to the target, otherwise, current message overwrites existing message. The checkbox is selected, by default. 

Enable Staging When Put Message 

Indicate 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 ellipses (...) to select an Element or Type.

  3. encoded data: Encoded Data

    Click ellipses (...) to select an Element or Type.

The table describes the various message repository directories.

Table 3 Message Repository Directories

Directory 

Description 

/inbox 

This is the default location where the consumer puts the request message and the provider polls for a request message. 

/instage 

This is the default location where the consumer stages a request message before it is completely uploaded. 

/inprotect 

This is the default location where consumer moves an existing request message so that it is not overwritten by current request message. 

/inarchive 

This is the default location where provider archives request message after it is processed. 

/outbox 

This is the default location where the provider puts a response message and the consumer polls for the response message. 

/outstage 

This is the default location where the provider stages the response message before it is completely uploaded. 

/outprotect 

This is the default location where provider moves an existing response message to so that it is not overwritten by current response message. 

/outarchive 

This is the default location where consumer archives response message after it is processed. 

The table describes the various Java Timestamp Patterns.

Table 4 Java Timestamp Patterns

Letter 

Data or Time Component 

Presentation 

Examples 

G  

Era designator 

Text 

AD 

Year 

Year 

1996; 96 

Month in year 

Month 

July; Jul; 07 

Week in year 

Number 

27 

Week in month 

Number 

Day in year 

Number 

189 

Day in month 

Number 

10 

Day of week in month 

Number 

Day in week 

Text 

Tuesday; Tue 

Am/pm marker 

Text 

PM 

Hour in day (0-23) 

Number 

Hour in day (1-24) 

Number 

24 

Hour in am/pm (0-11) 

Number 

Hour in am/pm (1-12) 

Number 

12 

Minute in hour 

Number 

30 

Second in minute 

Number 

55 

Millisecond 

Number 

978 

Time zone 

General time zone 

Pacific Standard Time; PST; GMT-08:00  

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 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