The following topics describe the File Binding Component. About the File Binding Component About the File Binding ComponentThe File Binding Component (BC) is a JSR-208 compliant JBI runtime component that provides a comprehensive solution to interact with a file system within a JBI environment. The design time component of File Binding component is a NetbeansTM module that provides plug-in to NetBean's project system and thus defines how File binding can be used. The runtime component implements all required component interfaces in JBI specification and provides functionality for this component to assume roles either as a service consumer (inbound) or service provider (outbound). File BC as a Service ProviderIn the case of outbound message flow, where the File Binding Component is being “invoked” by other components, the File Binding Component acts as an external File service provider. In this role, the File Binding Component converts a normalized message--that it receives as part of the message exchange from other components--to a File type message. After the File type message is created as a result of the message conversion, the File type message is written to a file system. File BC as a Proxy ConsumerIn the case of inbound message flow, where the File Binding Component consumes the services of other components, the File Binding Component acts as an external File proxy consumer. In this role, the File Binding Component converts the File type message, that it receives from the file system, to a normalized message. The normalized message is then sent, as part of the message exchange, to another component as a service request. File Binding Component FeaturesFeatures of the File Binding Component include:
Installing the File Binding ComponentThe bundled packages include a runtime component, and a design-time component. Installation of these run-time and design-time components is not covered in this topic. For more information, please refer to the following: Design-Time InstallationRefer to the following document for instruction on installing the design-time portion of the File BC. http://caps.red.iplanet.com/pubs/shasta/JBIAddOns/JBI_AddOns.html Run-Time InstallationRefer to the following document for instruction on installing the run-time portion of the File BC. Configuring the Design-Time ComponentsConfiguring the File BC design-time components means configuring the WSDL extensibility elements. File WSDL extensibility elements are used to specify File binding specific configurations for the file system format. In WSDL, the term binding refers to the process associating protocol or data format information with an abstract entity like a message, operation, or portType. In the case of the File BC, the abstract portion of the WSDL could be used to either "read" or "write" to a file, while the concrete portion of the WSDL contains the extensibility elements that describe the actual attributes of the message. WSDL points of extensibility, called extensibility elements, reside
under various WSDL defined elements. The File Binding Component includes
two extensibility elements called The file directory to read from or to write to is specified in the
You can configure two extensibility element groups for the File Binding Component: Service Level File Extensibility ElementsThe File address extensibility element allows users to specify the "connectivity" information to a file system. File
The following is a sample usage of the File <service name="SomeService"> <port binding="tns:someBinding" name="fileEndpoint"> <file:address fileDirectory="/home/joe/test"/> </port> </service> Binding Level File Extensibility ElementsFile extensibility elements at the binding level define file transport specific details for operations and messages. These extensibility elements allow specification of File specific details for each port. File binding extensibility elementThe <binding name="someBinding" type="tns:somePortType"> <file:binding/> </binding> File operation extensibility elementThe <binding name="someBinding" type="tns:somePortType"> <file:binding/> <operation name="someOp"> <file:operation/> </binding> File operation extensibility elementThe file:read extensibility elements allow users to specify the element features for reading a file. File
File operation extensibility elementThe File
File Client Use CasesUse Cases provide scenarios that convey how components interact with external systems to achieve a specific business goal. The following use cases describe how to read a file and how to write to a file. The File Binding Component offers communications in two directions: outbound, invoking external service providers, and inbound, where external clients invoke services provided by the binding component. Use Case 1: Read a File and Submit Contents to the NMRIn this example, a folder corresponding to an endpoint is polled periodically. All the files that satisfy the content conditions are read and the contents converted to a normalize message, which is then submitted to the NMR. The normalized message is created depending on whether the file conforms to the supported message type. Results The status of the message exchange is recorded in the log file. The file is moved to the processed folder once the message exchange is completed. Main Scenario
Use Case 2: Write the Contents of a Normalized Message to a FileIn this example, the File Binding Component accepts requests for provider endpoints. The contents of these requests are written to files in the corresponding write folders. One-way (robust and non-robust) cases are only supported. Request-response is not supported because there is no way to identify a response corresponding to a request. Results The message content is written to a file in a specified folder in the deployment file. Main Scenario
WSDL ExamplesThe following describes how to use the File Binding Component Extensibility Elements to:
In WSDL the term binding refers to the process associating protocol or data format information with an abstract entity like a message, operation, or portType. The following abstract portion of the WSDL could be used to either read a file, or write to a file. In this example, the input element specifies the abstract message format for an one-way “inbound” operation. <?xml version="1.0" encoding="UTF-8"?> <definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:file="http://schemas.stc.com/jbi/wsdl-extensions/file/" xmlns:slnk="http://schemas.xmlsoap.org/ws/2002/07/service-link/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="urn:FooBar3" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="FileHelloService1" targetNamespace="urn:FooBar3"> <message name="HelloIF_sayHello"> <part type="xsd:string" name="body"/> </message> <message name="HelloIF_sayHelloResponse"> <part type="xsd:string" name="result"/> </message> <portType name="FileHelloIF"> <operation name="sayHello"> <input message="tns:HelloIF_sayHello"/> </operation>... WSDL points of extensibility, called extensibility elements, reside under various WSDL defined elements. In the File Binding Component, extensibility elements are used to specify specific binding information for the file system format. The File Binding Component includes two extensibility elements called
The file directory to read from or to write to is specified in the
<binding name="HelloDocElem2DocElemIFBinding" type="tns:FileHelloIF"> <file:binding/> <operation name="sayHello"> <file:operation/> <file:read use="literal" pollingMillis="3000" fileName="Input.dat"/> </input> </operation> </binding> <service name="FileHelloService1"> <port binding="tns:HelloDocElem2DocElemIFBinding" name="HelloDocElem2DocElemIFPort"> <file:address fileDirectory="c:/test"/> </port> </service> If the abstract portion of the WSDL listed above describes an outbound consumer message, then the concrete portion of the message should appear as follows: <binding name="HelloDocElem2DocElemIFBinding" type="tns:FileHelloIF"> <file:binding/> <operation name="sayHello"> <file:operation/> <input> <file:write use="literal" fileName="Output.dat"/> </input> </operation> </binding> <service name="FileHelloService1"> <port binding="tns:HelloDocElem2DocElemIFBinding" name="HelloDocElem2DocElemIFPort"> <file:address fileDirectory="c:/test"/> </port> </service> For request-response type of operations, the complete WSDL would appear as follows: <?xml version="1.0" encoding="UTF-8"?> <definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:file="http://schemas.stc.com/jbi/wsdl-extensions/file/" xmlns:slnk="http://schemas.xmlsoap.org/ws/2002/07/service-link/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="urn:FooBar3" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="FileHelloService1" targetNamespace="urn:FooBar3"> <message name="HelloIF_sayHello"> <part type="xsd:string" name="body"/> </message> <message name="HelloIF_sayHelloResponse"> <part type="xsd:string" name="result"/> </message> <portType name="FileHelloIF"> <operation name="sayHello"> <input message="tns:HelloIF_sayHello"/> <output message="tns:HelloIF_sayHelloResponse"/> </operation> </portType> <binding name="HelloDocElem2DocElemIFBinding" type="tns:FileHelloIF"> <file:binding/> <operation name="sayHello"> <file:operation/> <input> <file:read use="literal" pollingMillis="6000" fileName="Input.dat"/> </input> <output name="output"> <file:write use="literal" fileName="Output.dat"/> </output> </operation> </binding> <service name="FileHelloService1"> <port binding="tns:HelloDocElem2DocElemIFBinding" name="HelloDocElem2DocElemIFPort"> <file:address fileDirectory="c:/test"/> </port> </service> </definitions> Note how the File BC LimitationsThe following limitations apply to the File Binding Component:
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||