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.
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
- In the samples directory, select and double-click tibco.bw.sample.binding.soap.http.UnboundAttachments. For more information, see Accessing Samples.
- In the Project Explorer view, expand the tibco.bw.sample.binding.soap.http.UnboundAttachments project.
- Click .
- At the left hand tree of Debug Configuration wizard, expand BusinessWorks Application and select BWApplication.
- Click the Applications tab and then click the Deselect All button if you have multiple applications. Select the checkbox next to tibco.bw.sample.binding.soap.http.UnboundAttachments.application.
- Click
Debug.
This runs the sample in Debug mode.
- In
TIBCO Business Studio™ for BusinessWorks™, click the
Terminate
icon to stop the process.
:
Sent binary file size : 3587 bytes. Received binary file size : 3587 bytes. Sent text file size : 37 Received text file size : 37
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 the Set 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.