Sending and Receiving a SOAP Unbound Attachment
A client sends Text and GIF files as attachments for unbound attachments to the server process. The Server process receives these attachments and returns them as its response. The Client process captures the sent and received attachments size.
Prerequisites
Copy the Attachment.txt and Client.gif files from TIBCO_HOME\bw\n.n\samples\binding\soap\http\UnboundAttachments to the directory given for the AttachmentBaseDir property.
Procedure
Result
An UnboundAttachments directory is created and output.log file is generated with the following content written to it:
Sent binary file size : 2878 bytes. Received binary file size : 2878 bytes. Sent text file size : 35 Received text file size : 35
Understanding the Configuration
The ServerProcess implements the getsetAttachments operation along with Context activities. It receives the client request that has WSDL message parts defined as Element of Complex type. Binary and Text attachments are retrieved using Get Context activity. Service reply mechanism sends back the same attachments to the ClientProcess using theSet Context activity.
The ClientProcess invokes the ServerProcess with input attachments (Binary and Text) using Set Context activity. The Consumer (Client) reads the input files and sends them to the Producer (Server) process using the context mechanism. Attachments received from the server through Get Context activity are written to disk on the client side.
Finally, the Sent and Received file size information for Binary and Text attachments is written at the location specified in the OUTPUT_FILE module property.
These attachments' size matches and also depicts that attachments can be sent or received between the Producer and Consumer where they are defined using the context mechanism outside of WSDL definition.