Skip to content

Instantly share code, notes, and snippets.

View CoditCompany's full-sized avatar
👋
You can find us on @CoditEU

Codit CoditCompany

👋
You can find us on @CoditEU
View GitHub Profile
@CoditCompany
CoditCompany / IBaseMessage.cs
Last active August 29, 2015 14:07
For more information, please see http://www.codit.eu/4662.aspx
public Microsoft.BizTalk.Message.Interop.IBaseMessage Execute(IPipelineContext pContext, Microsoft.BizTalk.Message.Interop.IBaseMessage pInMsg)
{
object backupTransportVal = pInMsg.Context.Read("BackupEndpointInfo", "http://schemas.microsoft.com/BizTalk/2003/system-properties");
if (backupTransportVal == null)
{
//Not present => no backupTransport configured => use default
//Perform Actions
}
else
while (!asleep)
{
Console.Write("Blog posts");
}
<system.diagnostics>
<sources>
<sourcename="Microsoft.ServiceModel.Channels"switchValue="Warning">
<listeners>
<addname="eventlog" />
</listeners>
</source>
<sourcename="Microsoft.Adapters.SAP"switchValue="Warning">
<listeners>
<addname="eventlog" />
<addname="xml" type="System.Diagnostics.XmlWriterTraceListener"
traceOutputOptions="LogicalOperationStack"
initializeData="C:\log\WCF\AdapterTrace.svclog" />
inmsg.Context.Write("Operation", "http://schemas.microsoft.com/BizTalk/2003/system-properties","GetCitiesByCountry");
inmsg.Context.Write("Action", "http://schemas.microsoft.com/BizTalk/2006/01/Adapters/WCF-properties","http://webserviceX.NET/GetCitiesByCountry");
<system.serviceModel>
<behaviors>
<endpointBehaviors>
<behavior name="sbbehavior">
<transportClientEndpointBehavior>
<tokenProvider>
<sharedAccessSignature keyName="SendAccessKey" key="xxx=" />
</tokenProvider>
</transportClientEndpointBehavior>
</behavior>
async void Main()
{
var mf = MessagingFactory.CreateFromConnectionString("your cnx string here");
var eventHubClient = mf.CreateEventHubClient("ehname");
Random rnd = new Random();
Parallel.For(1, 11, async (deviceId) =>
{
for(int cnt = 0; cnt < 50; cnt++)
{
Console.WriteLine ("Sending event nr {0} for device {1}", cnt, deviceId);
@concat('>>> _"', triggers().outputs.body.MessageText, '"_ by *', triggers().outputs.body.SenderName, '* _(', triggers().outputs.body.WebUrl, ')_')
public void ApplyClientBehavior(ServiceEndpoint endpoint, System.ServiceModel.Dispatcher.ClientRuntime clientRuntime)
{
System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;
}