by community-syndication | Sep 4, 2010 | BizTalk Community Blogs via Syndication
If you have questions about security and Windows Azure, there’s a really good compilation of resources available here.
There’s a lot of great content there about all things security-related about Azure, and developing secure apps on, and leveraging, the Azure platform.
A particularly interesting read is Windows Azure Security Overview, which talks about security from the Azure-side (fabric controller, facilities, network, everything!). This is more than most people need to know, but if you ever wondered what goes on under the hood, you’ll find this of interest.
See the compilation page, read and learn more at http://msdn.microsoft.com/en-us/library/ff934690.aspx.
by community-syndication | Sep 4, 2010 | BizTalk Community Blogs via Syndication
Error:
read more
by community-syndication | Sep 3, 2010 | BizTalk Community Blogs via Syndication
SQL Script to list all the columns of a table with the Schema Information
If you are looking for a SQL Script which will display a list of all columns in a table and also the Schema Information, you can use the following Script.
read more
by community-syndication | Sep 3, 2010 | BizTalk Community Blogs via Syndication
Tellago is going to rock the Buenos Aires Code Camp tomorrow!!! Four of our architects are presenting on some of the newest Microsoft technologies. Here is a quick summary of the topics our guys are presenting on. Pablo Cibraro ( http://weblogs.asp.net…(read more)
by community-syndication | Sep 3, 2010 | BizTalk Community Blogs via Syndication
Nestled deep within the Castle Project repository, there is a wonderful library maintained by Improving Enterprises’ own Craig Neuwirt which can forever change how you deal with the assortment of Key/Value pair structures in our programming life. That library is called DictionaryAdapter, or more properly Castle.Components.DictionaryAdapter and the source can be found at : http://github.com/castleproject/Castle.Core
So how does this library work? Let’s take a quick tour around, shall we?
So you’ve got a Dictionary
static void Main(string[] args)
{
var dict = new Dictionary<string, object>()
{
{ "UserId", 1234567 },
{ "UserFirstName", "Tim" },
{ "UserLastName", "Rayburn" }
};
}
We deal with dictionaries like this all the time in .NET, the easiest example of which is ASP.NET Session but many others exist. Now lets assume that we wanted to access this information in a structured way. That is to say, instead of writing something like:
public static string UglyWayToGetUserFirstName(Dictionary<string, object> dict)
{
string userFirstName = "UserFirstName";
if (dict.ContainsKey(userFirstName)) return dict[userFirstName] as string;
return null;
}
I instead want to write code which access the information using a strongly typed interfaced like this:
public interface IUserData
{
int UserId { get; set; }
string UserFirstName { get; set; }
string UserLastName { get; set; }
}
Which would produce code like this:
public static string CleanWayToGetUserFirstName(IUserData data)
{
return data.UserFirstName;
}
How do I do that? DictionaryAdapter to the rescue. Add a reference to Castle.Core, and a using statement for Castle.Components.DictionaryAdapter and then the following code will work:
static void Main(string[] args)
{
var dict = new Dictionary<string, object>()
{
{ "UserId", 1234567 },
{ "UserFirstName", "Tim" },
{ "UserLastName", "Rayburn" }
};
IUserData data = new DictionaryAdapterFactory().GetAdapter<IUserData>(dict);
Console.WriteLine(CleanWayToGetUserFirstName(data));
Console.ReadLine();
}
Simple, eh? But there is much more coming. As you can see, there is a default convention that matches the property name of our interface to the key in the dictionary. Lets assume that you’re the type of person who believes having the word User in front of each property on the interface is a bad idea, but keeping it on the keys which lack the context of being IUserData makes sense. No problem, enter aliasing. Modify your interface like so:
public interface IUserData
{
[Key("UserId")]
int Id { get; set; }
[Key("UserFirstName")]
string FirstName { get; set; }
[Key("UserLastName")]
string LastName { get; set; }
}
And now your interface main method (no longer using our rather useless CleanWayToGetUserFirstName example above) can be refactored like so:
static void Main(string[] args)
{
var dict = new Dictionary<string, object>()
{
{ "UserId", 1234567 },
{ "UserFirstName", "Tim" },
{ "UserLastName", "Rayburn" }
};
IUserData data = new DictionaryAdapterFactory().GetAdapter<IUserData>(dict);
Console.WriteLine(data.FirstName);
Console.ReadLine();
}
That’s a good introduction to the basics of DictionaryAdapter, but there is a lot more depth here that I hope to cover in future posts.
by community-syndication | Sep 3, 2010 | BizTalk Community Blogs via Syndication
Some time ago, with a client using BizTalk 2006 and Covast Accelerator 2006, we suddenly had the following issue popping up in their event log:
There was a failure executing the send pipeline: “Covast.BizTalk.Pipeline.EDI.CovastEDISendPipeline, Covast.BizTalk.Pipeline.EDI.Default, Version=5.0.0.0, Culture=neutral, PublicKeyToken=68bef120a46b49ad” Source: “Covast EDI Assembler” Send Port: “sp_MySendPort” URI: “D:\BTS2006\DumpLocation\%MessageID%.edi” Reason: Message translation failed: (2217) Unknown error (-2217)
The source of the problem was Covast.
Somehow, it was no longer able to perform valid assembling and disassembling (both were failing).
After a lot of digging and research I finally came to the “Covast EDI Accelerator 2006 Reports” screens, hidden deep within the BizTalk Administration Console HAT 🙂
When you double click the interchange which was in error, you saw the following error:
The format of the document has not been configured
Finally, did let me to the source of the problem.
Someone at the client fiddled around with one particular ASC file trying to add some extra segments to the schema to accompany a change in one of their flows. No harm done, but unfortunately when re-generating the XSD, he also regenerated the SYNTAX schema and deployed.
The result was that there were now 2 SYNTAX schemas deployed within BizTalk and Covast doesn’t know how to handle that.
Reverting back to the old version of the flow fixed the error and after that we just removed the SYNTAX schema from the project, rebuilt and deployed and now it worked.
Reason for posting this is that at the time, neither search engine could come up with a decent answer, so hopefully someone benefits from this post.
Let us know in any case!
Pieter
by community-syndication | Sep 2, 2010 | BizTalk Community Blogs via Syndication
Consider the following scenario – I want to write a workflow that gets instantiated when certain changes happen in LOB (say a new row is added to a table) and then does some processing with the altered data. In the current release of Microsoft BizTalk Server, Add Adapter Service Reference (AASR) generates LOB activities only for outbound operations. For inbound operations (polling, notification, etc), AASR only generates the contract and configuration information along with a dummy service implementation. This blog explains how to create such a workflow service and host it in IIS.
I will use a Typed Polling scenario for WCF SQL adapter to illustrate the steps involved for a one-way operation.
Generate service – Create a new “WCF Workflow Service Application”. Run AASR and select the appropriate inbound operation. You can delete the dummy service implementation since that’s no longer required. Let’s assume the generated contract looks like
[System.CodeDom.Compiler.GeneratedCodeAttribute(“System.ServiceModel”, “4.0.0.0”)]
[System.ServiceModel.ServiceContractAttribute(Namespace=”http://schemas.microsoft.com/Sql/2008/05/“, ConfigurationName=”TypedPolling_Foo”)]
public interface TypedPolling_Foo {
[System.ServiceModel.OperationContractAttribute(IsOneWay=true, Action=”TypedPolling“)]
void TypedPolling(TypedPolling request);
}
Configure the activities – Since this operation is one-way, we will delete the “SendResponse” activity and also remove the co-relation handle from the “Receive” activity (in the properties for the “Receive” activity, select CorrelationInitializers and delete the handle) and optionally from the “Variables” as well. Apply the following configuration to the activity (obtained from the above contract)
- OperationName – TypedPolling
- ServiceContractName – {http://schemas.microsoft.com/Sql/2008/05/}TypedPolling_Foo
- Action – TypedPolling
- Check CanCreateInstance
- Content – Select “Message”
- Message data – create a variable of type TypedPolling and specify that
- Message type – TypedPolling
If the operation is two-way, i.e. needs to return a response, SAP RFC call for example, there are some differences. You shouldn’t remove the “SendResponse” activity and the correlation handle. The configuration of the “Receive” part stays the same as described above. For the “SendResponse” part, apply the following configuration.
- Action – Set this to the ReplyAction in the OperationContractAttribute.
- Content – Select “Message” and set the “Message type” to the return type and “Message data” to a variable of that type
Process the input – The workflow can now use the variable (Message data) to get the contents of the poll and do whatever processing it needs to do with that data
Update the config – Modify the “service” name in the configuration file to the name of the workflow class (do not include the namespace), which essentially implements the service
<system.serviceModel>
…
<services>
<service name=”Workflow1″>
<endpoint address=”mssql://localhost//mytestdb?InboundId=Foo” …
Deploy the service – At this point the service is ready to be hosted. You can use VS 2010 to deploy it to IIS. From the project properties –> Web, select the “Use Local IIS Web Server”, specify a URL, create a virtual directory and then build the project. However, since the service endpoint is using a custom binding which IIS does not understand, we will need to “Auto-Start” it. This is a new feature in IIS 7.5 and is explained here. While the blog explains it in the context of Service Bus Endpoints, it applies to this scenario as well.
Sandeep Prabhu,
BizTalk Server Team
by community-syndication | Sep 1, 2010 | BizTalk Community Blogs via Syndication
It has been a while since I have been to Perth and I am looking forward to catching up with some of the people I know there. I will be there for the week of the 4th – 8th of October teaching the SolidQ BI Bootcamp course, of if you are interested in catching up or doing some SQL training drop me an email.
by community-syndication | Sep 1, 2010 | BizTalk Community Blogs via Syndication
Today on endpoint.tv I showed how to create a workflow service that can do background work on a scheduled basis (The sample code is posted here). In the example I showed a web UI that allows you to start the job by clicking on a submit button.
Somebody asked me if there was a way to do this without a human starting the process. They wanted the system to automatically start the process whenever the app started up.
Yes there is a way and here is how you can do it. I decided to add some settings to web.config that would allow you to create an auto start counter.
Add the following to web.config
<configuration>
<appSettings>
<!-- The following will cause a batch process to start counting when the app auto-starts. -->
<!-- The format is (count to)|(delay)-->
<add key="AutoCount" value="1000|10"/>
</appSettings>
Add the following code to the Global.asax.cs file in the Application_Start method
private void Application_Start(object sender, EventArgs e)
{
// Code that runs on application startup
string autoCount = ConfigurationManager.AppSettings["AutoCount"];
if (string.IsNullOrWhiteSpace(autoCount)) return;
var values = autoCount.Split('|');
// Check for valid value
if (values.Length != 2)
return;
int count;
if (!Int32.TryParse(values[0], out count)) return;
int delay;
if (!Int32.TryParse(values[1], out delay)) return;
var request = new BatchRequest
{
CountTo = count,
Delay = TimeSpan.FromSeconds(delay),
StartAt = DateTime.Now
};
var proxy = new BatchWorkerClient(new NetNamedPipeBinding(), new EndpointAddress("net.pipe://localhost/BatchWeb/BatchWorker.xamlx"));
try
{
var response = proxy.SubmitJob(request);
proxy.Close();
}
catch
{
proxy.Abort();
throw;
}
}
Then using IIS manager do the following
Enable named pipes
- Right click on the BatchWeb site and select Manage Application / Advanced Settings
- Add net.pipe to the list of enabled protocols
Enable Auto-Start
- Right click on the BatchWeb site and select Manage WCF and WF Services
- On the Auto-Start tab set the app to auto start
Now when the system boots (or the app pool recycles) the system will start a counting job. You might want to include a way to check and see if the batch work is already in process before starting another one. My code always starts up a new one.
by community-syndication | Sep 1, 2010 | BizTalk Community Blogs via Syndication
This blog post is about creating a custom BizTalk pipeline that allows the original data stream to be seekable. If the position of this stream is not reset when it’s returned then the message…
Daniel Berg’s blog about ASP.NET, EPiServer, SharePoint, BizTalk