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.
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.
To add the Samba protocol adapter:
The Add or Remove Programs dialog box opens.
The Already Installed dialog box opens.
The iWay Service Manager Select Features dialog box opens.
Note: You must perform a hard restart. Using the Restart function in the iWay Service Manager Administration Console is not sufficient.
The following section describes how to configure the Samba listener.
To add a Samba listener:
The listener pane opens, as shown in the following image.
The table provided lists any existing listeners and short descriptions of each.
The Name and Description pane opens.
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.
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:
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. |
To add a Samba emitter:
The Emitters type pane opens, as shown in the following image.
The configuration parameters pane for the Samba emitter opens.
The Name and Description pane opens.
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.
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. |
This section describes how to configure process flows using the Samba agent in iWay Designer.
The Designer Project Information dialog box opens.
The Designer Project Bindings dialog box opens.
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).
The iWay Process Configuration dialog box opens.
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.
To add a Samba agent Service object:
The Service Name and Description dialog box opens.
The Service Type dialog box opens.
To view a list of parameters that are required to configure the Samba Read agent, see Samba Read Agent Configuration Parameters.
To view a list of parameters that are required to configure the Samba Emit agent, see Samba Emit Agent Configuration Parameters.
To view a list of parameters that are required to configure the Samba Ops agent, see Samba Ops Agent Configuration Parameters.
The Define Service dialog box opens.
The new Service object appears in the workspace.
Now you need to connect the Start object to the Service object.
The Line Configuration dialog box opens.
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.
All processing paths must terminate with an End object.
The End Name and Description dialog box opens.
The End Name Schema dialog box opens.
The Properties dialog box opens.
The new End object appears in the workspace.
The Line Configuration dialog box opens.
This option indicates that the path will be followed if there is a normal completion.
You can reposition the objects as desired.
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.
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.
This section describes how to create and test a process flow for the Samba Read agent using iWay Designer.
To test the Samba Read agent for a read operation from a Samba drive:
To view a list of parameters that are required to configure the Samba Read agent, see Samba Read Agent Configuration Parameters.
On successful execution, the success edge is returned. For an error condition, such as an invalid file path, the failure edge is returned.
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>
Parameter |
Description |
---|---|
Input file |
The share name to be read. For example: //SambaDrive/file |
Delete After Read |
If set to true, the file is deleted after a successful read. |
Domain |
The DNS name or IP address of the server. |
Port |
The TCP open port for the receipt of server requests. |
UserId |
An authorized user on the share. |
Password |
A password for the authorized user on the share. |
Format |
The file format to be transferred. |
Tag |
The name of the XML tag to wrap the data read in. Required if data is flat. |
Character Set Encoding of the read document |
The character set encoding of the document to be read. |
Embed |
This determines whether to embed the data from the read operation into the input document. |
Base64 Encode |
The Base64 encode the read in document when embedding. |
Parent Tag |
This determines the location in the input document where the input data should be embedded. |
This section describes how to create and test a process flow for the Samba Emit agent using iWay Designer.
To test the Samba Emit agent for an emit operation to a Samba drive:
To view a list of parameters that are required to configure the Samba Emit agent, see Samba Emit Agent Configuration Parameters.
Leave the Source field blank
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.
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.
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>
To check the Samba Emit agent for a status (return) code and 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.
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.
Parameter |
Description |
---|---|
Source of Data |
Used to specify a data source location using XPATH() or any other function for the source of data to write. If omitted, the input document is used by default. |
Destination |
The share name to be written to. For example: //SambaDrive/file |
Domain |
The DNS name or IP address of the server. |
Port |
The TCP open port for the receipt of server requests. |
UserId |
An authorized user on the share. |
Password |
A password for the authorized user on the share. |
File Pattern |
The output file name which can contain wildcard characters. |
Avoid Preemitter |
If set to true, the preemitter is avoided. |
Return |
Select one of the following options:
|
This section describes how to create and test a process flow for the Samba Ops agent using iWay Designer.
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:
To view a list of parameters that are required to configure the Samba Ops agent, see Samba Ops Agent Configuration Parameters.
The output is shown in the following image.
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>
Parameter |
Description |
---|---|
From File |
The UNC directory path where input messages are received. |
Domain |
The DNS name or IP address of the server. |
Port |
The TCP open port for the receipt of server requests. |
UserID |
An authorized user on the share. |
Password |
A password for the authorized user on the share. |
To File |
The UNC directory path where output messages are placed. |
Domain |
The DNS name (or IP address) of the server to which you want to connect. |
Port |
The TCP open port for the receipt of server requests. |
UserID |
An authorized user on the share. |
Password |
A password for the authorized user on the share. |
Size |
The special register that is designated to hold the size value. This parameter is required only if you are configuring the Size operation. This field must be left blank for all other operations. |
Out Document |
The document returned by operation (bad input defaults to result). |
Action on Failure |
This indicates whether the input document or the status document would be returned on failure. |
Retry |
The number of attempts to retry. |
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:
Is the output file path to which the file is emitted.
Is the output file pattern emitted.
Is the return status code. A status code of 0 defaults to success.
Is the number of times retry was attempted.
This section describes how to configure the Samba drive in Windows.
To set the Samba drive in Windows:
The Samba drive is set and ready to be used.
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:
Is the IP address where the Samba drive is located.
Is the name of the share location or Samba drive.
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 |