Figure 1. Create a Windows Azure Storage Account.
Figure 2. Specify Windows Azure Storage Account details.
Figure 5. A newly created container.
Figure 6. Windows Azure Storage Services endpoints
Figure 7. WCF-WebHttp Transport Properties General Tab.
Figure 8. Variable Mapping of File Name variable.
Figure 11. Manage the access keys.
Now that the WCF-WebHttp is configured we can look at the complete
BizTalk messaging solution that consists of a Send port and Receive port.
The messaging solution is a very basic (see figure 12). A file will be dropped into a folder and a BizTalk receive port that listen to that folder will pick the file up. It will then be routed to a send port that subscribes to the files coming in through
the receive port. The send port is configured with WCF-WebHttp adapter and will send according to its configuration the file to a container in Windows Azure Storage.
However the way the adapter is configured the name of the file will be containing the path of the folder and the file name. Something like
C:\foldername\filename. To prevent that from happening in a message based solution you will need a simple custom pipeline component that will strip off the path name. Below you can see the code to strip of the path from the
ReceivedFileName context property.
IBaseMessage Execute(IPipelineContext pContext, IBaseMessage pInMsg)
contextReceivedFileName = pInMsg.Context;
value = contextReceivedFileName.Read(
filename only, strip path
fileString = file.Name;
updated value back to context
the message with modified context
Read suggested related topics: