Adding and using C# classes in BizTalk projects
02 February 10 11:08 AM | wmmihaa | 2 comment(s)

I’ve seen several posts of how to add .cs files to your VS2008 BizTalk projects (Yossi has a good post), but none of them shows how to use them, which is not that obvious.

First of all, you can not use classes defined in the same project as the orchestration where you plan to use them. Secondly, and this is where I got stuck, – You don’t get any Intellisense!

But it will compile and work just fine.

Thanks to Jan Eliasen for the help.

WebCast - BizTalk Benchmark Wizard
01 February 10 09:00 PM | wmmihaa | with no comments

The webcast is moved to Cloudcast.net. 

Overview:
MSDN Devcenter
Download:
Download from CodePlex.com
For more information:
Benchmark your BizTalk Server (Part 1)
How to install:
Benchmark your BizTalk Server (Part 2)
BBW Drill Down:
Benchmark your BizTalk Server (Part 3)

Request For Speaker
28 January 10 01:52 PM | wmmihaa | with no comments

The Host adapters is a very significant part of BizTalk. However, the knowledge about them are almost absent, which is unfortunate as they should be quite useful. A quick study among our biggest clients shows that many of them are still using mainframe/AS400, and find it challenging to integrate these with other systems and applications in- and outside there organization.

We are looking for someone with knowledge and experience from working with the Host Application and Host File adapter. If you are an “expert” in the field, and feel comfortable doing a couple of sessions about it - Please let us know, as we would like to invite you Sweden and come talk to our user group.

The BizTalk User Group Sweden is one of be biggest user groups, and we are proud to have had speakers like; Richard Seroter, Charles Young, Stephen W. Thomas, Jon Flanders, Darren Jefford, Paolo Salvatori, Brian Loesgen, Dwight Goins among others. The goal of the user group is to spread knowledge and get people and organizations to adapt to products and technologies related to BizTalk and Connected Systems Division.

Interested? Send me a mail and let me know. 

image

Benchmark your BizTalk Server (Part 2)
10 January 10 11:00 AM | wmmihaa | 6 comment(s)

This post describes the installation process for the BizTalk Benchmark Wizard application. For more information read part 1.

The complete installation will include the following components:

  • BizTalk Benchmark wizard – The client tool from which you will run the tests
  • Three Hosts – BBW_RxHost, BBW_PxHost, BBW_TxHost
  • Three Host Instances
  • Two Adapter handlers for NetTcp
  • One BizTalk Application
  • Two Receive Ports
  • Two Send Hosts
  • One Orchestration

The installation process

Download the bits from Codeplex, and proceed with the normal installation. As the setup completes, your first step would be to install the BizTalk artifacts. These artifacts are the BizTalk components and bindings which makes up the testing scenarios. This is a two step process as you need to set up the hosts before you import the bindings.

BizTalk environment

You can run the scenarios on either a single-server installation or a two server installation. Regardless of the number of BizTalk servers in you group, you should not run it with more than two “active” servers, as it will otherwise not be covered by the benchmark values.

image
 image

1. Setup Hosts, Instances and Adapter handlers

The hosts, instances and handlers are created through running a script. You need to run the script file using “cscript” as shown below, and I apologize in advance to the poor error messages you might run into. 

1. Open an command prompt window and navigate to [Installation folder]\Artefacts\BizTalk. By default, the installation folder is “C:\Program Files\Blogical\BizTalk Benchmark Wizard”.

2. In the BizTalk folder you’ll find a InstallHosts.vbs file. Execute it using the following parameters:

          NTGroupName - The name of the Windows NT group.
          UserName – The name of the user account running the service instances.
          Password – The password of the user account running the service instances.
          Receive Host – The name of the server where you want to run the receive host instance. 
          Send Host - The name of the server where you want to run the sen host instance.
          Processing Host - The name of the server where you want to run the process host instance.

          If you have a single box installation, your script command might look like this:

          cscript InstallHosts.vbs "BizTalk Application Users" “\MyUser” “MyPassword” “BtsServer1” “BtsServer1” “BtsServer1”

          If you have a multi server installation, your script command might look like this:

          cscript InstallHosts.vbs "MyDomain\BizTalk Application Users" “MyDomain\MyUser” “MyPassword” “BtsServer1” “BtsServer2” “BtsServer2”

          Running this script will create:

        • Three hosts (BBW_RxHost, BBW_TxHost and BBW_PxHost)
        • Three host instances
        • One send and one receive adapter handler for the WCF NetTcp adapter.

2. Import BizTalk MSI

1. Open the BizTalk Administration Console, point to the “Applications” node and import the BizTalk Benchmark Wizard.msi found in the same folder as the scripts above.

          This will create a “BizTalk Benchmark Wizard” application along with all ports and orchestrations.

2. Finally, run the BizTalk Benchmark Wizard.msi on all BizTalk servers to add the assemblies to the Global Assembly Cache (GAC).

Done, click [Start]-> [All Programs]->[BizTalk Application Wizard] - [BizTalk Application Wizard] to start the application.

Related articles:

Benchmark your BizTalk Server (Part 3) by Ewan Fairweather

 

Good luck!

Filed under: , , ,
Benchmark your BizTalk Server (Part 1)
10 January 10 12:00 AM | wmmihaa | with no comments

Ever wondered if your BizTalk is all it can be?

image

Verifying your BizTalk Server installation is not an easy thing to do. So far the BizTalk Server 2009 Performance Optimization Guide is probably your safest bet. The Optimization Guide provides in-depth information for optimizing the performance of a BizTalk Server solution. However,  it won’t help you evaluate you BizTalk installation at runtime. To do this, you’ll have to continue analyzing it using Performance Analysis of Logs (PAL).

I’m not saying these aren’t good tools. In fact they are great. They are however quite extensive, and will ultimately not answer the question: “Do I get the expected workload through BizTalk?”.

Ewan Fairweather, together with some other smart people at Microsoft, have put together a comprehensive study about scaling out BizTalk. The principal is simple, test the same scenarios with different environments and quantify the scale out capabilities of one to four BizTalk servers and one to three message boxes.

The BizTalk Server 2009 Scale Out Testing Study provides sizing and scaling guidance for BizTalk Server. However, you’d find it challenging to compare your environment to these numbers as you haven’t got access to the same testing scenarios. And even if you did, you still couldn’t be sure you’ve configured it the same, and that you have been running the equivalent LoadGen scripts.

Four months ago, I contacted Ewan to ask him if he had some testing scenario I could run to evaluate the environment I was currently working on. He didn’t, but seemed very aware of the lack of such a “tool”. One thing led to another and we came to the conclusion we should make it ourselves.

- Today, four months later, we are happy to announce that BizTalk Benchmark Wizard is publicly available on Codeplex.    

The goal has been to make an easy to install and simple to use, wizard-like application with which one could test a BizTalk environment– and compare the result to the study. One of the challenges where to scope the project, and prevent ourselves from solving problems already addressed in tools such as LoadGen and PAL. For instance, BizTalk Benchmark Wizard is NOT

…a load tool

Although it does create load, it only does so against ONE receive host. The application could work against multiple receive hosts, in fact the earlier versions did, but it required a much more complex setup process from the user. We came to the conclusion that if your environment measures up using only one receive host, it most likely would do so using multiple hosts.

By setting these limitations, it also simplifies the comparison of environments and benchmarking them against the result from the Microsoft Study.

…an analyzing tool

The tool does not analyze any eventual problems or bottlenecks. Neither does it give any hints or advice of how to solve them. It does however collect Perfmon counter data from each of the servers, both BizTalk and SQL. If your environment fails the test, you can analyze the data using the PAL tool.

How it works:

  1. After the user has started the application and specified the BizTalk Group, the tool analyzes its configuration, finding all the BizTalk servers, Messageboxes etc.
  2. Secondly, the user gets to select one of two scenarios: Messaging or Orchestration. Each scenario has a set of tested environments such as
    • Single server (2*Quad CPU, 4GB RAM)” 
    • “1*BTS (1*Quad CPU.  4GB RAM) + 1*SQL(1*Quad CPU, 8GB RAM)”.
    • “2*BTS (2*Quad CPU.  8GB RAM) + 2*SQL(2*Quad CPU, 16GB RAM)”.
  3. The user selects the environment which most resembles his/her own.
  4. The user then starts the Indigo Service, a console application hosting a service which will be called from the BizTalk Send port.
  5. As the user clicks “Run test”, the tool continues to start ports and orchestrations. It will also start the Perfmon collector sets if the user has chosen to create those.
  6. As the test proceeds the user can monitor the counter values through the gauges (CPU utilization, Received msgs/sec and Processed msgs/sec). The default test duration is 30 minutes, with a warm-up of 2 minutes.
  7. Finally, the user is presented a result, which is either Succeeded or Failed.  

image 

Related articles:

Benchmark your BizTalk Server (Part 2)

Benchmark your BizTalk Server (Part 3) by Ewan Fairweather

If you pass the test, you can proudly submit your result to the the High Score list. “E.W.N” seams to be the one to beat…

Filed under: , , ,
Developing custom tools for BizTalk
14 December 09 12:10 PM | wmmihaa | 4 comment(s)

For the last four months I’ve been developing a benchmarking tool for BizTalk which is going to be released soon. However, I thought I’d share some of the pain you might run into while developing custom tooling for BizTalk.

The problem lies with communicating with BizTalk, where you’re pretty much left with two options; Microsoft.BizTalk.ExplorerOM (EOM) or WMI. First of all, each option is suitable for different purposes. If you want to manage ports and applications, ExplorerOM would be your best bet, where as if you’d like to manage hosts, host instances or handlers, WMI would be your only option.

The problem I ran into, is that neither one of these works if you are not running this from a BizTalk Server, which in some cases is not preferred.

The problem occurs where the user tries to start a port from the custom application and therefore needs to commit using the SaveChanges operation (EOM). In the worst scenario, the user is running the app from a server/desktop where BizTalk is not installed. BizTalk and SQL are installed on separate boxes.

Using EOM won’t work as it throws an “Object reference not set to an instance of an object” exception (see code below). This is because EOM require BizTalk to be installed on the same box, even though it doesn’t necessarily need to be part of the group you’re trying to connect to.   

 

static void Main(string[] args)
{
    Console.WriteLine("Server name?");
    string server = Console.ReadLine();

    BtsCatalogExplorer explorer = new BtsCatalogExplorer();
    explorer.ConnectionString = new SqlConnectionStringBuilder()
    {
        DataSource = server,
        InitialCatalog = "BizTalkMgmtDb",
        IntegratedSecurity = true
    }.ConnectionString;

    Console.WriteLine("Connected..."); // This works!

    try
    {
        explorer.SaveChanges(); // This fails!
        Console.WriteLine("SaveChanges were executed without exceptions.");
    }
    catch (Exception ex)
    {
        Console.WriteLine("An error occurd...");
        Console.WriteLine(ex.Message);
    }
    Console.WriteLine("\nPress any key to close...");
    Console.ReadKey();
}

 

Using WMI won’t work because of the  “double-hop authentication issue”, where credentials will be lost on the second jump (to SQL). This will result in a “Anonymous user does not have access …blah blah blah” – SQL exception. http://www.microsoft.com/technet/scriptcenter/resources/wmifaq.mspx#EXLAC

clip_image001

I’d really like to see the product team to ship BizTalk with a Management Application, exposing services for the most common tasks.

Filed under: , ,
Finally!!!
03 November 09 07:42 PM | wmmihaa | 2 comment(s)

Eventually the videos from Richard Seroters sessions at the Swedish BizTalk User Group has been published on Channel9. I’ve been contacted by many of people, wanting to know when they where going to be published. We’re sorry for the delay, and hope we can publish upcoming events much faster.

Richards event has been one of the most popular ones we’ve had so far with over 100 attendees, and we are really happy to finally share this with the rest of the community.

Thank you Richard (and sorry for the delay)

Topic: BizTalk Server, SOA and the Shift to the Cloud

Session 1:

In this session Richard talks about the continued relevance of SOA and how to apply SOA principles when designing and exposing services from BizTalk Server.

http://channel9.msdn.com/posts/MSCOMSWE/BizTalk-Server-SOA-and-the-Shift-to-the-Cloud-12/  

Session 2: This session shows how to exploit SOA principles when consuming existing services. Richard also also shows how BizTalk can directly engage cloud offerings from the leading vendors.

http://channel9.msdn.com/posts/MSCOMSWE/BizTalk-Server-SOA-and-the-Shift-to-the-Cloud-22/

Richard Seroter is a solutions architect for an industry-leading biotechnology company, a Microsoft MVP for BizTalk Server, and a Microsoft Connected Technology Advisor. He has spent the majority of his career consulting with customers as they planned and implemented their enterprise software solutions. Richard worked first for two global IT consulting firms, which gave him exposure to a diverse range of industries, technologies, and business challenges. Richard then joined Microsoft as a SOA/BPM technology specialist where his sole objective was to educate and collaborate with customers as they considered, designed, and architected BizTalk solutions. One of those customers liked him enough to bring him onboard full time as an architect after they committed to using BizTalk Server as their enterprise service bus. Once the BizTalk environment was successfully established, Richard transitioned into a solutions architect role where he now helps identify enterprise best practices and applies good architectural principles to a wide set of IT initiatives.

Richard maintains a semi-popular blog of his exploits, pitfalls, and musings with BizTalk Server, SOA and enterprise architecture at http://seroter.wordpress.com.

Filed under: , , ,
Does everyone need to be the one that chooses?
13 October 09 01:45 PM | wmmihaa | 4 comment(s)

Johan Lindfors and Patrik Löwendahl did a duoblog titled “Everybody wants choices but nobody wants to make a choice” where they wrote about the growing opinion that software development and .net framework is getting to complex. It was later commented by Johan Hedberg among others.

It’s a very relevant issue, as many of us struggle to convince other developers and organizations to embrace new technology. But even though I agree with most of what’s been said, there is one part I strongly disagree with:

Patrik Löwendahl wrote:

“..developers seem to not understand the basics of the job requirements. As a software developer, my job always include constant learning and constant improvement of my skills. If I can’t agree with that I am a bad developer. This is not the tool vendors fault, this is because business change, improve and learn as well. If we don’t do that with them, we will be left behind.”

Only a tiny fraction of the worlds software is currently being built, some is being re-factored but the overwhelming majority is in “maintenance mode”. Of course this allocation is also reflected among developers, as many are working with already existing applications, adding new features, fixing bugs etc.

Naturally, these developers grow more focus and understanding of business requirements rather than the evolvement of the underlying technique. This is only natural as transition from already established standards such as Visual Source Safe, ODBC and ASMX, will not be prioritized in comparison with new features and capabilities of an already working system.  

One could argue that if they don’t keep up with the latest technology, their system will eventually become unmanageable. When key resources find better (and more interesting jobs), they will face a challenge finding anyone willing to take the job. But if this is the reason for adapting to the latest technology, it’s not the technology in it self they will benefit from, but the access to “good developers”.

As Johan pointed out, this is a problem for the management. –Sure there are bad developers, but focusing on the business needs and prioritizing your family and friends does not make you one!

If I’d call for the janitor to come and help me with a problem in my apartment, I’d rather see the a person with years of experience from my building than an outsider with a cool tool belt. The knowledge about every pipe in the building, will impress me more then the DeWalt DC927KLV in his hand.

Everyone who knows me, knows that the last comment is a lie. I would drool over the DC927, in fact begging to try it out. But the point is, my passion for technology (and power tools), does not necessary make me a good developer, for the same reason the employee with a deep understanding of the business is not necessary a “bad developer”.

It’s all about being the right person for the job, eager to solve the business need. Sometimes, and especially in new projects, the passionate developer is essential to make life easier for the ones making sure it will evolve with the change of the business. 

Filed under:
Search ALL tables query
06 October 09 10:53 PM | wmmihaa | 4 comment(s)

Ever needed to scan the entire database for a specific value? I ran into problem twice in one week, so I put some thought into it, and hopefully it will help someone else.

DECLARE @wordToSearchFor varchar(50)
SET @wordToSearchFor = 'BizTalk Application Users' -- The word you search for

DECLARE @query varchar(500)
DECLARE SearchAll CURSOR FOR 
SELECT 'IF(SELECT COUNT(*) FROM [' + TABLE_SCHEMA + '].[' + TABLE_NAME
+ '] WHERE ['+COLUMN_NAME+'] = '''+@wordToSearchFor+''')>0
BEGIN SELECT * FROM [' + TABLE_SCHEMA + '].[' + TABLE_NAME
+ '] WHERE ['+COLUMN_NAME+'] = '''+@wordToSearchFor+'''
PRINT ''[' + TABLE_SCHEMA + '].[' + TABLE_NAME + ']'' END'
FROM INFORMATION_SCHEMA.COLUMNS
WHERE DATA_TYPE LIKE '%CHAR'

OPEN SearchAll
FETCH NEXT FROM SearchAll INTO @query
WHILE @@FETCH_STATUS = 0
BEGIN
    EXEC (@query)
    FETCH NEXT FROM SearchAll INTO @query
END
CLOSE SearchAll
DEALLOCATE SearchAll

Hope this helps

Interview Series: Four Questions With … Richard Seroter
11 August 09 06:30 PM | wmmihaa | 1 comment(s)

I’m sure you have all followed Richard Seroters interview series where he chat with different experts in the Connected Systems space and find out their thoughts on technology. The turn has FINALLY come to Richard himself, to reveal his experiences with technology.

To tribute his just-released book SOA Patterns with BizTalk Server 2009 and mark his upcoming sessions at the Swedish BizTalk User Group, I’m honored to be the one to publish the “Four Questions” with its original author.

This is the 13th post in the series:

Interview Series: Four Questions With … Kent Weare
Interview Series: Four Questions With … Mick Badran
Interview Series: Four Questions With … Charles Young
Interview Series: FIVE Questions With … Ofer Ashkenazi
Interview Series: Four Questions With … Ewan Fairweather
Interview Series: Four Questions With … Jesus Rodriguez
Interview Series: Four Questions With … Stephen Thomas
Interview Series: Four Questions With … Jon Flanders
Interview Series: Four Questions With … Yossi Dahan
Interview Series: Four Questions With … Matt Milner
Interview Series: Four Questions With … Alan Smith
Interview Series: Four Questions With … Tomas Restrepo

Q: As you pointed out in your book, Reusability and Discoverability are perhaps the most important principles of SOA. How do you put that in relation to Runtime Governance, an area you didn’t cover too much in your book? Is there a pragmatic approach for organizations getting more and more service orientated, without having to invest in software like SOA Software or AmberPoint?

A: Governance is a critical part of any sustained effort to maintain a service oriented commitment within an organization. The best part is, you don’t need to buy any fancy software to start down this path. Not to say that great software suites can’t help you, but as has been mentioned to death, you don’t “buy” SOA: you do it. All the software in the world can’t help you if you can’t get the organizational shift to happen.

What shift is that? Some examples …

· It’s getting teams to think outside their project scope when designing services. While you don’t want to get bogged down solving the world’s problems every time you build a service, you CAN make a reasonable effort to look at your existing IT landscape and identify whether you are offering a new capability that others may be interested in. If you are offering something new and useful, then you need to design and decompose the service in such a way that it can stand alone and has no embedded dependencies on a given project.

· It’s about looking into existing service registries (UDDI, Excel spreadsheets, whatever) for services already in the company portfolio and seriously considering reuse instead of rebuilding your own redundant capability.

· It’s thinking about a service lifecycle and realizing that we’re not done with a service once it moves to production. There need to be processes and proactive behavior around versioning, maintenance, service level agreements and onboarding new users.

So “doing SOA” doesn’t have to be some giant effort to start with. It’s perfectly acceptable for it to be a bottom up approach where a set of projects exhibit service oriented behavior and allow these principles to organically spread across an enterprise. Now, at some point you’ll need enterprise investments in a more formal registry, or to build broad strategic services, but those issues don’t have to be solved by each project team.

Q: You have written several articles about ESB Toolkit (aka ESB Guidance); what is your take on “itinerary processing”? Is it useful, and if so in what scenarios?

A: It’s funny (or maybe sad), but I have yet to fully drink the Itinerary Kool-Aid. I like it, I can see use cases, but I need something else to get over the hump and believe that it’s the right fit for many of my day-to-day scenarios.

What are a few use cases I see as applicable?

· Any messaging process that has a dependency on runtime endpoint resolution is a good candidate. The Toolkit does this pretty well. Instead of trying to bake this into a custom orchestration, I can model a flow that relies on a wide range of lookup repositories (UDDI, Xpath, BRE, etc) to discover where to send my message.

· Subtle processing differences for each vendor message coming into the same receive port. It’s pretty cool that I can use the BRE to choose an itinerary to attach to an inbound message. This way, I could have the same receive port accept messages from a wide range of publishers, and based on some rule-based criteria (message type, content, context), I can attach, at runtime, a particular set of processing instructions. With the late introduction of the “Broker Service’ capability, you can also now inject a bit of routing logic within an itinerary itself. This way, you can start a given itinerary and allow branching paths based on message content or context.

· If you have a wide range of artifacts in the BizTalk environment (send ports, maps, etc) and are at a maturity level where you are capable of composing brand new processing flows from existing resources (e.g. mashups), then the Toolkit’s itinerary processing could be compelling. Need to daisy-chain a call between services where the result of one becomes the input to another? If the necessary maps and send ports already exist, you could build this process in 5 minutes. Want to do a scatter-gather where you call a bunch of endpoints and return a resulting blob of data? You can reuse existing endpoint and mash this together quite quickly. If you have a need for service composition and have lots of existing services to choose from, then modeling message itineraries can be a cool way to quickly leverage those services.

Introducing Itineraries to BizTalk Server is all about seeing BizTalk as a set of services that can be composed independent of the BizTalk tooling itself. It’s a fairly powerful way to build loosely coupled messaging solutions and gives architects a higher perspective on the processing model than is currently available with the standard BizTalk tools. With itineraries, I can model message receipt through a countless series of steps.

I don’t know, maybe I just talked myself into being a bigger fan ;)

Q: Low latency, has for a long time been on top of the wish list for many BizTalk developers. Given that Dublin is on its way, is Low latency still as important for BizTalk?

A: I often think of latency in one of two ways: response latency for synchronous callers, and expectations for how long it takes from asynchronous receipt of a message until insertion in a destination system.

For the former, low latency is related to how long a caller has to wait for a response. Whether we have Dublin available or not, some services will go through the BizTalk bus when there are system integrations that only BizTalk can do, or a set of services (pipeline processing, mapping) that are best fits for a BizTalk service. This type of low latency is still critical to achieve as you have someone (or something) sitting somewhere, probably blocked until a response is received, waiting for you. So, in this situation, I’d definitely like to see more options come out of Redmond for doing low latency in BizTalk Server. For services that can be satisfied with a straight WCF/WF implementation, then Dublin looks to be an excellent choice for synchronous callers.

The other aspect of latency (how much time from A to B), is in my experience, often constrained by the destination system itself. If I can process 1,000 messages per second through BizTalk Server, this still means that my destination system has to keep up. If I have a Line of Business application that chokes on that kind of load, then it really doesn’t matter how fine-tuned BizTalk is. So, this simply means that when you get a requirement for a tiny latency between receipt and distribution of a message, make sure to evaluate the destination system(s) and their ability to take the abuse of a high volume publisher. If we assume that we have a system with no limits as to simultaneous and aggressive load, then a WCF/WF service hosted in Dublin may at times be my most efficient solution. However, if I need to leverage the pub-sub pattern and have a diverse range of subscribers, then BizTalk is the right fit. So once again, for the situation where we need enterprise messaging capabilities and our downstream system can handle has much as we can throw at it, we need BizTalk to be even more capable of low latency delivery.

Q [stupid question]: Being a true Seinfeld fan, name one quality you share with each of the cast members of show (don’t forget Newman).

A: I love the fact that we both share a passion for this show about nothing. I knew you were “good people.” Without a doubt, this show had some of the greatest individual characters in TV history. I’m like these characters in the following ways:

· Jerry – I'm fairly obsessive about order and cleanliness and often "break even" where things usually work out for me.

· George – I like to pretend that I'm an architect (http://www.youtube.com/watch?v=2ZVs7oAHVjg).

· Elaine – I don't like people who sidle up to me, and, am not much of a dancer (http://www.youtube.com/watch?v=5xi4O1yi6b0).

· Kramer – Not a big fan of clowns and can enjoy the occasional cigar.

· Newman – I have a dark/evil/mischievous side that usually comes out in pranks or sarcasm.

· David Puddy – I’m a fanatical sports fan for the teams I follow. My day or week is absolutely ruined when my team disappoints me. I am however, NOT a face painter.

· The Soup Nazi – I have limited patience for those who can’t follow instructions. This is why I’d last roughly 17 seconds as a kindergarten teacher.

Thank you Richard, looking forward to see you in Stockholm on the 16th of September.

Filed under: ,
MGrammar – Tokenizing
08 August 09 09:52 PM | wmmihaa | 1 comment(s)

I’m currently working on an EDI grammar, I came across some unexpected behavior upon tokenizing the input.

UNA:+.? '
UNB+UNOC:3+123456789:ZZ+987654321:ZZ+090804:0758+491944'
UNH+464009+APERAK:D:07B:UN:2.0b'
BGM+313+464009'
DTM+137:200908040758:203'
RFF+ACE:100048193285'
DTM+171:200908040606:203'
NAD+MS+123456789::ZZ'
NAD+MR+987654321::ZZ'
ERC+Z06'
FTX+ABO+++9904383000003'
RFF+ACE:100048193285'
UNT+11+464009'
UNZ+1+491944'

The above sample is an APERAK message. I won’t go into any details about the structure other then that there are a number of Segments such as (UNH, BGM, DTM etc). Each segment is separated by “’”. Every segment has elements separated by “+”, which in turn can have a number of component data elements separated by “:”. Some of the elements are optional and some are mandatory.

My problem occurred when elements are optional. Have a look at the sample grammar below:

syntax Main =   a:A? del? b:B? del? c:C? =>{A=>a,B=>b,C=>c} ;
token del = ","; 
token A = ("A".."Z" | "a".."z" | "0".."9")+;
token B = ("A".."Z" | "a".."z" | "0".."9")+;
token C = ("A".."Z" | "a".."z" | "0".."9")+;

The syntax above states that there are three tokens (A, B and C), and they are all optional.

Given the input: a,b,c the output will be:

{
  A => "a",
  B => "b",
  C => "c"
}

However, given the input of only a,b the output comes out:

{
  A => null,
  B => "a",
  C => "b"
}

This was somewhat unexpected for me. I would have expected the tokens to be filled from the left, leaving the “C” element empty. To solve this you need to complement the syntax with all possible combinations:

syntax Main =   a:A del b:B del c:C? =>{A=>a,B=>b,C=>c}
                    | a:A del? b:B?=>{A=>a,B=>b}
                    | a:A=>{A=>a} ;

Which gives the following output:

{
  A => "a",
  B => "b"
}

image

Filed under: ,
bLogical SFTP Adapter – New Release
03 August 09 10:53 PM | wmmihaa | 4 comment(s)

The adapter has been stable for quite a while, with +3 000 downloads, great reviews, and one of the most popular BizTalk related downloads on CodePlex. On popular demand, we’ve now added support for SSO Affiliate Application, along with some minor fixes.

We also got feed-back from Kent Weare among others, where the lack of organized support has been a factor for not using the adapter. In relation to this, Logica is going to offer extended support for those in need. This offer is going to be available late August 2009.

We will of course continue to be active answering questions on the CodePlex forum.  

As I’m still on vacation, I haven’t been able to test the new version as much as I would have liked to. Because of this, I haven’t promoted the release to be default just yet. Please submit feed-back!!!

Get the 1.3.3 version here.

Filed under: , ,
Richard Seroter coming to BizTalk User Group Sweden!
25 July 09 10:47 AM | wmmihaa | with no comments

Open your calendar and mark the 16th of September!

I think most people know who Richard Seroter is. Even if you don’t follow blogs on a regular basis, I’m sure you’ve come across his articles from time to time. I know Richard as a very smart guy with a great sense humor, and we’re very happy to finally get him to Stockholm.

Richard is the author of the recently released "SOA Patterns for BizTalk Server 2009" book (Packt Publishing) which takes a look at how to apply good SOA principles to a wide variety of BizTalk scenarios. He is also the technical reviewer of the upcoming “Pro BizTalk Server 2009” book from Apress.

Read Johan Hedberg’s review here.

BTW, before the event I plan to post a “Four Questions With…Richard Seroter”!

Topic: BizTalk Server, SOA and the Shift to the Cloud

Session 1: In this session we will discuss the continued relevance of SOA and how to apply SOA principles when designing and exposing services from BizTalk Server.

Session 2: This session shows how to exploit SOA principles when consuming existing services. We will also see how BizTalk can directly engage cloud offerings from the leading vendors.

Richard Seroter is a solutions architect for an industry-leading biotechnology company, a Microsoft MVP for BizTalk Server, and a Microsoft Connected Technology Advisor. He has spent the majority of his career consulting with customers as they planned and implemented their enterprise software solutions. Richard worked first for two global IT consulting firms, which gave him exposure to a diverse range of industries, technologies, and business challenges. Richard then joined Microsoft as a SOA/BPM technology specialist where his sole objective was to educate and collaborate with customers as they considered, designed, and architected BizTalk solutions. One of those customers liked him enough to bring him onboard full time as an architect after they committed to using BizTalk Server as their enterprise service bus. Once the BizTalk environment was successfully established, Richard transitioned into a solutions architect role where he now helps identify enterprise best practices and applies good architectural principles to a wide set of IT initiatives.

Richard maintains a semi-popular blog of his exploits, pitfalls, and musings with BizTalk Server, SOA and enterprise architecture at http://seroter.wordpress.com.

The event will be officially announced on the user group site in the beginning of August.

bLogical SFTP Adapter – Planning for new release
25 July 09 10:12 AM | wmmihaa | with no comments

I’ve been doing some minor bug fixes to the adapter, and plan a new release after the summer. So far, the only new feature is support for SSO, as that has been requested many times. However, I’m eager to hear if there are other requests. If there are, I’ll do my best to squeeze them in.

If anyone has done any fixes of their own, PLEASE let me know!

Visit the SFTP adapter site on CodePlex

Filed under: , ,
How to use the Oslo Repository to store your Service configurations
07 July 09 11:45 AM | wmmihaa | 1 comment(s)

Most of the sample from Microsoft have so far been more about HOW to use “Oslo”, rather then WHY and WHEN. This has brought many developers to struggle about what to make out of “Oslo”, and how to put it in good use.

There are, however, several very interesting community posts about Oslo. But most of them are about M Grammar, and very few (I haven’t seen any) has been about the “Repository”.

M Grammar, is without a doubt a more “sexy” technique, as the Repository is nothing more than a SQL store for your models. – BUT I’m willing to bet that the Repository will play a very significant part in the future of any Microsoft technology. By writing this article, I hope to broaden your vision of how to use “Oslo”, and envision where Microsoft is going with the it.

Service Configuration => “Oslo” Repository;

image

A service host, hosts one or more services. It is created by a service host factory which, by default, loads all service configurations (bindings, services and behaviors) from one configuration file. The default factory is System.ServiceModel.Activation.ServiceHostFactory.

The samples in this post will show you how you could load the configurations for all your services from ONE “Oslo” Repository, rather than from many configuration files. As if all your services would share the same config file. 

image

The sample above would of course work for any number of web servers accessing the same Repository database.

To accomplish this we need:

  1. A “Oslo” model representing system.serviceModel. The January release of “Oslo” where shipped with the system.serviceModel model. However it was cut out in the May release, so I just created my own.
  2. A custom service host factory that loads Services and endpoints, along with all bindings and behaviors. I didn’t bother to make this to generic, so it only supports basicHttpBinding, wsHttpBinding, netTcpBinding and of course mexHttpBinding. 
- “So what?”

Actually, I think this is a pretty big deal. Having one single repository for all your services, means one single store for managing and configuring these services. - And what better tool to use than the “Oslo” Quadrant! 

image

Try it out:

  1. If you haven’t already installed the Oslo May CTP release, you can find it at the “Oslo” Developer Center.
  2. Download the zip file and open the  bLogical.ServiceModel.m file using “Intellipad”.
  3. In “Intellipad”, switch to “SQL-Preview” by using the “M mode” in the menu bar.
  4. Open SQL Management Studio, create a new query window and select the Repository database.
  5. Copy the T-Sql from “Intellipad”, paste it in to the query window and execute it. This will create all the Tables, and populate them with sample data.
  6. Open Visual Studio 2008, and create a new WCF Service by selecting “New Web site”. Don’t change the name of the service, as the samples created in step 5 assumes your service is called “Service”, and its interface is called IService. If you do want to change the name or use it for an already existing project, make sure to to do the changes in the repository.
  7. Add the bLogical.Oslo.ServiceHostFactory project to your solution. 
  8. Open your .svc file and add the bLogical service factory:

<%@ ServiceHost
    Language="C#"
    Debug="true"
    Service="Service"
    CodeBehind="~/App_Code/Service.cs"
    factory="bLogical.Oslo.ServiceHostFactory.ServiceHostFactory"
%>

Run the service!

HTH

Special thanks to Yossi Dahan, for encouraging me to do this article.

//Mikael

Filed under: , , ,
More Posts Next page »