Tuesday, October 04, 2005
Code Camp 4 presentations
Links and descriptions for my sessions...
Integration Technologies and Approaches
When it comes to integration, even within the Microsoft stack, there are several choices available: Web Services, Indigo, MSMQ, SQL Service Broker, Host Integration Server, BizTalk, SQL Server Integration Services and SQL Server Replication. This session will explain each option, cover the scenarios each one is suited for and some examples with source code. This session also serves as a good introduction to BizTalk Server and it's functionality.
Intro to AJAX (asynchronous javascript and xml)
What is it? How does outlook web access or Google maps provide functionality usually found in a desktop application? Material and code samples will cover the front-end (dhtml), back-end (asp.net/web services), tools/libraries to get you started (ajax.net) and what to expect down the road (Studio 2005 and Atlas). In addition, there will be discussion of issues to watch out for and general best practices.
Effective use of BizTalk as an Enterprise Integration platform
BizTalk can serve as the integration hub between multiple systems.
This session covers several EAI patterns and how they can be implemented in BizTalk. In addition, this session will also include some useful tips & tricks, examples of custom pipeline components & functoids in c#, and a quick overview of what to expect in BizTalk 2006.
All Session descriptions
Monday, September 26, 2005
BizTalk and MSDTC
Failed to execute SQL Statement. Please ensure that the supplied syntax is correct. An error occurred while enlisting in a distributed transaction
Transaction manager has disabled its support for remote/network transactions
I didn't have the error against my local SQL Server instance. It would happen when I tried it against the shared SQL Server machine the group used as a development sandbox.
I tried all of the steps mentioned at....
http://blogs.msdn.com/florinlazar/archive/2004/06/18/159127.aspx
and
http://support.microsoft.com/default.aspx?scid=kb;en-us;839187
and
http://support.microsoft.com/default.aspx?scid=kb;en-us;301600
and
http://cs.orange.us/blogs/thomas_mullaly/archive/2005/03/26/27.aspx
I eventually figured it was due to Windows XP SP2 and MSDTC and that SQL Server was not local. Looking into it a little more, I found this article from Microsoft....
How to troubleshoot MS DTC firewall issues
As mentioned in the article, I installed and used both the DTCPing tool and the DTCtester tool to identify the problem. I could DTC ping the server but the server could not DTC ping my laptop. For some reason, since my laptop was not a full member of the domain, the server had an invalid IP address for my laptop.
I fixed the issue by adding my laptop to the server's host file (c:\windows\system32\drivers\etc\hosts) with my correct IP address.
Again, this was only required in the development environment, and only because of the unusual situation my laptop was in (I'm a consultant and my laptop is not part of the domain and moves between many different networks).
More on DTCPing...
http://blogs.msdn.com/florinlazar/archive/2005/09/16/469064.aspx
and general MSDTC debugging...
http://www.chriskempster.com/articles/debugdtcissues.htm
Friday, March 18, 2005
Optimizing BizTalk for latency
BizTalk is optimized for throughput, not latency, by default. If you have low volume and want to speed up processing of individual messages, the following settings have helped one of my clients improve how long it took to run a message through BizTalk from several seconds to under a second:
· To decrease HTTP request-response latency, define a DWORD registry key named HttpBatchSize and set the value to 1. Create this registry key in the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\BTSSvc.3.0\HttpReceive folder.
This setting specifies the batch size that the HTTP receive adapter uses to submit requests to BizTalk Server. Ordinarily, the HTTP receive adapter waits to accumulate multiple messages to submit at once. It submits messages to BizTalk Server when the maximum batch size is reached, or at the preset waiting time periods. Setting the HttpBatchSize value to 1 causes the HTTP receive adapter to submit messages as soon as they are received.
· To decrease end-to-end latency, reduce the MaxReceiveInterval value in the adm_ServiceClass table of the BizTalkMgmtDb database from the default value of 500 to a value less than 100 (or any positive integer) for the following service classes:
· XLANG/s
· Messaging In-Process
· Messaging Isolated
These settings specify the maximum polling interval (in milliseconds) at which the messaging agent polls the message box. Microsoft does not support the direct modification of these values; you must use the tool at http://go.microsoft.com/fwlink/?linkid=30076
The tool mentioned in the 2nd bullet item only lets you decrease the MaxReceiveInterval to 100. To decrease it to 50, you will need to run the following SQL command:
use BizTalkMgmtDBReading the information above, you might wonder why this wasn't set this way from the beginning. I found a web page where Scott Woodgate says...
go
update adm_serviceclass set maxreceiveInterval = 50 where id IN (1,2,3,4)
go
so it seems the default settings are configured to process batches of messages, not blazing fast responses to single messagesTuning for Low Latency
It is possible to get sub-second transactions. BizTalk is built for throughput and not latency. At 50-60% CPU utilization, latency goes through the roof. If you can aim for 30-50% CPU utilization you can still attain low-latency.
The MaxReceiveInterval setting controls the latency of each message and HttpBatchSize can be set to 1 to guarantee each message gets processed as it comes in. Lastly, PollingInterval can set to 50-100ms to force frequent polling of the message box to achieve low latency.
Wednesday, March 16, 2005
Code Camp 3 Presentation
Topic of my session...
Using the Microsoft Patterns & Practices Enterprise Library
The just released Enterprise Library from the Patterns & Practices group at Microsoft provides assistance in many facets of enterprise class applications - security, logging, caching, error handling, cryptography and data access. This session covers the benefits of using these application blocks, how to incorporate them in your development practices and what can be learned from them even if they are not applicable to your project.
If you attended and have any questions on the topic, fee free to email me personally and I'll try to answer all questions here. In the meantime, I'm going to be posting some quickstart tutorials on this site soon.
Thursday, March 03, 2005
Be careful about server names (avoid underscores)
Helping out an old friend and former co-worker, we ran into an issue where he was unable to save anything in session state between requests in ASP.NET.
Well, we eventually figured out the issue - his server had an underscore in the name....
http://support.microsoft.com/default.aspx?scid=kb;EN-US;316112
PRB: Session Variables Do Not Persist Between Requests After You Install Internet Explorer Security Patch MS01-055
After you install security patch MS01-055 for Microsoft Internet Explorer 5.5 or 6.0, you may encounter the following problems:Note These problems can also occur after you install a more recent patch that includes the fix that is provided in security patch MS01-055.
• Session variables are lost. • Session state is not maintained between requests. • Cookies are not set on the client system. CAUSE
Security patch MS01-055 prevents servers with improper name syntax from setting cookies names. Domains that use cookies must use only alphanumeric characters ("-" or ".") in the domain name and the server name. Internet Explorer blocks cookies from a server if the server name contains other characters, such as an underscore character ("_").
Because ASP session state and session variables rely on cookies to function, ASP cannot maintain session state between requests if cookies cannot be set on the client.
This issue can also be caused by an incorrect name syntax in a host header.
For now, he is going to use cookieless=true session state to get around this issue until the servername can be changed.
Wednesday, February 09, 2005
How to tell if sp1 for BizTalk 2004 has been installed already
From what I've been able to determine, the quickest way is to fire up regedit and check if the following key exists. If it does, then sp1 has been installed.
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\BizTalk Server\3.0\SP1
Tallan Press Release - Evolution Benefits
http://biz.yahoo.com/bw/050209/95077_1.html
Evolution Benefits addresses the main problem I have with Flexible Spending Accounts (FSA) - how to get reimbursed. Right now, the process involves paying twice (through payroll deduction and again at point-of-service), saving and submitting receipts, completing and mailing claim forms, waiting for reimbursement and cashing checks.
This is done by providing a debit card that deducts from your FSA or HSA account whenever you need to make a copay or deductible/coinsurance payment.
Monday, February 07, 2005
Hiding and showing rows in IE and Mozilla/FireFox
One issue that a web developer may run into is how to toggle hiding/showing a row in an HTML table using JavaScript that works in both sets of browsers: Internet Explorer and Mozilla/FireFox/Netscape. In IE, you can set the style.display to "none" for the row, but this doesn't work in Mozilla.
One approach that woks in both browsers is to dynamically assign the class for the row using the following css styles:
<style>
.hide {display: none;}
.show {display: table-row;}
</style>
And here is the entire html for a test page that demonstrates using this approach....
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Hiding tables rows in IE and Mozilla!</title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
<style>
.hide {display: none;}
.show {display: table-row;}
</style>
<script>
var myBody;
function start() {
// get a list of all the body elements (there will only be one)
myDocumentElements=document.getElementsByTagName("body");
// the body element itself is the first item of the list
myBody=myDocumentElements.item(0);
}
function hideRow() {
mytable=myBody.getElementsByTagName("table").item(0);
mytablebody=mytable.getElementsByTagName("tbody").item(0);
myrow=mytablebody.getElementsByTagName("tr").item(0);
myrow.className="hide";
}
function showRow() {
mytable=myBody.getElementsByTagName("table").item(0);
mytablebody=mytable.getElementsByTagName("tbody").item(0);
myrow=mytablebody.getElementsByTagName("tr").item(0);
myrow.className="show";
}
</script>
</head>
<body onload="start()">
<P>Hiding tables rows in IE and Mozilla!</P>
<TABLE border="5" ID="Table1" >
<tbody>
<tr >
<td >cell is row 0 column 0 </td>
<td >cell is row 0 column 1 </td>
</tr>
<tr >
<td >cell is row 1 column 0 </td>
<td >cell is row 1 column 1 </td>
</tr>
</tbody>
</TABLE>
<BR>
<INPUT id="cmdHide" type="button" value="Hide Table Row" name="cmdHide" onclick="hideRow()">
<INPUT id="cmdShow" type="button" value="Show Table Row" name="cmdShow" onclick="showRow()">
</body>
</html>
Monday, January 31, 2005
Working with the primitive data types in BizTalk expression editor
So you might define variables such as: myString as string and myNum as integer. You cna do the following:
myString = "123";
myNum = System.Int32.Parse(myString);
but you cannot do the following:
myString = myNum.toString();
You can work around this by using the static methods available...
// format as a 11 digit padded number.
myString = System.String.Format("{0:00000000000}", myNum);
What is also unusual is that DateTime and Timespan doesn't have this restriction, so the following is allowed.
TransDate = System.DateTime.Now;
TimeStamp = TransDate.ToString("yyyy-MM-dd-HH.mm.ss.ffffff");
This post from Charles Yound explains how XLANG/s differs from C# in other ways...
http://geekswithblogs.net/cyoung/articles/3820.aspx
Friday, January 21, 2005
How to send SOAP headers in BizTalk
Here are the steps to set SOAP headers in a web service request using BizTalk Server 2004 (BTS).
1. Make sure your web reference in your BTS project is up to date.
2. Open the Reference.xsd for the wsdl of the web service. Look for the name of the root node for their Soap Header. Here is the example I'm using...
<soap:Header>
<AuthenticationHeader xmlns="http://www.acme.com/WebService/">
<strUserName>string</UserName>
<strPassword>string</Password>
</AuthenticationHeader>
</soap:Header>
3. Copy the name. Close the file.
4. Create a new item for the BTS project. Select "Property Schema" NOT the regular schema.
- In the properties for <schema>,
Change the target NameSpace to http://schemas.microsoft.com/BizTalk/2003/SOAPHeader
- In the properties for the root node,
Rename the root node the same as the one is step 2 ("AuthenticationHeader")
Change the Property Schema Base drop-down to "MessageContextPropertyBase"
5. Save the file as "SoapHeader.xsd" and Close the file. (Update: It doesn't matter what the name is as long as the TYPE NAME property of the xsd file is not the same as the root node name. Otherwise, you'll run into a compilation error)
6. Go to your orchestration. There should be a Construct Message shape that creates the web service request. There should be a shape inside of it - either a Transform or a Message Assignment.
If it is a Transform, add a Message Assignment below that in the SAME Construct Message shape.
If it is a Message Assignment, do nothing as we will reuse the existing one.
7. Edit the Message Assignment from step 6 and add the following as one line....
SampleWS_Request_Msg(MyBizTalkProject.AuthenticationHeader) =
"<ns0:AuthenticationHeader xmlns:ns0=\"http://www.acme.com/WebService/\">
<ns0:UserName>MyName</ns0:UserName>
<ns0:Password>NotSoSecretPassword</ns0:Password>
</ns0:AuthenticationHeader>";
Where
- "SampleWS_Request_Msg" is the message variable name in the Orchestration for the external web service.
- "MyBizTalkProject" is your project name
- "AuthenticationHeader" is the name of the property schema
Note: Once you type the message name and the first parentheses "SampleWS_Request_Msg(" an intellisense drop-down list appears and the property schema you are looking for should appear.
Note 2: There is another option to use an existing SOAP header from another message, but I had to use this approach as the incoming message was a Flat File.
Note 3: If you are using SOAP over standard HTTP, please keep in mind that the above message contents (including SOAP Header) can be clearly viewed by others monitoring internet traffic. I don't advocate this as a security measure - but since this is not my web service, I have to play along.
Wednesday, January 19, 2005
Don't use "transaction" as the name of your root node in an XML schema
This is the type of error to expect in BizTalk...
MyOrchestration.odx(92,52):
error X2254: unexpected keyword: 'transaction'
error X2011: expected 'identifier'
error X2016: unexpected token: '.'
error X2157: '': a part of a non-method messagetype must be of class type
See this msdn article for all of the XLANG/s reserved keywords...
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sdk/htm/ebiz_prog_orch_nozn.asp
This also led to me figuring out what that language is that BizTalk uses in the expression editor...
Comparing XLANG/s and C#
Tuesday, January 18, 2005
BizTalk - AssemblyName context property was not valid
Here is one particular error
AssemblyName context property was not valid
or
Microsoft.XLANGs.Core.XlangSoapException: An error occurred while processing
the message, refer to the details section for more information
at Microsoft.BizTalk.XLANGs.BTXEngine.BTXPortBase.VerifyTransport(Envelope env, Int32 operationId, Context ctx) at
Microsoft.XLANGs.Core.Subscription.Receive(Segment s, Context ctx, Envelope&
env, Boolean topOnly) at Microsoft.XLANGs.Core.PortBase.GetMessageId(Subscription subscription, Segment currentSegment, Context cxt, Envelope& env, CachedObject
location) at SCE_FlatFileTest.SCE_flatfile.segment1(StopConditions stopOn)
at Microsoft.XLANGs.Core.SegmentScheduler.RunASegment(Segment s, StopConditions stopCond, Exception& exp)Microsoft.XLANGs.Core.XlangSoapExceptionScoped@SCE_flatfile.SCE_flatfile2dfdb796-dafc-4e08-af1d-683128013b6f
This happened in one of Orchestrations that was trying to submit a request/response message to a web service. I added the web reference already and all schemas matched correctly. What was going on?
Well, the port I specified for the web service had the wrong port type. When I created the port I elected to create a NEW port type instead of selecting an existing one - the one that is automatically created when you add a web service. Doh!!!
Once I made that change, the above errors went away.