Sending Soap with Attachments (SwA) using BizTalk – Part 2

This is a continuation to my previous article.

Create a WCF service which can send the SOAP message with attachment.

1. Create a standard wcf service ( I guess this shouldnt be an issue )

2. Below is a very rough idea of what should go inside the service implementation

string endpoint = “”
ResponseObject resp = null;
using(var cf = new ChannelFactory<IService>(endpoint)
var channel = cf.CreateChannel();
using(var scope = new OperationContextScope(IContextChannel)channel))
OperationContext.Current.OutgoingMessageProperties[SWAEncoderConstants.AttachmentProperty] = attachment.ToSimpleXmlUTF8();
resp = channel.method(request).response;

I will write a detailed post with a sample implementation later.