Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
30 lines (26 sloc) 825 Bytes
namespace azureatwork.Azure.NSB.Worker.Services
{
using System.ServiceModel;
using System.Xml.Linq;
using NServiceBus;
using azureatwork.Azure.Messages.Command;
[ServiceBehavior(InstanceContextMode = InstanceContextMode.PerCall)]
public class SampleRESTService : ISampleRESTService
{
private readonly IBus bus;
public SampleRESTService()
{
if ( null == this.bus)
this.bus = Configure.Instance.Builder.Build<IBus>();
}
public XElement Send(XElement message)
{
this.bus.Send(new SendCommand
{
Data = message.ToString()
});
this.bus.Send(message);
return new XElement("Response", new XElement("Success", true));
}
}
}