Thursday, June 14, 2007

Dallas BizTalk Users Group Meeting 6/14

This was my first time to the Dallas BizTalk Users Group meeting and it was pretty cool! There were obviously some interested, and talented, people involved. I'll definitely be putting time aside to make these events in the future!

Tim Rayburn was our host for this event. I'd heard the name, but had not ever realized that he was based right here out of Dallas!

Dustin Hicks [MSFT] presented a solution design review using the Decorator pattern in BizTalk messaging in a B2B scenario using RosettaNet and SAP. Dustin is a BizTalk TS in our region, and I've worked with him before as Mary Kay's BizTalk "connection". Great Microsoft person to know at Microsoft, and Thai (as in food) fiend.

Dustin also turned me onto Microsoft's ESB Guidance that shipped as a part of BizTalk 2006 R2 sample code. Previously, this was only available by invitation through http://connect.microsoft.com. This is now available through Codeplex at http://www.codeplex.com/esb. Hopefully we will see more support from Microsoft in this area going forward...the guys hinted that there might be a V2 on the horizon!


One thing that struck me during Dustin's presentation is that many, many developers refer to the Gang of Four [GoF], "Design Patterns: Elements of Reusable Object Oriented Software", as the pattern book. I've had my copy since 1997, when I joined a now defunct company, that had it on its required reading list. I have to admit...I never felt comfortable with patterns. Sure, I could recognize patterns by sight, and even unconsciously watched patterns emerge from my code, but I didn't feel in harmony with patterns until I read "Head First Design Patterns". That was the moment that I think I understood patterns. Even then, I won't claim to understand all patterns, there are only a few commonly used patterns that fall into that category for me.

The Head First Design Patterns book was fresh, new look at patterns, with practical examples that I could understand. I had lugged the GoF book around for years out of some sort of misplaced duty, for some reason. I still have both on my desk, but for a patterns book, its Head First all the way! Don't let the Java samples mislead you...they are clear and translate, almost line for line, to C#. Plus, the cover girl has some sort of weird hold on me that I can't seem to shake...

Be sure to come check it out next month...they are giving away some really good prizes!

Tuesday, June 12, 2007

Telnet in SilkPerformer

I've alluded to it previously, but I am brow deep in a volume testing effort around our new international Warehouse and Manufacturing software. While the software has a nice web UI, the primary method most users will use to interface with this software is through hand held RF devices. That means 80% of our automated scripts are emulating RF devices.

These devices will typically use the telnet protocol to 'talk' to a service that renders the UI to the device, accepts input, etc.

Early on, like 2003/2004, we spoke to our automated testing vendor about the need to support the telnet protocol. Needless to say, they supported tcpip out of the box, but not necessarily telnet.

Never fear, we wrote a wrapper library, around those tcpip functions and were able to accomplish our goal. Unfortunately, the vendor then turned around and added telnet 'application protocol' support to the next version of their software and wanted to charge us an upgrade fee (not part of regular maintenance) to have access to it, which I don't have budget for.

Its a great addition to the product and they've done a lot to it to add support beyond what our simple wrapper did. However, if your needs are pretty straight forward (ours are) you might be able to continue to get by with the simple library.

What you lose is the ability to 'record' a telnet conversation, but hey, I've not seen a telnet based application yet that you couldn't easily write down the necessary steps for.



/*
TelnetSendEx
hConnection - an existing, open, connection
strData - data we are sending
strPrompt - used for debugging only; visual cue of whats currently 'on screen'
strTokenList - delimited list of tokens to search response data for. RaiseError if unable to find this value.
strTimer - the timer to use; this is for measurement reporting.

returns the actual token that was found in the response buffer, or "" if not found.

*/
function TelnetSendEx (hConnection : number; strData : string; strPrompt : string; strTokenList : string; strTimer : string) : string
var

strToken : string;

begin


Print(strPrompt + ": " + strData);

MeasureStart(strTimer);

WebTcpipSend(hConnection, strData + WEB_CRLF);

// now receive data
//
strToken := TelnetReceiveEx(hConnection, strTokenList, ";");

MeasureStop(strTimer);

TelnetSendEx := strToken;


end TelnetSendEx;




/*
TelnetReceiveEx
hConnection - an existing, open connection.
strTokenList - delimited list of values to search the response data for
strDelimiter - the delimiter; e.g. ';'


returns the actual token found in the response buffer. It will return the first token it finds.
*/
function TelnetReceiveEx(hConnection : number; strTokenList : string; strDelimiter : string ) : string
var

strToken : string;
strData : string;
isFound : boolean;

begin

isFound := false;


strTokenList := strTokenList + ";Error;ERROR;
";

//Print("Token List: " + strTokenList);
//Print("Delimiter: " + strDelimiter);


WebTcpipRecvUntilIdle(hConnection, strData);

strToken := Strtok(strTokenList, strDelimiter);

while ( strToken <> "" )
do

Print("Searching for token: " + strToken);
Print(strData);

if ( StrSearch(strData, strToken, STR_SEARCH_FIRST) > 0 )
then

isFound := true;
Print("Found token: " + strToken);

exit;
end;


strToken := Strtok(NULL, strDelimiter);
end;


if ( isFound = false )
then
RaiseError(CUSTOM_MESSAGE, "Failed to find any tokens: " + strTokenList, SEVERITY_WARNING);
end;

TelnetReceiveEx := strToken;


end TelnetReceiveEx;






Sample calling the TelnetSendEx function.


TelnetSendEx(
hConnection, // the open connection
strItem, // data we are sending
"Enter Item Number", // current UI prompt (mainly for debugging)
"Enter Lot", // response text to validate for
"INV_3.25 Enter Item Number" // measurement name; used for reporting time
);



Sample checking for a specific response from TelnetSendEx:

strBuffer := TelnetSendEx(
hConnection, // connection
strLot, // data we are sending
"Enter Lot", // ui prompt
"Y/N;Number of Cases", // delimited list of values to check for
"INV_3.25 Enter Lot Number" // measurement name
);


if (stricmp(strBuffer, "Y/N") = 0)
then

// "Y/N" token found
//


end;

Building your own Contact Me form

You know, I never noticed that there wasn't a direct way to get in touch with me without drilling down into my profile, or following the 'LinkedIn' profile. It almost cost me an XBox!

Luckily, there is a quick and easy way to slap some HTML, along with a free service, and provide a quick 'Contact Me' page.

Blogosquare has a post on how to setup this up with Blogger in under 5 minutes! Thanks!

Contact Me










Monday, June 11, 2007

I won an XBox 360!

Wow! How lucky is that?? I mean, I've gone to the last TechEd and PDC and walked away with a dozen shirts that didn't fit and a bunch of (mainly) useless memorabilia.

This time, I couldn't even attend, but spotted the chance to win one over on Kirk Allens blog, followed a few directions, and viola! Instant XBox 360!

I don't own an XBox 360, mainly because I own 12 XBox's (thats another story), but now I don't have an excuse not to run out and buy a copy of Guitar Hero 2!

Thanks, Kirk!