Welcome

You have reached the blog of Keith Elder. Thank you for visiting! Feel free to click the twitter icon to the right and follow me on twitter.

Mono Less Than One Year Later

Posted by Keith Elder | Posted in .Net, Open Source | Posted on 01-03-2008

0

Last April I did a real world test with Mono which is an open source project to run .Net applications on various platforms by Miquel de Icaza.  I took an enterprise application that was built from scratch in .Net 2.0 and analyzed the application.  There were 1878 methods within the application that were missing.  Let’s see how far Mono has come using the same application.

Review From Last April

There is an easy tool available to test .Net applications if they are compatible with Mono.  It is called the Mono Migration Analyzer (MoMA).  Using MoMA last year yielded these results.

Methods that are still missing in Mono: 1878
P/Invokes called : 10
Methods called that throw NotImplementedException: 168
Methods called marked with [MonoTodo]: 831
Version:  1.1.1

There is no doubt with these many methods missing the application is not Mono ready.  Let’s re-run these tests on the same application to check the progress.

Same Application Different Results

The same application less than a year later shows tremendous progress.  Keep in mind I didn’t use the exact same version of the application, I used the latest version from source control of the application.  There have been thousands of lines of code added to the application since last April.  Even with constant change the results today fair very well.  Here is the same screen.

image

Methods that are still missing in Mono: 181
P/Invokes called : 10
Methods called that throw NotImplementedException: 159
Methods called marked with [MonoTodo]: 108
Version:  1.2.6

Very promising indeed.

Other Mono Happenings

DreamSpark – Fantastic Idea But Only The First Step

Posted by Keith Elder | Posted in .Net, Smart Clients, SQL Server, Windows, XBOX 360 | Posted on 27-02-2008

5

When I was in high school one of my math teachers took it upon himself to teach a few students about computer programming.  It wasn’t a real class it was just something he put together during our free period.  Instead of attending study hall we’d go to this computer programming class.  Basically other students in the school called the few of us taking the class the “Star Trek” club.  Honestly I didn’t watch Star Trek and never have.  It just never interested me.  I know that I just lost thousands of geek points by stating I am not a Star Trek fan publicly but when you grow up on a small farm in Mississippi things need fed, watered, and slopped.  Coming home from school and sitting down to vegetate to watch TV wasn’t in the cards of our household.  Anyway, I digress.  Even though Mr. Foley didn’t have a lot of support from the school in putting together this class, it was the one thing that really got me hooked on computers.  Mr. Foley was only one man though.  It takes a much larger effort to get students interested in technology.  To hook the next generation of students on programming Bill Gates recently announced DreamSpark.  It is a new project that will provide thousands of dollars of free software to students.  Students like me who didn’t have access to the tools companies were using while they learned can now install and leverage the same products for free.   As an educator I’m really excited to see this announcement.   Here are some thoughts as to why I think this is important and what should spark within the community.

What is DreamSpark?

DreamSpark is simple, it’s all about giving students Microsoft professional-level developer and design tools at no charge so you can chase your dreams and create the next big breakthrough in technology – or just get a head start on your career.

DreamSpark makes the following software available to students who register on the site.   The program is available in 11 countries giving millions of students access to professional developer tools.

image

All a student needs is a computer to get started.  They can load Windows Server 2003 onto the machine along with Visual Studio 2008, SQL Server 2005 and Expression Studio and have the same tools we are using today in enterprises across America.  If the student wants to build games for Windows or the XBox then they can install XNA Game Studio.  The amount of things that can be built with these technologies is amazing, especially when you think about WPF Windows Applications and Silverlight.

Ok students, Bill has done his part to give you the software.  What are you going to do with it now?  Someone has to replace a lot of the Elder generation as we age.  Even right now there is a huge demand for developers that know these technologies.  Here are some numbers from the popular online job engines.

Searching for .Net

  • Dice.Com – 11,131 jobs available
  • Monster.Com – Over 5,000 (max return value)
  • CareerBuilder.Com – 3,376

Searching for SQL Server

  • Dice.Com – 14,588
  • Monster.Com – Over 5,000 (max return value)
  • CareerBuilder.Com – 8357

Searching for Windows

  • Dice.Com – 15,480
  • Monster.Com – Over 5,000 (max return value)
  • CareerBuilder.Com – 16,933

Positives About DreamSpark

I Couldn’t Even Buy A Vowel

As I said earlier, the DreamSpark program is a great idea I just wish it was around when I was younger.  When I was in college I was still doing off to the side programming while pursuing my music degree.  I knew there were tools, IDEs, databases and other things that people in large companies used but I was broke.  I was financially embarrassed as my father used to say.  I was so broke I couldn’t even afford to buy a vowel on Wheel of Fortune.  The only option I really had was to learn open source tools.  Back then the open source tools were, well, hard.  There weren’t web pages full of documentation, books, and fancy editors.  You basically first had to learn the VI editor and then try to dig through the man pages and the source code.  To say the experience was painful would honestly be an understatement.  It was slow going.  The sad fact today is that a lot of students are in the same boat I was back then.  DreamSpark fills this gap and puts the latest technology in the student’s reach.  This is wonderful, I can’t express that enough. 

Challenges DreamSpark Faces

It is important that students be offered the opportunity to learn the tools we are using today but the sad fact is only a few will take advantage of it without the community getting in behind this effort.  If 1% of the students downloaded these tools, I would consider that a success.  A perfect benchmark to go against is every student enrolled in a Computer Science program and every student in high school taking computer programing.  If 100% of those students download and use the software then that is a perfect world. 

In order to achieve this goal, it is going to take a lot of effort from those of us in the community.  The following is an open letter to Microsoft, the community and educators who can effect change and help create the next generation of programmers.

Give It Away And They’ll Come

The first thing we must overcome is thinking free equals a lot of use.  Some have heard the line before “Build it, and they will come.”.  The reality is just because something is free doesn’t mean anyone will use it.  If this were the case, we wouldn’t need ads, marketing departments, or ad agencies.  This is the first thing we need to do, spread the word.

Ask yourself this question.  How many students will seriously go download this software?  How many of them will actually learn about it?  There are numbers in the industry I’ve heard repeated of the 5% geek rule.  The premise is take 100 computer science students and only 5% of them are truly dedicated to their profession.   This top 5% are the ones that will more than likely take advantage of DreamSpark, the rest will never know.

We (Microsoft, the community, and educators) need to make a concerted effort to spread the word about DreamSpark.   We need to establish DreamSpark Day events at schools and Universities in our local areas and get this information out.  By information I am not just talking about the bits, that isn’t enough. 

How Long Will It Take?

Here is a pondering question.  How long will it take the education institutions to realize they have thousands of dollars of software available they can build an entire curriculum around?  Unless a concerted effort is made the answer is years.  Why?  Well for starters very few of the professors know the technology.  Sad but true.  When I say “few”, I mean a very small percent. 

There are a few professors out there that are teaching .Net.  Those educators should have no problem, but the majority of professors I’ve encountered love to tell you how their first computer was the size of a house and how they punched cards to program it.  What really saddens me is the “dinosaur” professors as I like to call them are still doing things the way they have for years.  Thankfully this isn’t every professor out there, but there are professors at colleges that still rest on their laurels and just learn enough to teach out of a book.  The majority of these professors have no real world experience in technology except in academia because they have spent their entire lives in academia.  I know these types of professors exist because I had several of these “dinosaur” teachers in college.  I used to call them the “Punchcardasaurus”. 

“Punchcardasaurus – A professor who loves to tell you about the stone age of computers but doesn’t know anything about today’s current technology.”

I can’t begin to tell you how much of a waste of time it is for someone like myself to have to sit through a lecture from a Punchcardasaurus only to correct him or her about how the Internet really works and the Mosaic browser is not really the Internet (true story).  I’m starting to digress but hopefully the point is driven home.  A concerted effort needs to be made at the institutions of learning.

Educational Institutions Already Have Free Software – Open Source

I firmly believe that higher educational institutions should focus more of their efforts putting students in a position to get a job and succeed.  Sadly the curriculum of colleges don’t.  Someone graduating from college today should have experience with all sorts of technologies and languages.  Colleges that just teach C++ are doing their students a grave injustice.  Students should learn C, C++, C#, Obj-C, Java, and a variety of other languages including dynamic languages.  Each of these should expose students to the various types of platforms such as Windows, Unix and OS X. 

The majority of colleges use a lot of open source software to teach their students today because, well, the software doesn’t cost the college nor the students anything.  If a college is just focusing on open source software, they are really doing their students a major disservice.  Students should be educated on both sides of the fence and taught multiple platforms.  In the end it is the students who should decide which platform they feel will be the most valuable to their career or interest, not the educational institution.  The more this is done, the more the students  know and the better chance they have at getting a job.  DreamSpark of course helps to fight the cost factor argument with open source software but it is going to take time for the value to sink in.  Especially in institutions where open source software has a very strong hold with a lot of zealots to play devils advocate.  Yes, these zealots exist, to ignore this fact would not prove wise.

Train The Trainer

The Punchcardasaurus and other professors need help.  It has to start with those teaching others.  Here is another sad but true fact.  Even if a school wanted to build a curriculum around DreamSpark who’d teach it?  If it was offered the odds of it being taught with real world business experience on the platform is very small.  We need to do something to train the current educators how to use these new tools.  There are a variety of ways this could be done.

  1. Use the current Microsoft training curriculum and certification courses to offer classes to faculty and staff.  Schools are off in the summer and it would be a great time for re-educating.
  2. Help the teachers by putting together a standardized curriculum around the DreamSpark project so there is consistency to how the platform is taught.

I personally would be more than willing to spend my time during the summer to put together a train the trainer workshop for those educators willing to participate.  This could be run at night so not to interfere with work duties. 

Already Lagging Behind

Another sad but true fact is educational institutions are years behind in terms of the technology being taught.  I know when I was in college this was true.  For example the language called Java was started in 1991 and released in 1994/1995.   While this was a newly released technology it wouldn’t be taught in the classroom until many years later.  Back then they were teaching us Pascal.  The progression worked something like this.  Once you mastered Pascal, which at the time was already considered a dead language, you could learn C, and then after that C++ and if you stayed around to get your PhD they’d eventually mention Java as an experimental language.  Basic skills are an absolute must have but what chance does a student have at actually getting a job today in a company that uses a technology like .Net where the student has never used it?  Very few companies have a need for engineers that are highly skilled in assembly and compilers.  However, a company would be willing to hire someone who knows how to write applications using Windows Presentation Foundation, Silverlight, Windows Communication Foundation and Workflow Foundation.  All of which have been released in the last year.  I truly feel sorry for students graduating today because the industry changes so quickly.  They need our help.

What Can We Do To Help

There are a lot of challenges that need to be overcome no doubt.  All of them are challenges, not road blocks though.  They can be fixed.  To restate some of the ideas above here are the things we (Microsoft, the community, educators) need to start with.

  1. The Community / Microsoft – Organize some type of event at educational institutions to help spread the word.
  2. The Community / Microsoft – Help train the current educators.
  3. Microsoft – Help the educators standardize a curriculum using existing training information, labs, etc.
  4. Microsoft – Put together a program whereby students build something using the tools and award them with free trips to TechEd or Mix or other conferences.

 

Geek Dinner with Sara Ford in Hattiesburg Feb 4th

Posted by Keith Elder | Posted in .Net, Friends, Speaking | Posted on 22-01-2008

13

image Monday February 4th, 2008, we will be having a geek dinner in Hattiesburg, Ms with special guest Sara Ford from Microsoft.  Sara is the Program Manager for Codeplex.Com which serves as a hosting ground for open source projects.  Sara is originally from Mississippi so we are glad to have her back in the area and taking time out of her traveling schedule to join us.   Living in Seattle she doesn’t get to come back home often so this is a very special occasion to have her be able to join us.  Sara has already blogged about the dinner (she beat me to it) and I know she is excited to join us.  The following information should help to answer any and all questions.  If I fail to cover all the bases either add a comment or send me an email via the contact link on the site. 

When

Date: February 4th, 2008
Time: 7:00 PM

Where

Chesterfield’s Restaurant – Chesterfield’s is a staple restaurant in Hattiesburg that serves great food along with great service.  For those at the University without transportation it is conveniently located within walking distance at the intersection of Hardy and Hwy 49.   

Directions

Driving from:

the north (via I-59 S)
the south (via I-59 N)
the east (via US-98 W)
the west (via US-49 E / SR-42)

Who Can Attend?

The short answer is anyone that considers themselves a technologist or a geek.  Doug Turnure, Microsoft Developer Evangelist for Mississippi, and Chad Brooks, Microsoft Architect Evangelist for Mississippi, will also be joining us.  Doug and Chad know there stuff and can answer all types of questions and are great contacts to have.  We also aren’t discriminating based on location so if you are from Alabama, Louisiana or nearby states in driving distance of Hattiesburg feel free to join us.

What If I’m an Open Source Person, Can I Still Go?

Absolutely!  Sara would love to talk to you more than the rest of since it is her job to stay in touch with the open source community!  Remember that a geek dinner isn’t about a division of interest; it is about talking to the community, learning, and building long lasting friendships.  Don’t worry; you will not be the only open source person there.  I’m also a carrying card member as is Sara.

What is a Geek Dinner?

Although there is no official definition a geek dinner is a time for technologist, enthusiasts, developers, architects and others in the community to gather and talk about technology.  That’s it, plain and simple.  It doesn’t mean you are part of a sacred group or cult, it just means you were hungry on a Monday night, needed some place to eat and there were a bunch of people that like technology like yourself eating at this one place so you decided to join them.

How Do I RSVP?

Easy.  Just add a comment to this blog entry or send an email using the contact link on the site stating your intentions of attending and I’ll start to gather a head count from that.

Who Pays For Dinner?

Since there is a 2008 launch event during the day in Jackson, Ms, Microsoft has graciously agreed to sponsor part or all of the dinner depending on the number of attendees.  Note: Not all geek dinners are sponsored so this is really appreciated!

Received RSVPs

If your name appears in the following list I have received your RSVP.  If not, please re-send.

Sara Ford – Microsoft Program Manager for http://codeplex.com
Me – Quicken Loans
Shane Walters – Singletree Technologies
Doug Turnure – Microsoft
Chad Brooks – Microsoft
John Weathersby, Jr. – Open Source Software Institute Executive Director
Wayne Walters – Assistant Professor, USM, School of Computing
Stan Burton – President & CEO, Burton Computer
Sean Brace – Systems Engineer, Howard Industries
Jean Gourd – Visiting Assistant Professor, USM, School of Computing
Keith Parish – Software Engineer
Ryan Duclos – Program Director for LANUG, Proficient Consultant
Shara Walters – Singletree Technologies
Bill Booth – Pan American Life
Tim Hampton – Student
Aubrey Cote – Forte Online

UPDATE 1/25/2008 10:12 AM

There was a previous problem submitting comments as well as through the contact page in Internet Explorer.  This explains why people that emailed said they couldn’t post comments.  Sorry, this is now fixed.  In the mean time search for the site is disabled.  I will get it back on soon.

Exposing a WCF Service With Multiple Bindings and Endpoints

Posted by Keith Elder | Posted in .Net, WCF | Posted on 17-01-2008

52

Windows Communication Foundation (henceforth abbreviated as WCF) supports multiple bindings that allows developers to expose their services in a variety of ways.  What this means is a developer can create a service once and then expose it to support net.tcp:// or http:// and various versions of http:// (Soap1.1, Soap1.2, WS*, JSON, etc).  This can be useful if a service crosses boundaries between intranet and extranet applications for example.  This article walks through the steps to configure a service to support multiple bindings with Visual Studio 2008 and the .Net 3.5 framework.  For those that want to jump directly to the sample solution it can be found at the end of this article.

Setting Up The Test Solution

Below you will find the steps used to create the sample solution.  I’ll explain a few WCF concepts along the way but probably not all of them.  I will however link to relevant documentation where applicable.  To get started, within Visual Studio 2008 create a new WCF Service Application project.  This template can be found within the web section of Visual Studio 2008 as seen here.

image

After the project is initialized modify it so it contains four files, note this will require deleting the default files:  IMyService.cs, Service.cs, Service.svc, and Web.Config.  Once you have cleaned up the default template, it should look like this:

image

Creating Our Service Contract
The IMyService.cs file will contain our service contract.   In old ASMX services, in order to expose a method as a service one would attribute the method with the attribute of [WebMethod].  In WCF, everything is tied to a Service Contract.   By defining our service contract as an interface, any class that implements that interface can be exposed as a WCF service.  In order to achieve this a ServiceContract attribute will be placed on the interface and an OperationContract attribute will be placed on the method we want to expose for our service.  Our interface is going to be simple and will just contain one method to add two numbers.  Here is the sample.

[ServiceContract(Namespace="http://keithelder.net/Learn/WCF")]

    public interface IMyService

    {

        [OperationContract]

        int AddTwoNumbers(int x, int y);

    }

Implementing The Contract
The Service.cs file will contain the implementation of the IMyService interface.  Again, since we defined our contract as an interface our service class doesn’t need or have any attributes on it.  Here is the code:

    public class Service : IMyService
{
public int AddTwoNumbers(int x, int y)
{
return x + y;
}
}

Creating The Service Host
The file Service.svc will provide the endpoint for our URL that will be exposed by IIS.   Within this file, we only need one line which identifies the class that contains our service using the ServiceHost directive.  Here is the code for this file.

<%@ ServiceHost Language="C#" Debug="true" Service="WcfService1.Service" CodeBehind="Service.cs" %>

Now that we have the contract specified and implemented along with an endpoint to host the service everything from here on out is just configuration.  This is the beauty of WCF.   How we want the service to be exposed is stored within the web.config file.  There a lot of options in WCF and those just learning WCF are typically overwhelmed at the amount of options.  Luckily Microsoft has a tool to help us along.  The upside to this approach is we do not have to code how our service is secured as we did in older ASMX services.

Setting Up Basic Http Binding

Before we add multiple bindings to our single service, let’s focus on adding one binding.  In order to configure our service we are going to use the Microsoft Service Configuration Editor.  This editor allows us to configure our WCF service and can be launched right from Visual Studio.  To launch the editor, right click on the web.config file.  An option should be in the menu that says “Edit WCF Configuration”.  If it doesn’t don’t worry, sometimes, Visual Studio doesn’t pickup this option.  A trick is to go to the tools menu in Visual Studio and select the editor from there.  After the editor is launched it will then show up in the menu when you right click the web.config file.

For this example I have removed everything from the web.config file before launching so I can configure the service completely from scratch.  Opening the web.config with the editor shows a blank configuration as follows.

image

Follow the steps to initialize the configuration.

Step 1
Make sure your solution builds.

Step 2
Click “Create a New Service” in the right panel of the editor.

Step 3
Browse to the bin directory and select the WcfService1.dll (if the file doesn’t show up, go back to step 1)

image

Double click this file and select your service implementation.

image

Step 4
The service type should be displayed on the previous screen.  Press Next->.

Step 5
Select the contract.  This should automatically be selected to WcfService1.IMyService.  Press Next->.

Step 6
Since we are using IIS to host our service select the HTTP option for the communication mode.

image 

Step 7
Select the basic web services interoperability.  We’ll come back later on and add advance web services interoperability.

image

Step 8
Delete the “http://” from the address field.  Since we are developing we don’t know which port this will get assigned as of yet.
image

Press Next->.  A dialog will appear.  Select Yes.

image

Press Finish on the next screen.

At this point we have an almost configured service.  If you drill down into the Services folder within the tool down to the end point the configuration should look something like this.

image

Step 9
Let’s clean up our configuration.  In the screen shot above in the configuration section.  Give this endpoint a name of “Basic”.  This will let us know later on this endpoint is our BasicHttpBinding configuration which supports the SOAP1.1 protocol.

Step 10
Click on the “Services” folder in the editor.

image

Step 11
Next to the binding configuration there is a link that says “Click to Create”.  Click this link to create a binding configuration.  While this isn’t necessary in all instances it is a good practice to have a binding configuration.  This gives you more control over how your binding is configured and is a good practice to initialize early on.

Clicking this link will create a new binding.  In the name field under the configuration section, give it a name of “Basic”.  The defaults for this example are fine.

image

Note:  Clicking on the Security tab in the above screen the Mode should be set to None. 

At this point you should be able to save your configuration and press F5 in Visual Studio to launch your service in debug mode.  You should be presented with a web page that looks like the following:

image

Exposing Our Service’s WSDL

Unlike previous ASMX services, the WSDL (web service definition language) for WCF services is not automatically generated.  The previous image even tells us that “Metadata publishing for this service is currently disabled.”.  This is because we haven’t configured our service to expose any meta data about it.  To expose a WSDL for a service we need to configure our service to provide meta information.  Note:  The mexHttpBinding is also used to share meta information about a service.  While the name isn’t very “gump” it stands for Meta Data Exchange.  To get started configuring the service to expose the WSDL follow the following steps.

Step 1
Under the Advanced folder in the editor, select the “Service Behaviors”.

image

Click the “New Service Behavior Configuration” link in the right pane.

Step 2
Name the behavior “ServiceBehavior”.  In the bottom section press the add button and select the “serviceMetaData” option and press Add.

image

The end result should look like the following.

image

Step 3
Under the “Service Behaviors” folder, select the newly created “ServiceBehavior” option and then the “serviceMetadata” option underneath that.  In the right pane change the HttpGetEnabled to True.

image

Step 4
Select the service under the Services folder and apply the new service behavior to the service.

image

Step 5
Save the configuration and reload the service in the browser.  The page should be changed to the following:

image

Clicking on the link should display the WSDL for the service.

At this point our service is configured to support the SOAP1.1 protocol through the BasicHttpBinding and is also exposing the WSDL for the service. What if we want to also expose the service with the SOAP1.2 protocol and support secure and non-secure messages?  No problem.  We can expose the service all of those ways without touching any code only the configuration.

Adding More Bindings and Endpoints To Our Service

Now that we have the basic binding working let’s expose two additional endpoints for our service which support the WS* protocol but are configured differently.  We’ll expose a plain SOAP1.2 protocol message using the wsHttpBinding that is a plain message as well as a secured message using the wsHttpBinding.

Step 1
Under the Services folder select the EndPoints folder for the service and add a new service endpoint.  Give it a name of WsPlain.  This endpoint will serve as a standard SOAP1.2 message that isn’t encrypted.  Change the binding to wsHttpBinding.  In the address field, copy the address from your browser.  In my case, my project used the address of http://localhost:5606/Service.svc.  Paste this into the address field and add /WsPlain to the end of it so it looks like the following:

http://localhost:5606/Service.svc/WsPlain 

Each binding for each endpoint has to have a separate address.  Doing it this way allows us to keep our one service file and offer it up in various configurations.  In the contract option browse to the DLL in the bin directory and select the contract used previously.  The end result should look similar to this:

image

Step 2
Just as we did previously, click on the Services folder and create a binding configuration for this endpoint.  Refer to step 10 and 11 above.

Provide a name of WsPlain for the new binding.  In the security tab change the mode to “None” and set all other options to false or none.  This is setting up our binding so there is no security on our message.  By default the binding is configured to be secure.

image

The final settings for the WsPlain endpoint should be similar to this.

image

Step 3
To configure a secure binding using wsHttpBinding follow these same steps above but leave the default values in the security tab of the binding configuration.  Call this end point and binding WsSecured.  The new endpoint should look like this:

image

That’s it, our service is now configured three different ways and is configured to support SOAP1.1, SOAP1.2 and WS*.  Pretty cool huh?

Testing Our Service

Now that our service is configured with three different bindings, let’s look at the messages as they go back and forth across the wire.  In order to do this we are going to borrow knowledge from a previous article I did called “How to Get Around WCF’s Lack of a Preview Web Page and Viewing WCF Messages“.  From this article we are going to borrow the MessageViewerInspector class and build a small windows application to view our messages.

If you are still following along, add a new project of type Windows Application to the existing solution and then copy the MessageViewerInspector class from the referenced article and add it to the project.

If you have been following along you may have noticed that we only have one WSDL.  The WSDL contains all of our endpoints.  Even though we have three endpoints, we still only have one WSDL.  In testing with some third party clients my experience has been that clients only generate proxies for the endpoints they understand.  Add a service reference to the service to the windows application.

For the user interface I decided to use several split panels and create a three panel layout.  Here is what it looks like.

image

The idea is simple.  When I click on each button I want it to invoke my service and then display the request and response messages the service is using.  To do this I created one service method called CallService which is passed the end point name the service is to invoke.

        private void CallService(string endPoint)
{
MessageViewerInspector inspector = new MessageViewerInspector();

ServiceReference1.MyServiceClient proxy = new WindowsFormsApplication1.ServiceReference1.MyServiceClient(endPoint);

proxy.Endpoint.Behaviors.Add(inspector);
proxy.AddTwoNumbers(12332, 12323);
proxy.Close();

richTextBox1.Text = inspector.RequestMessage;
richTextBox2.Text = inspector.ResponseMessage;
}

The endpoint is the name of the endpoint we specified in our configuration.  For example to invoke the secure wsHttpBinding it is called like this.

CallService("WsSecured");

The first thing created is create the inspector so messages can be viewed coming in and out of the proxy class.  Once the proxy method is called we can then grab the messages and put them into the RichTextBox control on the form.  Here are screen shots of each call to the service.

BasicHttpBinding – SOAP1.1

image

WsHttpBinding – SOAP1.2 Plain / Unsecured

image

WsHttpBinding – SOAP1.2 Secured

image

Conclusion

WCF services are powerful as you have just seen.  It is possible to expose a single service in more ways than just one.  This allows developers to support things like net.tcp binary messages and SOAP messages from the same service.  If you are an enterprise developer supporting multiple clients this is a blessing since it means .Net consumers of your service can use TCP while other consumers use WS*.  The nice thing is the developer doesn’t have to code it, just declaratively express how he wants the service configured. 

Download Sample Solution:

Like this article? kick it on DotNetKicks.com

My Codemash Podcast Is Up!

Posted by Keith Elder | Posted in .Net, Smart Clients, Speaking | Posted on 15-01-2008

0

Chris Woodruff caught me at Codemash and we did a podcast together.  It was a very free flowing conversation.  We covered a lot of topics including my open source background, how I got started in .Net, Smart Clients vs Web Applications, WPF, music, the value of learning multiple languages and why Codemash is so unique.

You can grab the podcast here:

http://codemash.podbean.com/2008/01/15/codemash-2008-interview-with-keith-elder/

And you can also try playing the podcast below.


Powered by Podbean.com

By the way there are other podcasts from Dustin Campbell, Sara Ford and Michael Rozlog as well on the Codemash web site.