Sending and Receiving a SOAP Bound Attachment

A client process sends Text and GIF files as attachments for the In-Band 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.

Note: It is a Bound Attachment when one part of the Input or Output WSDL message is of type "base64binary" and that part is mapped with an attachment. In a concrete WSDL, the attachment is described as a mime part of the Multipart message.

Prerequisites

Copy the Attachment.txt and tibcologo.gif files from TIBCO_HOME\bw\n.n\samples\binding\soap\http\BoundAttachments to the directory specified for the AttachmentBaseDir property.

Procedure

  1. In the samples directory, select binding > soap > HTTP > BoundAttachments and double-click tibco.bw.sample.binding.soap.http.BoundAttachments. For more information, see Accessing Samples.
  2. In Project Explorer expand the tibco.bw.sample.binding.soap.http.BoundAttachments project.
  3. Set the default ApplicationProfile to match the OS you are running on. For more information, see Setting the Default Application Profile.
  4. Fully expand the Processes directory and double-click ClientProcess.bwp.
  5. Click Run > Debug Configurations.
  6. At the left hand tree of the Debug Configuration wizard, expand BusinessWorks Application and select BWApplication.
  7. Click the Applications tab and then click the Deselect All button if you have multiple applications. Select the check box next to tibco.bw.sample.binding.soap.http.BoundAttachments.application.
  8. Click Debug.
    This executes the sample in Debug mode.
  9. In TIBCO Business Studio™ for BusinessWorks™, click the Terminate icon to stop the process.

Result

A BoundAttachments directory is created and the Output.log file is 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. It receives the Client request that has WSDL message parts defined as base64Binary type and has Binary and Text attachments. Service reply mechanism sends back the same attachments to the ClientProcess.

The ClientProcess invokes the ServerProcess with input attachments (Binaryand Text). Consumer (Client) reads the input files and sends them to Producer (Server)process. Attachments received from Server are written to the 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 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 as part of the WSDL definition.