As we’ve talk on a previous post, due to our interest on the cloud computing,we (Maxime and I) decided to build a WCF Azure Adapter to interact with the Azure Storage.
This adapter is first designed for BizTalk but can also be used in C# (and we test all the steps with BizTalk and C# cases).
Maxime explains on his blog few things about consuming queues with the Adapter, I will focus my post on the Blob case.
BizTalk WCF Adapter – a WCF Lob Adapter
We’ve built this adapter using the WCF Lob Adapter SDK (the msdn explains all the steps to build, consume and host an WCF adapter and as Maxime said, it’s not really so complicated).
For the selected operations, the adapter will build the xsd schemas for use in BizTalk and the Bindings configuration file:
the schema allows you to create a blob from string content or binary content (with specified encoding):
Then you can map you information using an orchestration, a map or using WCF Send Port configuration (that’s what I choose, we will use the Outbound WCF message body Property).
So here is the test case :
I want to take an image from a folder with BizTalk and put this image on a blob.
So I have to :
- create a Receive port and receive location that poll the file
- create a WCF Send Port that subscribe to the message of the Receive Port
- configure the WCF Send Port like this
Your account key have to be set in the azure bindings properties(for this test we use the development storage by using the URI property UseDevelopmentStorage=True) :
and then the messages properties
We specified the message body using the following template :
<bts-msg-body xmlns=\”http://www.microsoft.com/schemas/bts2007\” encoding=\”base64\”/>
The element bts-msg-body is used to copy the body of the message inside the Binary element. The attribute encoding is used by BizTalk to encode the Body content using special encoding.
The choices are : xml|string|base64|hex
If you want to transmit binary data, you can use base64 encoding. (For now the adapater support base64 and string encoding).
Here is the result, I upload a file in myfirstcontainer on my storage account :
(The tools used here is Azure Storage Explorer)
As said Maxime, we think that our adapter can be usefull for you if you use BizTalk and also to generate class for use with C#.
We plan to add some actions for the blob and support the personalization of the Blob Properties and Metadata using property context of BizTalk
We hope publishing the first release in a couple of days
Stay connected 😉