Screencast: Configuring WCF Services with Endpoints

Screencast: Configuring WCF Services with Endpoints

As Cliff mentioned, the second installment in the WCF/WF Developer Screencast Series just went live.

This one is called Configuring WCF Services with Endpoints. In this screencast, I build on the service I showed you how to create last week and show you to configure it with different endpoints — you'll learn about addresses, bindings, and contracts — and you'll see how to use the WCF Service Configuration Editor to create/modify different endpoint configurations.

Ch9-SC-002_6

Previous Screencasts (RSS for all posts in the series)

Screencast: Creating your First WCF Service

Screencast: Creating your First WCF Service

I announced earlier this week that we've joined forces with the WCF/WF teams at Microsoft to produce a weekly screencast on ramping-up with these .NET 3.0 technologies. This is the first installment in the series, entitled Creating your First WCF Service in Visual Studio 2008.

This short video guides you through how to create your first WCF Service from scratch in VS2008 – defining a data contract, a service contract, and testing/hosting the service using the new built-in WCF tools found in VS2008.

EndpointScreenCastCreatingFirstWcfServiceVS2008_large_ch9_3

Note: I want each of these screencasts to have a unique URI, hence the separate post. Apologies if you've already seen this clip.

SerializationException while calling .net classes from Orchestration!

Recently, one of my colleagues had a weird error while trying to invoke a webservice from his orchestration.Even though i was not really peeping over his shoulder, i guess he was trying to call .netservice/class from orchestration within a scope. He assured methat he marked all his .netclassesas Serializable. However, he was getting the following […]

Event Log Monitor

I’ve created a nice little tool I’m using more and more. As a BizTalk Administrator, I’m constantly needing to ensure nothing is going wrong on my servers. I need an alert process that could email me if/when there is a problem. I’ve created an event log monitoring tool that will email me depending on the search criteria I specify. I’ve included a feature that allows me to create multiple emails depending on the exact error. I use this quite a lot if a specific user needs to only know about their particular error.

The program is a single executable.

It is executed via the command prompt and takes the following parameters, which can be in any order.

-TOEMAIL: = ToEmail (Required) Can include multiple To Email addresses.
-FROMEMAIL: = FromEmail (Required)
-SMTPSERVER: = SmtpServer (Required)
-NUMBEROFDAYS: = Number of Days to look back (Optional) if not set to today’s data
-NUMBEROFHOURS: = Number of Hours to look back (Optional) if not set will use -NUMBEROFDAYS
/n = Send Email if there are no events (Optional)
/e = Send Errors (Optional)
/w = Send Warnings (Optional)
/i = Send Information (Optional)
-EVENTSOURCE: = Event Source (Optional) Can include none or multiple Event Sources to include in the search
-EVENTCATEGORY: = Event Category (Optional) Can include none or multiple Event Categories to include in the search
-EVENTMESSAGESEARCHSTRING: = Event Message Search String (Optional) Can include none or multiple Event Message Strings to include in the search

I usually set up a batch file that is run on the Windows Scheduler and sends me an email every night for the previous day’s information.

For example, I have the following event log:

I would like to receive an email for all the Events of Type Errors in the “BizTalk Server 2006” Category over the last 5 days. I would execute the following command at the command prompt:

“Generic Event Log Emailer.exe” -TOEMAIL:[email protected] -FROMEMAIL:[email protected] -SMTPSERVER:yoursmtpserver.com

-NUMBEROFDAYS:5 “-EVENTCATEGORY:BizTalk Server 2006” /e

Alternatively, I would just create a batch file with that string and schedule it to execute every 5 hours.

I then get an email every 5 hours with all the information I’m looking for.

Don’t forget that you can also search using the -EVENTMESSAGESEARCHSTRING: parameter. Using this parameter, you can really narrow down your search to specific messages.

Here are my list of planned upgrades:

1. Add regular expressions to the -EVENTMESSAGESEARCHSTRING: parameter

2. Add -EXCLUDE parameters to allow you to exclude Source, Categories, or Messages instead of only including.

3. Add the other Event Logs besides the Application Event Log.

4. Create a real time monitoring tool that would push errors to you as they happen instead of pulling them at certain intervals.

If you have any other features you’d like to see in this product, please email me.

More Information on Processing MSMQ Messages in FIFO Order

In two of my previous posts  I talked about processing MSMQ messages in FIFO order with WCF.


The way that WCF, along with the MSMQ binding, works there could be a couple of situations in which messages may actually not process in FIFO order. 


The most prevalent is a rollback.  When a message is rolled back the process is asynchronous and thus end up not only having that message take time to get back to the head of the queue but may also lead to messages being processed while the rolled back message is in flight. 


However, not all is lost.  By adding the changes below you can further ensure that you can make WCF behave like a pure System.Messaging coded system and still get your messages in FIFO order.


So, add


<transactedBatching maxBatchSize=”1″/>


as an endpoint behavior and setting


ReleaseServiceInstanceOnTransactionComplete = false


on the Service Behavior (along with the InstanceContextMode and the ConcurrencyMode)