Samba

In this section:

Samba is an implementation of dozens of services and a dozen protocols, including NetBIOS over TCP/IP (NBT), SMB, CIFS (an enhanced version of SMB), DCE/RPC or more specifically, MSRPC, the Network Neighborhood suite of protocols, a WINS server also known as a NetBIOS Name Server (NBNS), the NT Domain suite of protocols which includes NT Domain Logons, Secure Accounts Manager (SAM) database, Local Security Authority (LSA) service, NT-style printing service (SPOOLSS), NTLM and more recently Active Directory Logon which involves a modified version of Kerberos and a modified version of LDAP. All these services and protocols are frequently incorrectly referred to as just NetBIOS or SMB. Samba can see and share printers.

Samba configures network shares for chosen UNIX directories (including all contained subdirectories). These appear to Microsoft Windows users as normal Windows folders accessible through the network. UNIX users can either mount the shares directly as part of their file structure or, alternatively, can use a utility, smbclient (libsmb) installed with Samba to read the shares with a similar interface to a standard command line FTP program. Each directory can have different access privileges overlaid on top of the normal UNIX file protections. For example: home directories would have read/write access for all known users, allowing each to access their own files. However, they would still not have access to the files of others unless that permission would normally exist. Note that the netlogon share, typically distributed as a read only share from /etc/samba/netlogon, is the logon directory for user logon scripts.

Samba Listener

The Samba listener uses Samba protocol components to poll the specified mapped network drive folder.

The open source jcifs-1.2.24 release is used to access the mapped network drives. The Samba listener behaves similar to an iWay File listener. The main difference is that the Samba listener reads messages from a mapped network drive instead of a local file system. The Samba listener accepts a UNC path as input and allows the user to specify a user ID, password, and domain information as required.

Samba Emitter

The Samba emitter emits messages to a mapped Windows drive using the Samba protocol.

The open source jcifs-1.2.24 release is used to access the mapped network drives. The Samba emitter behaves similar to an iWay File emitter. The main difference is that the Samba emitter emits messages to a mapped network drive instead of a local file system. The Samba emitter accepts a UNC path as input and allows the user to specify a user ID, password, and domain information as required.


Top of page

x
Installing the Samba Protocol Adapter

To install Samba, you must add the Samba protocol adapter to your iWay Service Manager instance during the iWay Service Manager installation. For more information on installing iWay Service Manager, see the iWay Installation and Configuration Guide.

However, if you have already installed iWay Service Manager, you can also add the Samba protocol adapter by modifying the existing iWay Service Manager installation.

This section describes how to add the Samba protocol adapter by modifying an existing iWay Service Manager installation.



x
Procedure: How to Add the Samba Protocol Adapter

To add the Samba protocol adapter:

  1. Open the Windows Control Panel and double-click Add or Remove Programs.

    The Add or Remove Programs dialog box opens.

  2. Select iWay Service Manager and click the Change/Remove button.

    The Already Installed dialog box opens.

  3. Select Add/Reinstall components and click Next.

    The iWay Service Manager Select Features dialog box opens.

  4. Expand the Protocol Adapters group, select the check box for SMB/CIFS (SAMBA), and click Next.
  5. Click Finish.
  6. Stop and restart iWay Service Manager.

    Note: You must perform a hard restart. Using the Restart function in the iWay Service Manager Administration Console is not sufficient.


Top of page

x
Configuring the Samba Listener

The following section describes how to configure the Samba listener.



x
Procedure: How to Add a Samba Listener

To add a Samba listener:

  1. In the left console pane of the registry menu, select Listeners, as shown in the following image.

    The listener pane opens, as shown in the following image.

    The table provided lists any existing listeners and short descriptions of each.

  2. Click Add.
  3. Select Samba from the list, and then click Next.

  4. Provide the required configuration parameters for the new listener, which are described in Samba Listener Configuration Parameters.

  5. Click Next.

    The Name and Description pane opens.

  6. Enter a name and an optional description for the listener and click Finish.

    The listener is added to the list in the listeners pane, as shown in the following image.

    After a listener is added to iWay Service Manger, you can assign a listener to an inlet that is used to construct a channel.



x
Reference: Samba Listener Configuration Parameters

Parameter

Description

InputPath

The UNC directory path where input messages are received. For example:

//server/share/dir/

Note: Do not use a file suffix.

Input Domain

A DNS name (or IP address) of the server that you want to connect to.

Port

The TCP open port for receipt of server requests.

UserId

A valid user ID on the server.

Password

A valid password on the server.

Suffix

Limits the input files to those with these extensions. For example, xml.

Sort Order

The sort files based on the file names by date/name with ascending/descending order.

Scan sub directories

If set to true, all subdirectories will be scanned for files.

Destination

The UNC directory path where output messages are placed. For example:

//server/share/dir/.*

Note: The asterisk character (*) is replaced with a time stamp.

Output Domain

The DNS name (or IP address) of the server to which you want to connect.

Port

The TCP open port for receipt of server requests.

UserId

A valid user ID on the server.

Password

A valid password on the server.

Accepts non-XML (flat) only

If set to true, the listener expects flat (non-XML). Preparsers do not run.

Optimize Favoring

Select one of the following options:

  • performance (default)
  • memory

Note: Selecting memory is useful if you are using large input documents.

Multithreading

The number of documents that can be processed in parallel. The default value is 1.

Maximum threads

Parallel threads can grow to this count automatically on demand. The default value is 1.

Execution Time Limit

The time limit for document execution (in seconds) before it is terminated.

Polling Interval

The interval at which to check for new input. The default value is 2.0.

Default Java File Encoding

The default encoding if an incoming message is not self-declaring, for example XML. The default value is Cp1252.

Agent Precedence

The changes the order by which the engine selects agents. This is used to manage iWay documents. The default value is 1 - <document> overrides <listener>.

Always reply to listener default

If set to true, the default reply definition is used in addition to the defined replies.

Error Documents treated normally

If set to true, error documents are processed by any configured preemitters.

Listener is Transaction Manager

If set to true, agents run within a local transaction managed by the listener.

Initialization Agent

The name (parms) of the processing module called at listener startup.

Record in Activity Log(s)

If set to true, activity on this channel is recorded in the activity logs. If set to false, the activity is not recorded.



x
Procedure: How to Add a Samba Emitter

To add a Samba emitter:

  1. In the left console pane of the Registry menu, select Emitters, as shown in the following image.

  2. Click Add.

    The Emitters type pane opens, as shown in the following image.

  3. Select Samba from the list of protocols and click Next.

    The configuration parameters pane for the Samba emitter opens.

  4. Provide the required parameters for the Samba emitter, which are described in Samba Emitter Configuration Parameters.
  5. Click Next.

    The Name and Description pane opens.

  6. Provide a name and an optional description for the Samba emitter and click Finish.

    The Samba emitter is added to the list in the emitter pane, as shown in the following image.

    After an emitter is added to iWay Service Manger, you can assign an emitter to an outlet that is used to construct a channel.



x
Reference: Samba Emitter Configuration Parameters

Parameter

Description

Destination

The UNC directory path where output messages are placed. For example:

//server/share/dir/.*

Note: The asterisk character (*) is replaced with a time stamp.

Domain

The DNS name (or IP address) of the server to which you want to connect.

Port

The TCP open port for receipt of server requests.

UserId

A valid user ID on the server.

Password

A valid password on the server.



x
Configuring Process Flows Using the Samba Agent

This section describes how to configure process flows using the Samba agent in iWay Designer.



x
Procedure: How to Create an iWay Designer Project and Start the Process Flow
  1. From the Windows Start menu select Programs, iWay 6.1 Service Manager, tools, and then iWay Designer.
  2. Connect to the repository from which you want to work, for example, iWay.
  3. Right-click the repository node and select New Project from the drop-down list.

    The Designer Project Information dialog box opens.

  4. In the Name field, type SambaAgent as the project name.
  5. Click Next.

    The Designer Project Bindings dialog box opens.

  6. To create the project in the iWay Registry, select iWay Registry and click Finish.

    The choice of project association depends on where you intend to publish (deploy) your process flow. If you are developing a process flow for use as part of a channel, you must publish it to the Registry for subsequent deployment.

    The SambaAgent project node appears under the repository in which it was created (in this example, it appears under iWay).

  7. To save the project to the repository, right-click the project node and select Save from the drop-down list.
  8. Expand the SambaAgent project node to expose the project elements (Processes, Services, Transforms, and so on).
  9. Right-click the Processes folder and select New Process from the drop-down list.

    The iWay Process Configuration dialog box opens.

  10. In the Name field, type SambaPflow as the process flow name.
  11. Click Finish.

    The new SambaPflow node appears under the Processes folder, and the workspace displays a Start object.

You are ready to build the SambaPflow by adding objects to it and specifying their relationships.



x
Procedure: How to Add a Samba Agent Service Object

To add a Samba agent Service object:

  1. Drag and drop the Service object icon from the toolbar to the workspace.

    The Service Name and Description dialog box opens.

  2. In the Name field, type a new name for this Service object, and leave the default value (Service object) in the Description field.
  3. Click Next.

    The Service Type dialog box opens.

  4. Select Class Name and enter one of the following class names (depending on which Samba agent you want to use).
  5. Click Next.

    The Define Service dialog box opens.

  6. Select the Define Service Globally check box.
  7. Click Finish.

    The new Service object appears in the workspace.

    Now you need to connect the Start object to the Service object.

  8. Select the Start object, right-click the Service object, and select Build Relation from the context menu.

    The Line Configuration dialog box opens.

  9. From the Event drop-down list, select OnCompletion and click OK.

    This option indicates that there are no conditions that affect the path, and that the path between the two objects will always be followed.

    A line appears between the objects to indicate that a relationship has been established.



x
Procedure: How to Add an End Object for the Samba Agent Service Object

All processing paths must terminate with an End object.

  1. Drag and drop the End object icon from the toolbar to the workspace.

    The End Name and Description dialog box opens.

  2. In the Name field, type a new name for this End object, and leave the default value (End object) in the Description field.
  3. Click Next.

    The End Name Schema dialog box opens.

  4. Since no schemas are used in this processing path (that is, the process flow will not be exposed as a web service), from the Schema drop-down list, select None.
  5. Click Next.

    The Properties dialog box opens.

  6. Click Finish to accept the default values and close the dialog box.

    The new End object appears in the workspace.

  7. Select the Service object, right-click the End object, and select Build Relation from the context menu.

    The Line Configuration dialog box opens.

  8. From the Event drop-down list, select OnSuccess and click OK.

    This option indicates that the path will be followed if there is a normal completion.

    You can reposition the objects as desired.

  9. To save the process flow, right-click the SambaPflow node and select Save from the drop-down list.

    Now you need to validate the process flow and publish it to the Registry of the iWay Service Manager Administration Console for use in the route in the channel for inbound processing.

    Validating a process flow ensures that its structure is correct. Publishing a process flow makes it available in the Registry for use in channel configuration.

    For instructions on validating and publishing the process flow, see the iWay Designer User's Guide.

  10. Close iWay Designer.

    Note: This is the simplest possible process flow to configure. In a real world scenario, most users will have more complex business logic. For more information on how to construct process flows and use the supported object types, see the iWay Designer User's Guide.

    Your next step is to add a new route to the Registry of the iWay Service Manager Administration Console and associate the process flow with it.



x
Samba Read Agent Examples

This section describes how to create and test a process flow for the Samba Read agent using iWay Designer.



x
Procedure: How to Test the Samba Read Agent for a Read Operation from a Samba Drive

To test the Samba Read agent for a read operation from a Samba drive:

  1. Create a new Service object for the Samba Read agent by setting the properties, as shown in the following image.

    To view a list of parameters that are required to configure the Samba Read agent, see Samba Read Agent Configuration Parameters.

  2. Click OK.
  3. Enter a name and an optional description, and click Finish.

    On successful execution, the success edge is returned. For an error condition, such as an invalid file path, the failure edge is returned.



x
Testing the Samba Read Agent for Embedding File Contents Along With a Read Operation

The Samba Read agent can be used in conjunction with a File listener to embed file contents (the file picked up by the listener) into the XML file that is read from the Samba drive by specifying a tag. In the case of a process flow, the test document can be used as the enclosing document.

The full file path must be provided for the InputFile property. The document that is read from the Samba drive as specified by the InputFile property is:

<Test>Hello World</Test>

The input file to the process flow (given at runtime) is:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<parent><test1>Test By Soumya</test1></parent>

The properties of the Samba Read agent can be specified, as shown in the following image.

After running the process flow, the test result is:

<parent>><Test>Hello World</Test><test1>Test By
Soumya</test1 </parent>




x
Samba Emit Agent Examples

This section describes how to create and test a process flow for the Samba Emit agent using iWay Designer.



x
Procedure: How to Test the Samba Emit Agent for an Emit Operation to a Samba Drive

To test the Samba Emit agent for an emit operation to a Samba drive:

  1. Create a new Service object for the Samba Emit agent by setting the properties, as shown in the following image.

    To view a list of parameters that are required to configure the Samba Emit agent, see Samba Emit Agent Configuration Parameters.

  2. In the Destination field, enter the path to the file directory (do not include the file name).

    Leave the Source field blank

  3. In the File Pattern field, enter the name of the output file name.
  4. Publish and run the process flow. Specify the input document as <test/> (default).

    If the Samba emit is successful, the emitSample.xml file is generated for the destination directory containing the contents of <test/>.

    If the Return field was set to input, the input document, <test/> will be returned by the stream in the process flow.



x
Testing the Samba Emit Agent for a Status Return

This section describes the behavior of the Samba Emit agent for a Status return type.

You can use the same process flow as explained in How to Test the Samba Emit Agent for an Emit Operation to a Samba Drive. In this example, the file that will be emitted is emit.xml.

  1. Right-click the Samba Emit agent Service object and select Properties from the context menu.
  2. From the Return drop-down list, select status.
  3. Run the process flow.

The emit.xml file is generated under the Samba drive that is specified for the Destination field.

The following output is obtained at the end of the stream.

<?xml version="1.0" encoding="UTF-8" ?> 
- <emitstatus status="0">
<protocol>Samba</protocol> 
- <parms>
    <parm name="nopreemit">false</parm> 
    <parm name="b64">false</parm> 
    <parm name="uncpathin">\\SoumyaPC\softwares\testSmaba\file_out</parm>
    <parm name="pattern">emit.xml</parm> 
    <parm name="userid">sr12231</parm> 
    <parm name="return">status</parm> 
    <parm name="password">***</parm> 
</parms>
<timestamp>2009-01-23T17:54:37.755Z</timestamp> 
<status>0</status> 
<count>1</count>
<name>smb://sr12231:*******@SoumyaPC/softwares/testSmaba/file_out/
</name>
</emitstatus>


x
Testing the Samba Emit Agent for a Status (Return) Code

To check the Samba Emit agent for a status (return) code and branch accordingly:

  1. Create a new process flow.
  2. Add a control to check for the status code and to branch accordingly.

    In the following example, a Decision Test object is added to the result of the Samba Emit agent. If a success condition is returned, a database operation is performed. If an error condition is returned, an email is sent to the user to inform them of the error.

  3. Check the status code by using an XPATH function in the Decision Test object.
  4. Provide the following condition:
    XPATH (/emitstatus/@status) equals 0 (indicating success).

    A status code other than 0 indicates an error condition and is routed to the SendEmail object.

As a test, run the process flow and provide an incorrect password when connecting to the Samba drive. The SendEmail object will be reached because a failure edge is returned. The status code is 1.





x
Samba Operations (Ops) Agent Examples

This section describes how to create and test a process flow for the Samba Ops agent using iWay Designer.



x
Procedure: How to Test the Samba Ops Agent for a Size Operation

The Samba Ops agent can perform various operations on files in the Samba drive. The size operation returns the size (value) of the file that is acquired from the Samba location specified by the agent.

To test the Samba Ops agent for a size operation:

  1. Create a new Service object for the Samba Ops agent by setting the properties, as shown in the following image.

    To view a list of parameters that are required to configure the Samba Ops agent, see Samba Ops Agent Configuration Parameters.

  2. Add a Decision Test object by setting the properties, as shown in the following image.

  3. Test the process flow for the size operation:
    1. Under From File, assign the file as having a size less than 5 KB.

      The output is shown in the following image.

    2. Under From File, assign the file as having a size greater than 5 KB. The Test Result in this case will be True and the success edge is returned.


x
Testing the Samba Ops Agent for a Prepend Operation

The prepend operation refers to prepending the contents of the file specified by the From File property to the file specified by the To File property. The resulting file is stored in To File. The full file path must be specified for both the From File and To File fields. For example:

'\\SoumyaPC\softwares\testSamba\file_in\in.xml'.

Create a new Service object for the Samba Ops agent by setting the properties, as shown in the following image.

The content of From File is:

<test/>

The content of To File is:

<parent><test1>Hello World</test1></parent>

The To File content is modified as:

<test/>
<parent><test1>Hello World</test1></parent>




x
Understanding the Samba Status Tree

This section provides an example of a Samba status tree.

<?xml version="1.0" encoding="UTF-8" ?> 
- <emitstatus status="0">
  <protocol>Samba</protocol> 
- <parms>
  <parm name="nopreemit">false</parm> 
  <parm name="b64">false</parm> 
  <parm name="uncpathin">\\SoumyaPC\softwares\testSmaba\file_out</parm> 
  <parm name="pattern">emit.xml</parm> 
  <parm name="userid">sr12231</parm> 
  <parm name="return">status</parm> 
  <parm name="password">***</parm> 
  </parms>
  <timestamp>2009-01-23T17:54:37.755Z</timestamp> 
  <status>0</status>
  <count>1</count> 
  <name>smb://sr12231:*******@SoumyaPC/softwares/testSmaba/file_out/
</name> </emitstatus>

where:

uncpathin

Is the output file path to which the file is emitted.

pattern

Is the output file pattern emitted.

status

Is the return status code. A status code of 0 defaults to success.

count

Is the number of times retry was attempted.


Top of page

x
Configuring the Samba Drive in Windows

This section describes how to configure the Samba drive in Windows.



x
Procedure: How to Set the Samba Drive in Windows

To set the Samba drive in Windows:

  1. Create a new folder, for example, sambadrive.
  2. Share the new folder and grant permission to Everyone, All, or Windows User.

  3. Click Permissions. A dialog box is displayed in the following image. Make sure that you give full permissions to Everyone/User which is being used.

  4. Select the Allow check box for the Full Control permission and click OK

  5. Create all sub-folders that can be used for the listener/emitter.

    The Samba drive is set and ready to be used.


Top of page

x
Sample Configuration for Listeners and Emitters

The input path is the directory in which input messages are received. Do not use the file suffix. For example:

server:[port]/share/dir/
\\<ipaddress>\\<sambadrive(or)sharename>\<foldernames>

where:

<ipaddress>

Is the IP address where the Samba drive is located.

<sambadrive(or)sharename>

Is the name of the share location or Samba drive.

<foldernames>

The name of the folders you need to access.

Example String:

\\172.30.244.75\sambadrive\datashare2\in1\

User Name: User ID that has full control of the shared folder.

Password: Password that is associated with the user ID.


iWay Software