<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Don Smith : Architecture</title><link>http://blogs.msdn.com/donsmith/archive/tags/Architecture/default.aspx</link><description>Tags: Architecture</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Using MessageContracts and DataContracts</title><link>http://blogs.msdn.com/donsmith/archive/2008/03/10/using-messagecontracts-and-datacontracts.aspx</link><pubDate>Tue, 11 Mar 2008 05:10:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8142209</guid><dc:creator>donsmith</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/donsmith/comments/8142209.aspx</comments><wfw:commentRss>http://blogs.msdn.com/donsmith/commentrss.aspx?PostID=8142209</wfw:commentRss><description>&lt;P&gt;Users of the &lt;A href="http://msdn.com/servicefactory" mce_href="http://msdn.com/servicefactory"&gt;Service Factory&lt;/A&gt; often ask about the rationale behind the required use of MessageContracts even though the use of MessageContracts aren't mandated by WCF. I've answered this question in other venues, but it seemed like a good thing to put here in case I need to point others to it in the future.&lt;/P&gt;
&lt;P&gt;If you ask the WCF product team when you should use a MessageContract versus a DataContract, their guidance usually revolves around the level of control you need over the message - like when you need to use custom SOAP headers*. You can find more detail in &lt;A href="http://msdn2.microsoft.com/en-us/library/ms730255.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/ms730255.aspx"&gt;this topic&lt;/A&gt; of the WCF documentation. Their guidance makes complete sense if you think about the motivation they had when building WCF: to unify all of the Microsoft communication mechanisms into a single approach that is relevant to all scenarios. This is great for someone who has traditionally only done object-oriented or component-oriented development. They can be successful without understanding the nuances of building Web services. &lt;/P&gt;
&lt;P&gt;In our experience one of the biggest hurdles for many developers who are new to Web services has been the concept of the &lt;STRONG&gt;message&lt;/STRONG&gt; - rather than just passing around types like they've always done. You can characterize this distinction as implicit versus explicit message design. We have a topic in the Service Factory documentation that touches on this distinction. I think there is some room for improvement on this topic, but you can find it &lt;A href="http://msdn2.microsoft.com/en-us/library/cc304802.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/cc304802.aspx"&gt;here&lt;/A&gt; nevertheless. &lt;/P&gt;
&lt;P&gt;However, the confusion over a message isn't the only reason we elevate the importance of the message and recommend these usage patterns. We intentionally draw a clear distinction between types (both primitive types like string, and complex types like Customer) and messages (like ProcessExpenseReportRequest). From our perspective, DataContracts represent types and types are reusable. Messages are not used as types but rather the payload a method operates on - and it is not reusable since they are specific to the operation they are passed to and from. This level of distinction provides architects and lead developers a means of achieving better consistency throughout their organization by being more prescriptive about reusability. &lt;/P&gt;
&lt;P&gt;I am aware that Juval's position is that MessageContracts are rarely needed. And, I hold Juval in the highest regard - I've not yet had an opportunity to learn what is motivating him to take this position. Some might argue that MessageContracts are just an additional (unnecessary) level of redirection. I can understand this point of view. We just feel the benefits greatly outweigh this nominal cost, and the feedback we've received from customers has been completely supportive of this approach. &lt;/P&gt;
&lt;P&gt;&lt;EM&gt;* In my opinion, there is only one reason you would need to create a custom SOAP header that isn't already defined by a standards body like WS-*. (hint: if it's already defined elsewhere, you should use it to ensure interoperability, instead of "rolling your own") And, that reason is if you need to pass around localization information (like "en-us"). I don't think this is covered by any WS-* or other spec.&lt;/EM&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8142209" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/donsmith/archive/tags/Web+Services/default.aspx">Web Services</category><category domain="http://blogs.msdn.com/donsmith/archive/tags/Architecture/default.aspx">Architecture</category><category domain="http://blogs.msdn.com/donsmith/archive/tags/Service+Factory/default.aspx">Service Factory</category><category domain="http://blogs.msdn.com/donsmith/archive/tags/Work+Related/default.aspx">Work Related</category></item><item><title>... come and get yer Service Factory!</title><link>http://blogs.msdn.com/donsmith/archive/2007/01/09/come-and-get-yer-service-factory.aspx</link><pubDate>Wed, 10 Jan 2007 07:30:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1442259</guid><dc:creator>donsmith</dc:creator><slash:comments>24</slash:comments><comments>http://blogs.msdn.com/donsmith/comments/1442259.aspx</comments><wfw:commentRss>http://blogs.msdn.com/donsmith/commentrss.aspx?PostID=1442259</wfw:commentRss><description>&lt;P&gt;That's right ladies and gentlemen, the December release of the Web Service Software Factory and a VB.NET version&amp;nbsp;is now available for your consumption, modification, and production pleasures :) &lt;/P&gt;
&lt;P&gt;Okay, I'm just going to do&amp;nbsp;3 things in this post since I know there will be many more to follow: &lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Lay some links on ya. For downloading the Service Factory releases and more info.&lt;/LI&gt;
&lt;LI&gt;Share my favorite new features of the Service Factory with you.&lt;/LI&gt;
&lt;LI&gt;Give you a sense of what is to come in the near and not-so-near future.&lt;/LI&gt;&lt;/OL&gt;
&lt;H4&gt;&lt;STRONG&gt;Links&lt;/STRONG&gt;&lt;/H4&gt;
&lt;UL&gt;
&lt;LI&gt;Service Factory&amp;nbsp;December release helps you build both WCF and ASMX services in C#. The old July release is no longer available since everything it contained is included in this release.&amp;nbsp;&lt;A title="Web Service Software Factory–December 2006 (ASP.NET and WCF services in C#)" href="http://www.microsoft.com/downloads/details.aspx?familyid=db996113-6e92-4894-9b7e-0debb614d72f &amp;amp;displaylang=en"&gt;&lt;STRONG&gt;&lt;FONT color=#006bad&gt;Web Service Software Factory–December 2006 (ASP.NET and WCF services in C#)&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;Service Factory July release that helps you build ASMX services in VB.NET. Yes, I know this is new and was actually published in December, but it is effectively the same exact version as the original July release - it's just been converted to VB.NET (that's why we're calling it the July release). If this is confusing, I apologize ... I'm to blame.&amp;nbsp;&lt;A title="Web Service Software Factory–July 2006 (ASP.NET services in VB.NET)" href="http://www.microsoft.com/downloads/details.aspx?familyid=7dda69a4-d404-4cc0-b1ad-a9856c3af646&amp;amp;displaylang=en"&gt;&lt;STRONG&gt;&lt;FONT color=#006bad&gt;Web Service Software Factory–July 2006 (ASP.NET services in VB.NET)&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;Service Factory information. If you're not sure what the Service Factory is and want to find out before downloading it, go to &lt;A href="http://msdn.com/servicefactory"&gt;&lt;STRONG&gt;&lt;FONT color=#006bad&gt;http://msdn.com/servicefactory&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/A&gt; to learn more about it.&lt;/LI&gt;&lt;/UL&gt;
&lt;H4&gt;Favs&lt;/H4&gt;
&lt;P&gt;&lt;STRONG&gt;WSDL-first support&lt;/STRONG&gt;. This feature definitely wasn't the most challenging to include, but I still love it. I've spent a lot of time over the years monkeying around with WSDL files. The fact that Service Factory has a single recipe (wizard) that will take a single WSDL and generate the service interface, service implementation, binding configuration (config file), and all of the associated DataContracts/XmlSerializable types is just freakin' sweet. You have to see it even if you don't define all your contracts in WSDL first.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Versioning guidance&lt;/STRONG&gt;. This is a favorite of mine because ... well, I wrote it haha. No, seriously ... it's no secret this is a topic that is near and dear to my heart. I have labeled the topic "emerging guidance" in the Service Factory documentation because I want to gather more evidence from customers that this approach is actually working for them before I propose&amp;nbsp;we call&amp;nbsp;it a&amp;nbsp;"proven practice". I have spoken with a number of customers who have taken this approach and it is working well for them. I haven't spoken to anyone it didn't work for, but I'd love to hear from you. If you're interested in reading or sharing, I've also posted the topic on my blog &lt;A title="Versioning Web Services" href="http://blogs.msdn.com/donsmith/pages/VersioningWebServices.aspx"&gt;&lt;STRONG&gt;&lt;FONT color=#006bad&gt;here&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/A&gt;. Personally, I think the "strategy" section of the guidance&amp;nbsp;is still weak on content, but more on that in the "futures" section of this post. I also plan to do a webcast on it.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;WCF Code analysis&lt;/STRONG&gt;. This one turned out to be the sleeper feature&amp;nbsp;- we didn't expect this to turn out so&amp;nbsp;sweet. As you may know, FxCop has been integrated into Visual Studio 2005 under the name &lt;EM&gt;Code Analysis&lt;/EM&gt;. Well, we took all of the same rules that used to be the Security Analyzer back in the WSE days and converted them all to code analysis rules. They also work against the code AND the config files (something FxCop hasn't done historically). I know, pretty sweet, huh? Well, when we showed this to the WCF team, they asked if we could include some of the rules that they fire at run-time so they could be run at design-time (like the ones that make sure all the binding stuff is consistent). "Sure", we said. So there are about a dozen of them too ... and it's all integrated into Visual Studio ... even if you're not using Service Factory.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Recipe runner&lt;/STRONG&gt;. Okay, now I'm cheating a little. This isn't actually a feature ... and it's not really included in Service Factory. One thing we learned while building the July release was that testing GAX recipes is feakin' hard. Well, harder than it should be. So the team took a couple of months at the beginning of this version to get it right. The result is something we call RecipeRunner. Those of you who are creating your own recipes or heavily modifying the ones we provide will really like this if you care about testing, which you should. We'll be making it available on the community site in the near future.&lt;/P&gt;
&lt;P&gt;There are loads more things that are new and way cool in this release, but I want you to discover some of them for yourself too. Of course I'll be mentioning them as time goes on and in some mini videos. Oh, that brings me to the last item on my agenda.&lt;/P&gt;
&lt;H4&gt;Futures&lt;/H4&gt;
&lt;P&gt;&lt;STRONG&gt;Blogcasts&lt;/STRONG&gt;. The very next things you're going to start seeing are more of the &lt;A href="http://blogs.msdn.com/donsmith/archive/2006/04.aspx"&gt;&lt;STRONG&gt;&lt;FONT color=#006bad&gt;blogcasts&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/A&gt; I did some months back. Many of them are outdated now and I need to do more of them now that&amp;nbsp;the WCF Service Factory&amp;nbsp;has released. The feedback was very positive (thank you) and because I claim to listen to you, I promise to&amp;nbsp;do more of them shortly.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;HOL exercises&lt;/STRONG&gt;. I've already began the process of converting the existing hands-on lab (HOL) to WCF. Additionally, we'll be adding a bunch of new exercises. What I need from you is some details so we're sure they are helpful. This is what we have in mind:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;STRONG&gt;Modifying a guidance package&lt;/STRONG&gt; - There is already a how-to in the Service Factory documentation, but customers are always telling me they need more help. If you tell me what kind of changes you're making to guidance packages I will try to create an exercise that illustrates how to make that change.&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;Building a service agent&lt;/STRONG&gt; - A service agent is that layer of code on the consumer side that invokes the proxy (that's right, you're NOT suppose to do it in the button's click event handler :). It manages things like retries, response caching, offline support, asynchronicity, etc. I need you to tell me what kind of challenges YOU (not your neighbor) need. That will help me get this exercise right.&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;Versioning&lt;/STRONG&gt; - this will build on the topic I mentioned earlier and will walk you through how to evolve a service in a number of ways.&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;Message validation&lt;/STRONG&gt; - The reference implementation already illustrates this. But would you find a HOL exercise valuable? If not, cool, I'll spend that energy somewhere else. If so, also cool.&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;Exception shielding&lt;/STRONG&gt; - The reference implementation also illustrates this. Same question ...&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;Create a code analysis rule&lt;/STRONG&gt; - I think this is also covered in the VS documentation, but I've never looked for it. Are you going to be writing your own rules? If so,&amp;nbsp;would you find a HOL exercise helpful?&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;Workflow Foundation&lt;/STRONG&gt; - we actually did a lot of work with this, but had to pull it at the last minute (yeah, sometimes cutting scope at the last minute hurts). We might be in a position to create an exercise as a result of what we already have. We'll see.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;STRONG&gt;v3 planning&lt;/STRONG&gt;. We have already began the planning process for v3. But because we JUST started, we don't have a lot to share just yet. I can tell you (if you didn't already guess) that a service&amp;nbsp;domain specific language (DSL) is the primary theme of the next version.&amp;nbsp;I will be sharing everything with you around the features and their priorities as soon as we have something to share. As always, we'll be&amp;nbsp;counting on you to steer us where you need us to go. All of this communication will naturally happen on the Service Factory community site, which will be moving to CodePlex in the very near future. More on that later too.&lt;/P&gt;
&lt;P&gt;Okay, it's getting late and the weather is getting nasty so I'm heading home. Until next time, you have a lot to keep you busy :D Looking forward to your feedback. Thanks!&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1442259" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/donsmith/archive/tags/Web+Services/default.aspx">Web Services</category><category domain="http://blogs.msdn.com/donsmith/archive/tags/Architecture/default.aspx">Architecture</category><category domain="http://blogs.msdn.com/donsmith/archive/tags/Service+Factory/default.aspx">Service Factory</category><category domain="http://blogs.msdn.com/donsmith/archive/tags/Work+Related/default.aspx">Work Related</category></item><item><title>Service Architecture Concept Model</title><link>http://blogs.msdn.com/donsmith/archive/2006/07/21/673481.aspx</link><pubDate>Fri, 21 Jul 2006 07:56:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:673481</guid><dc:creator>donsmith</dc:creator><slash:comments>9</slash:comments><comments>http://blogs.msdn.com/donsmith/comments/673481.aspx</comments><wfw:commentRss>http://blogs.msdn.com/donsmith/commentrss.aspx?PostID=673481</wfw:commentRss><description>&lt;P&gt;I'm posting this because I'm interested in your thoughts about it. &lt;/P&gt;
&lt;P&gt;&lt;A href="http://dev4net.members.winisp.net/images/conceptmodel.png" border="0"&gt;&lt;IMG alt="A Service Architecture Concept Model" src="http://dev4net.members.winisp.net/images/conceptmodel-sm.png" border=0&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;IMPORTANT: &lt;/STRONG&gt;This is just a&amp;nbsp;concept&amp;nbsp;illustration. I'm not encouraging anyone to accept and begin using the nomenclature used. &lt;/P&gt;
&lt;P&gt;This is just the result of a conversation &lt;A href="http://blogs.msdn.com/tomholl"&gt;Tom&lt;/A&gt; and&amp;nbsp;&lt;A href="http://blogs.msdn.com/edjez"&gt;Ed&lt;/A&gt;&amp;nbsp;and I had today about how &lt;A href="http://msdn.microsoft.com/practices/guidetype/Guides/default.aspx?pull=/library/en-us/dnbda/html/distapp.asp"&gt;this illustration &lt;/A&gt;might evolve. If something isn't clear, please leave a comment. If you've seen other illustrations or nomenclature about these things that better resonate with you, please leave a comment and tell me about them. If you have any other thoughts, ... I think you get the idea :)&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=673481" width="1" height="1"&gt;</description><enclosure url="http://dev4net.members.winisp.net/images/conceptmodel.png" length="42026" type="image/png" /><category domain="http://blogs.msdn.com/donsmith/archive/tags/Web+Services/default.aspx">Web Services</category><category domain="http://blogs.msdn.com/donsmith/archive/tags/Architecture/default.aspx">Architecture</category><category domain="http://blogs.msdn.com/donsmith/archive/tags/Work+Related/default.aspx">Work Related</category></item><item><title>Service Factory: Entity Translation</title><link>http://blogs.msdn.com/donsmith/archive/2006/04/28/586339.aspx</link><pubDate>Fri, 28 Apr 2006 23:41:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:586339</guid><dc:creator>donsmith</dc:creator><slash:comments>11</slash:comments><comments>http://blogs.msdn.com/donsmith/comments/586339.aspx</comments><wfw:commentRss>http://blogs.msdn.com/donsmith/commentrss.aspx?PostID=586339</wfw:commentRss><description>&lt;P&gt;For the third installment I've decided to talk about the entity translation (mapping) capability of the guidance package. Specifically, this is mapping between the entities that are [de]serialized to/from the wire representation and the entities that represent the business domain model. This time I used a high-quality mic (Shure) and better software (Camtasia Studio), but WMV is still the best output format for this delivery mechanism (MP4 isn't an option). I also tried 1024 x 768 instead of 800 x 600.&lt;/P&gt;
&lt;P&gt;File: &lt;A href="http://dev4net.members.winisp.net/blogcasts/ServiceFactory-Mapping.wmv"&gt;ServiceFactory-Mapping.wmv&lt;/A&gt;&lt;BR&gt;Length: 15:15&lt;BR&gt;Size: 5.93 MB &lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=586339" width="1" height="1"&gt;</description><enclosure url="http://dev4net.members.winisp.net/blogcasts/ServiceFactory-Mapping.wmv" length="6225447" type="video/x-ms-wmv" /><category domain="http://blogs.msdn.com/donsmith/archive/tags/Web+Services/default.aspx">Web Services</category><category domain="http://blogs.msdn.com/donsmith/archive/tags/Architecture/default.aspx">Architecture</category><category domain="http://blogs.msdn.com/donsmith/archive/tags/Service+Factory/default.aspx">Service Factory</category></item><item><title>Service Factory: Contracts</title><link>http://blogs.msdn.com/donsmith/archive/2006/04/20/579735.aspx</link><pubDate>Thu, 20 Apr 2006 11:54:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:579735</guid><dc:creator>donsmith</dc:creator><slash:comments>14</slash:comments><comments>http://blogs.msdn.com/donsmith/comments/579735.aspx</comments><wfw:commentRss>http://blogs.msdn.com/donsmith/commentrss.aspx?PostID=579735</wfw:commentRss><description>&lt;P&gt;Here's the second installment of my blogcast series on Service Factory. In this one I show how to create WCF data contracts and service contracts. It's a little bigger and longer than I would have preferred, but since I was building the project (a wine rating app) from scratch, I guess that's what took longer. &lt;/P&gt;
&lt;P&gt;File: &lt;A href="http://dev4net.members.winisp.net/blogcasts/ServiceFactory-Contracts.wmv"&gt;ServiceFactory-Contracts.wmv&lt;/A&gt;&lt;BR&gt;Length: 25:48&lt;BR&gt;Size: 8:51 MB&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=579735" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/donsmith/archive/tags/Web+Services/default.aspx">Web Services</category><category domain="http://blogs.msdn.com/donsmith/archive/tags/Architecture/default.aspx">Architecture</category><category domain="http://blogs.msdn.com/donsmith/archive/tags/Service+Factory/default.aspx">Service Factory</category></item><item><title>Service Factory: A Brief Introduction</title><link>http://blogs.msdn.com/donsmith/archive/2006/04/20/579686.aspx</link><pubDate>Thu, 20 Apr 2006 10:53:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:579686</guid><dc:creator>donsmith</dc:creator><slash:comments>9</slash:comments><comments>http://blogs.msdn.com/donsmith/comments/579686.aspx</comments><wfw:commentRss>http://blogs.msdn.com/donsmith/commentrss.aspx?PostID=579686</wfw:commentRss><description>&lt;P&gt;Here is the first installment of a series of blogcasts I hope to continue that are focused on the project I'm working on. This is just a quick 11 slide PowerPoint presentation that gives you the rationale and scope of the project. It's really the best place to start and it's only 15 minutes. Just ignore the cursor I forgot to move out of the way :)&lt;/P&gt;
&lt;P&gt;File: &lt;A href="http://dev4net.members.winisp.net/blogcasts/servicefactory-intro.wmv"&gt;ServiceFactory-Intro.wmv&lt;/A&gt;&lt;BR&gt;Length: 15:23&lt;BR&gt;Size: 2.14 MB&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=579686" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/donsmith/archive/tags/Web+Services/default.aspx">Web Services</category><category domain="http://blogs.msdn.com/donsmith/archive/tags/Architecture/default.aspx">Architecture</category><category domain="http://blogs.msdn.com/donsmith/archive/tags/Service+Factory/default.aspx">Service Factory</category></item><item><title>Web Services Architecture Domain Model</title><link>http://blogs.msdn.com/donsmith/archive/2005/09/02/460345.aspx</link><pubDate>Sat, 03 Sep 2005 03:31:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:460345</guid><dc:creator>donsmith</dc:creator><slash:comments>11</slash:comments><comments>http://blogs.msdn.com/donsmith/comments/460345.aspx</comments><wfw:commentRss>http://blogs.msdn.com/donsmith/commentrss.aspx?PostID=460345</wfw:commentRss><description>&lt;P&gt;I'm not in a position to provide any details just yet, but a couple of us on the patterns &amp;amp; practices team have teamed up with heavy hitters like Jason Hogg,&amp;nbsp;&lt;a href="http://blogs.msdn.com/beatsch/"&gt;Beat Schwegler&lt;/A&gt;, &lt;A href="http://weblogs.asp.net/cweyer"&gt;Christian Weyer&lt;/A&gt;, &lt;a href="http://blogs.msdn.com/wojtek/"&gt;Wojtek Kozaczynski&lt;/A&gt;,&amp;nbsp;&lt;a href="http://blogs.msdn.com/maarten_mullender/"&gt;Maarten Mullender&lt;/A&gt;, &lt;A href="http://weblogs.asp.net/cazzu/"&gt;Daniel Cazzulino&lt;/A&gt;, &lt;A href="http://weblogs.asp.net/vga"&gt;Victor Aprea&lt;/A&gt;, &lt;A href="http://weblogs.asp.net/hernandl"&gt;Hernan de Lahitte&lt;/A&gt;, and &lt;A href="http://geekswithblogs.net/pag/"&gt;Pablo Galiano&lt;/A&gt; to provide some kick ass guidance around designing and developing Web services. During one of our meetings this week, we thought there might be some value in throwing together a domain model so we could make sure we were all singing from the same sheet of music when we used certain terms. This is a Visio version of what the whiteboard looked like after the meeting.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://dev4net.members.winisp.net/images/ws-domainmodel-lg.png"&gt;&lt;IMG alt="Click for a larger image of the Web Services Architecture Domain Model" src="http://dev4net.members.winisp.net/images/ws-domainmodel.png" border=0&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;This is by no means complete, but it illustrates some interesting concepts and commonly used terms. The first thing it illustrates is the almost 1 to 1 mapping of angle-bracket thingies and .NET thingies. &lt;/P&gt;
&lt;P&gt;Also, in the context of the common "Contract First" phrase, you can not only see what comprises the contract on each side of the model, but get a visual sense of what contract first might mean. Contract first doesn't necessarily mean "fire up your favorite text editor and start handcoding WSDL". Of course, if you like doing that, you certainly can. But you can also start with C# if that is your preference. You can get yourself in trouble with either approach, but each approach is viable also ... start with whatever you're comfortable with ... just make sure you're thinking about the messages and the contract as a whole.&lt;/P&gt;
&lt;P&gt;The other interesting thing this illustrates is the clear separation of the service, the adapter, and the business logic. This separation of concerns is an important architectural detail. Beat and I will be speaking specifically about this during our PDC pre-con session.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=460345" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/donsmith/archive/tags/Web+Services/default.aspx">Web Services</category><category domain="http://blogs.msdn.com/donsmith/archive/tags/Architecture/default.aspx">Architecture</category></item><item><title>Principles of Web Service Design</title><link>http://blogs.msdn.com/donsmith/archive/2005/08/19/453731.aspx</link><pubDate>Fri, 19 Aug 2005 20:46:02 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:453731</guid><dc:creator>donsmith</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/donsmith/comments/453731.aspx</comments><wfw:commentRss>http://blogs.msdn.com/donsmith/commentrss.aspx?PostID=453731</wfw:commentRss><description>
&lt;p&gt;&lt;a href="http://blogs.msdn.com/jevdemon/"&gt;John Evdemon&lt;/a&gt; just &lt;a href="http://blogs.msdn.com/jevdemon/archive/2005/08/18/453451.aspx"&gt;published 2 
articles&lt;/a&gt; on the principles of web service design. &lt;/p&gt;
&lt;p&gt;The first one is&amp;nbsp;titled &lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbda/html/SOADesign.asp"&gt;Principles 
of Service Design: Service Patterns and Anti-Patterns&lt;/a&gt; and in my opinion 
should be required reading for anyone who is new to web service development. 
Specifically, anyone new to building web services should focus on his 
explanation of the 4 tenets of service orientation, and the anti-patterns - this 
is good stuff - but if you've been staying up to date on web service 
architecture and development, you won't read much you haven't read/heard before. 
If you think you're pretty up-to-speed on web services, just breeze through 
those parts and check out the patterns - they tend to be&amp;nbsp;more specialized. 
&lt;/p&gt;
&lt;p&gt;The second article is titled &lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbda/html/SOADesignVer.asp"&gt;Principles 
of Service Design: Service Versioning&lt;/a&gt;. This article was of particular 
intereste to me since I've done quite a lot of thinking about the right approach 
to versioning web services. If you haven't thought much about how you're going 
to version your services, definitely check out this article. John does a good 
job of getting you up to speed on the issues quickly - this is&amp;nbsp;a difficult 
problem to solve in an elegant way.&lt;/p&gt;
&lt;p&gt;This is something you might not pick up on while reading the article. Notice 
how John does not consider the use of strings or XML nodes an option for message 
versioning. He doesn't consider this because it's not recommended. Coupling is 
not loose or tight - there are varying degrees of it. Typing web service 
messages as strings is too loose, but not providing an extension mechanism or 
open content model is too tight. John is recommending a nice balance.&lt;/p&gt;
&lt;p&gt;I didn't expect the article to effectively say, "here is how you should 
version your web services," which it doesn't, but, I like John's approach. He 
effectively says, "here are the issues and here are some principles that should 
guide your decision making." This is about the most you can ask for at this 
point. No one in the entire industry has come up with a definitive, elegant 
mechanism that addresses versioning for all types of services. I would like to 
see that happen someday. I'm currently working on some tooling that may result 
in great strides to this end. More later ;-)&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=453731" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/donsmith/archive/tags/Web+Services/default.aspx">Web Services</category><category domain="http://blogs.msdn.com/donsmith/archive/tags/Architecture/default.aspx">Architecture</category></item><item><title>What you can expect to find here</title><link>http://blogs.msdn.com/donsmith/archive/2005/08/12/whatishere.aspx</link><pubDate>Fri, 12 Aug 2005 12:50:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:450765</guid><dc:creator>donsmith</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/donsmith/comments/450765.aspx</comments><wfw:commentRss>http://blogs.msdn.com/donsmith/commentrss.aspx?PostID=450765</wfw:commentRss><description>&lt;P&gt;You may not know this, but the patterns &amp;amp; practices team is pretty amped about&amp;nbsp;making stuff that&amp;nbsp;architects and Web service developers&amp;nbsp;actually need (or&amp;nbsp;at least make them happy). I know this because that's what they pay me for ;) If you're building Web services, are involved in&amp;nbsp;an integration project, or are just interested in topics around enterprise architecture&amp;nbsp;(like service orientation), you're going to want to monitor (or even subscribe to) this blog. And here's why ...&lt;/P&gt;
&lt;P&gt;We have a bunch of stuff in the oven around Web service security, SAML, WS-I, WSE, integration patterns, and baseline architectures you're going to want to know about.&amp;nbsp;No one&amp;nbsp;wants&amp;nbsp;their colleagues making fun of&amp;nbsp;them for finding stuff out late ;) Not only am I going to let you know about things here long before you find out about it &lt;A href="http://msdn.microsoft.com/practices"&gt;here&lt;/A&gt;, I'll give you the opportunity to&amp;nbsp;influence its direction.&amp;nbsp;So, if you see something you don't like, or have a suggestion to make it more like what you need, fire off an &lt;A href="mailto:donsmicrosoftcom"&gt;email to me&lt;/A&gt;. &amp;lt;MyBestRadioVoice&amp;gt;Why, you could even be&amp;nbsp;the next &lt;A href="http://msdn.microsoft.com/practices/comm/"&gt;champion&lt;/A&gt;.&amp;lt;/MyBestRadioVoice&amp;gt;&amp;nbsp;Okay, so here's what we have going on right now (I don't know if I'm going to keep this list updated as time goes on, but you should be able to figure out what we're up to by browsing the categories):&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Web Service Security Patterns&lt;/STRONG&gt; - This is huge! As you probably know, Web services are going up everywhere and a lot of them have security requirements. Transport level security (SSL) will be fine in some cases, but other services are going to need message level security (WS-Security). If you've looked into this, you know it's far from trivial. how are you supposed to know which&amp;nbsp;token(s) to use ... X.509 ... Username ... Kerberos ... SecureContextToken for example? Well, these set of patterns cover the spectrum of architecture patterns, design patterns, and&amp;nbsp;implementation patterns in WSE. In addition to the patterns, this asset has a navigation document to put you in the ballpark of the patterns you should be considering, and it has some primers to get you up to speed quickly on some of the concepts. Today, this stuff is in the CTP (Community Technical Preview) phase. All you have to do is &lt;A href="http://practices.gotdotnet.com/projects/sopatterns"&gt;join the community here&lt;/A&gt; (of course it's free), download the CHM file, and start reading. &amp;lt;RadioVoiceAgain&amp;gt;You'll be impressing your friends, family, and (more importantly) your manager in no time.&amp;lt;/RadioVoiceAgain&amp;gt; &lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Applied Integration Baseline&lt;/STRONG&gt; - This is also huge, but more in the literal sense. What I mean is this is the largest amount of code we've ever released at one time. Oh no, don't be scared ... because we even wrote a separate application, we call the &lt;EM&gt;Narrator&lt;/EM&gt;, whose job is to help make sense of it all. So what is this thing? Well, we're all familiar with sample applications ... I like to call this a sample enterprise. One of the most difficult things to do in an enterprise is&amp;nbsp;integrate all of the siloed applications so they consistintly share&amp;nbsp;commonalities across the org. This asset shows how to&amp;nbsp;compose patterns to address complex integration requirements using SQL, BizTalk Server, IIS, and .NET. The result is a&amp;nbsp;baseline architecture to build on as you iterate over the implementation. The &lt;A href="http://www.microsoft.com/downloads/details.aspx?FamilyId=D2E2C091-DAF2-4A63-99D5-62EA07FAD5CB&amp;amp;displaylang=en"&gt;version for .NET 1.1 is here&lt;/A&gt;, &lt;A href="http://www.microsoft.com/downloads/details.aspx?FamilyId=E0DA19B9-B274-4CCB-9A0D-7B30BE60B1EC&amp;amp;displaylang=en"&gt;the version for .NET 2.0&lt;/A&gt; is here, and &lt;A href="http://practices.gotdotnet.com/projects/gbi"&gt;the community is here&lt;/A&gt;. You may also want to check out &lt;A href="http://msdn.microsoft.com/practices/narrator/narratorstart.html"&gt;a flash version of the Narrator&lt;/A&gt; - very good stuff.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;WS-I Basic Security Profile Reference Implementation &lt;/STRONG&gt;- I'll spare you &lt;A href="http://ws-i.org/about/Default.aspx"&gt;the description of who the WS-I is&lt;/A&gt; and&amp;nbsp;if you've not heard of the BSP 1.0, you can &lt;A href="http://www.ws-i.org/Profiles/BasicSecurityProfile-1.0.html"&gt;read about it here&lt;/A&gt;. Well, this asset is basically the Microsoft version of &lt;A href="http://ws-i.org/deliverables/workinggroup.aspx?wg=sampleapps"&gt;the WS-I Sample Application&lt;/A&gt;. This is the app we'll use to consume the other vendor's sample apps and they will consume this one with their version ... all to test for the success of interoperability. This is one of the better sample applications I've seen. The security requirements are surprisingly complex. There's good stuff in here. I'll definately be blogging more about this one. Feel free to &lt;A href="http://practices.gotdotnet.com/projects/wsibsp"&gt;join the community&lt;/A&gt; and have a look at the code and supporting docs. Right now it is only targeting WSE 3.0, but we would consider building&amp;nbsp;a WSE 2.0 version if the demand is high enough &amp;lt;PutsHandNextToEarListening /&amp;gt;. &lt;/P&gt;
&lt;P&gt;We have a couple of other things in the crock pot, but I don't have anything I can show you just yet. One is a SAML STS (security token service) Application Block. Well, we think we're going to release it as a block. What do you think?Right now the community is private. If you think (or know) you're going to implement SAML, are interested in this project, and are willing to provide us some feedback, fire me off an email mentioning this blog entry and tell us about your SAML plans. We'll invite you to the community so you can have a look at it now. The other project we have going is just in the very first stages and is easily my personal favorite. I can't wait to get this one in your hands. Unfortunately, I have to keep my fingers still for now. Much more later. Promise.&lt;/P&gt;
&lt;P&gt;If you have any questions or comments, post to the forums and I'll see it in my inbox almost instantaneously.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=450765" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/donsmith/archive/tags/Web+Services/default.aspx">Web Services</category><category domain="http://blogs.msdn.com/donsmith/archive/tags/Architecture/default.aspx">Architecture</category></item><item><title>Okay, I think I'm straight</title><link>http://blogs.msdn.com/donsmith/archive/2005/08/12/whoami.aspx</link><pubDate>Fri, 12 Aug 2005 09:45:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:448846</guid><dc:creator>donsmith</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/donsmith/comments/448846.aspx</comments><wfw:commentRss>http://blogs.msdn.com/donsmith/commentrss.aspx?PostID=448846</wfw:commentRss><description>&lt;P&gt;I was dorkin' around with my &lt;a href="http://blogs.msdn.com/donsmith"&gt;workblog&lt;/A&gt; the other day and it dawned on me that I never posted about how I recently switched jobs ... everyone blogs about this ... cool, so let me tell&amp;nbsp;you what I'm up to these days ... and why you care.&lt;/P&gt;
&lt;P&gt;I've been at Microsoft for about 5.5 years now and that whole time, I was a dev consultant helping customers with their enterprise applications focusing on Web services and XML technologies. On the 27th of June, I started a new position as the Product Manager for the Web Services &amp;amp; Integration program in the &lt;EM&gt;&lt;A href="http://msdn.microsoft.com/practices"&gt;patterns &amp;amp; practices&lt;/A&gt;&lt;/EM&gt; group and moved from Charlotte, NC to Redmond, WA.&amp;nbsp;In my new role,&amp;nbsp;I determine what assets we need to build based on customer and community feedback.&amp;nbsp;Does that kick ass, or what? Everyday, I get to work with customers who are building Web services, the Web service community, and the WSE and Indigo product teams. I've only been doing it for 5 weeks, but so far ...&amp;nbsp;it's awesome.&lt;/P&gt;
&lt;P&gt;Alright, so why do you care? I've been asking myself a similar question ... &lt;EM&gt;what am I going to do with my workblog?&lt;/EM&gt; Initially, I was thinking, &lt;EM&gt;I don't want to just talk about patterns &amp;amp; practices all the time&lt;/EM&gt;. But the more I thought about it, I realized that's exactly what I should do - here's why. My program represents 1 of only 3 in the pattern &amp;amp; practices group. That should indicate we're pretty serious about it. And, we're 100% committed to letting the customer drive our actions (sometimes the product groups don't do this as well as they would like to). A lot of people think the Microsoft blogs have been successful because Microsoft as a company and our products are more transparent and it's easier for everyone outside of the company to communicate with us. We're really liking that too!&lt;/P&gt;
&lt;P&gt;So yeah, I think I'm straight. I have a pretty good idea what I'm going to do here and why you should care. Unfortunately, you're going to have to &lt;a href="http://blogs.msdn.com/donsmith/archive/2005/08/12/whatishere.aspx"&gt;go over here&lt;/A&gt; to find out ;)&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=448846" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/donsmith/archive/tags/Web+Services/default.aspx">Web Services</category><category domain="http://blogs.msdn.com/donsmith/archive/tags/Architecture/default.aspx">Architecture</category><category domain="http://blogs.msdn.com/donsmith/archive/tags/Rambling/default.aspx">Rambling</category></item><item><title>Web Services Security Patterns ... finally</title><link>http://blogs.msdn.com/donsmith/archive/2005/07/12/437911.aspx</link><pubDate>Tue, 12 Jul 2005 11:28:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:437911</guid><dc:creator>donsmith</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/donsmith/comments/437911.aspx</comments><wfw:commentRss>http://blogs.msdn.com/donsmith/commentrss.aspx?PostID=437911</wfw:commentRss><description>
&lt;p&gt;The &lt;a href="http://msdn.microsoft.com/practices"&gt;patterns &amp;amp; 
practices&lt;/a&gt; team has been working on a set of Web service security patterns 
for a few months now. Until today, the content was only available to those who 
were invited to join the community workspace. Now anyone can join the &lt;a href="http://practices.gotdotnet.com/projects/sopatterns"&gt;workspace&lt;/a&gt; and 
download the content. Better yet, a CHM version was just published so you get 
everything in a single file with search capabilities.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Don, what can I expect from this content? &lt;/em&gt;Well, when it comes to 
securing Web services, there are a number of things to consider 
(confidentiality, message integrity, authentication, authorization, etc) and 
you&amp;nbsp;basically have 2&amp;nbsp;basic&amp;nbsp;places&amp;nbsp;to address these concerns: 
the transport and the message. IIS provides&amp;nbsp;the facilities you need to 
accomplish transport-level security and if you're familiar with &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=1BA1F631-C3E7-420A-BC1E-EF18BAB66122&amp;amp;displaylang=en"&gt;WSE&lt;/a&gt;, 
you know there are a number of tokens to help tackle the message security 
challenges (Kerberos, X.509, Username,&amp;nbsp;SCT, etc). Okay, given all of this, 
how do you know which is the most appropriate given your solution's requirements 
and threat assessment? The &lt;em&gt;Pattern Navigation &lt;/em&gt;section&amp;nbsp;attempts to 
get you in the ballpark of the patterns you should be considering based on your 
security requirements and constraints. Also included are primers to help get you 
up to speed on&amp;nbsp;certain topics if you need it. &lt;a href="http://practices.gotdotnet.com/projects/sopatterns"&gt;Check it out.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I'll blog about the stuff we have slated for the&amp;nbsp;next release in a 
future post. See you on the workspace.&lt;/p&gt;
&lt;p&gt;[Currently Playing ::&amp;nbsp;Switchblade - Roger Clyne &amp;amp; the 
Peacemakers]&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=437911" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/donsmith/archive/tags/Web+Services/default.aspx">Web Services</category><category domain="http://blogs.msdn.com/donsmith/archive/tags/Architecture/default.aspx">Architecture</category></item><item><title>Versioning Web Service Parameters</title><link>http://blogs.msdn.com/donsmith/archive/2004/12/03/274198.aspx</link><pubDate>Fri, 03 Dec 2004 11:08:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:274198</guid><dc:creator>donsmith</dc:creator><slash:comments>6</slash:comments><comments>http://blogs.msdn.com/donsmith/comments/274198.aspx</comments><wfw:commentRss>http://blogs.msdn.com/donsmith/commentrss.aspx?PostID=274198</wfw:commentRss><description>
&lt;p&gt;&lt;a href="http://blogs.msdn.com/dareobasanjo/archive/2004/11/30/272113.aspx"&gt;Dare 
makes a few comments&lt;/a&gt; about &lt;a href="http://blogs.msdn.com/donsmith/archive/2004/11/29/271419.aspx"&gt;one of my 
previous posts&lt;/a&gt; so I thought - in true blogsphere fashion - I'd follow-up in 
a new post. First I'll mention a few more things about versioning web services, 
then I'll get to Dare's comments.&lt;/p&gt;
&lt;p&gt;Versioning web services can be very challenging depending on the results 
you're trying to achieve. The primary decisions revolve around compatibility. 
First scenario, the easy way out: no compatibility. If you choose this route, it 
is highly recommended you implement a breaking change so your intentions are 
clear. So, for the next version of your service, you change the namespace, 
create a new endpoint address, and (re)deploy the clients for that service. When 
I said the easy way out, I was referring to versioning ... obviously not 
maintenance and deployments.&lt;/p&gt;
&lt;p&gt;As you can imagine, there are a number of forces that can mandate a service 
implement a breaking change. The most common of these is driven directly from 
the business. The recommendation I make about using a single parameter for Web 
Service operations is strictly for the scenarios when we're applying a 
non-breaking change. We should always strive for compatible changes when we want 
to avoid the maintenance and deployment headaches evidenced above. I think most 
of this was understood in my previous posts, but I wanted to state it explicitly 
just to be clear.&lt;/p&gt;
&lt;p&gt;I think it's also important to make a distinction between different kinds of 
Web Services, even if they're broad and sweeping. There is a considerable 
difference between a service-oriented Web Service and one that is not 
service-oriented. Perhaps my choice of &lt;font face="Courier New"&gt;GetTemp( 
TempRequest )&lt;/font&gt; was a poor one. Service-oriented operations are very 
course-grained because they represent a business process. Because of this, the 
service interface is not likely to change (unless the organization is going to 
stop offering the service). However, the data pieces that service will require 
could very possibly evolve over time. Therefore, it's important to be able to 
version the service interface and the parameters of the operations 
independently. If you agree at this point, then we need a way to identify what 
version of the operation's inputs are being used. The only way to accomplish 
this with multiple parameters is for one of the parameters, which has nothing to 
do with the business logic of the operation, to contain version information. 
With a single parameter, we can maintain a straightforward experience for the 
client developer. Consider this message schema:&lt;/p&gt;&lt;pre&gt;&lt;span style="COLOR: #0000ff"&gt;  &amp;lt;&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;s:schema&lt;/span&gt;&lt;span style="COLOR: #ff0000"&gt; ... targetNamespace&lt;span style="COLOR: #0000ff"&gt;="urn:service"&lt;/span&gt;&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&lt;/span&gt;
    &lt;span style="COLOR: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;s:element&lt;/span&gt;&lt;span style="COLOR: #ff0000"&gt; name&lt;span style="COLOR: #0000ff"&gt;="param"&lt;/span&gt; type&lt;span style="COLOR: #0000ff"&gt;="tns:UberParam"&lt;/span&gt; &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span style="COLOR: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;s:complexType&lt;/span&gt;&lt;span style="COLOR: #ff0000"&gt; name&lt;span style="COLOR: #0000ff"&gt;="UberParam"&lt;/span&gt;&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&lt;/span&gt;
      &lt;span style="COLOR: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;s:sequence&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&lt;/span&gt;
        &lt;span style="COLOR: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;s:element&lt;/span&gt;&lt;span style="COLOR: #ff0000"&gt; name&lt;span style="COLOR: #0000ff"&gt;="param1"&lt;/span&gt; type&lt;span style="COLOR: #0000ff"&gt;="s:string"&lt;/span&gt; 
          minOccurs&lt;span style="COLOR: #0000ff"&gt;="0"&lt;/span&gt; &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;/&amp;gt;&lt;/span&gt;
        &lt;span style="COLOR: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;s:element&lt;/span&gt;&lt;span style="COLOR: #ff0000"&gt; name&lt;span style="COLOR: #0000ff"&gt;="param2"&lt;/span&gt; type&lt;span style="COLOR: #0000ff"&gt;="s:string"&lt;/span&gt; 
          minOccurs&lt;span style="COLOR: #0000ff"&gt;="0"&lt;/span&gt; &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;s:sequence&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&lt;/span&gt;
      &lt;span style="COLOR: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;s:attribute&lt;/span&gt;&lt;span style="COLOR: #ff0000"&gt; name&lt;span style="COLOR: #0000ff"&gt;="version"&lt;/span&gt; type&lt;span style="COLOR: #0000ff"&gt;="s:string"&lt;/span&gt; 
        use&lt;span style="COLOR: #0000ff"&gt;="required"&lt;/span&gt; fixed&lt;span style="COLOR: #0000ff"&gt;="1.1"&lt;/span&gt; &lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span style="COLOR: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;s:complexType&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&lt;/span&gt;
&lt;span style="COLOR: #0000ff"&gt;  &amp;lt;/&lt;/span&gt;&lt;span style="COLOR: #800000"&gt;s:schema&lt;/span&gt;&lt;span style="COLOR: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Just for completeness, the C# version of this parameter will look like 
this.&lt;/p&gt;&lt;pre style="COLOR: #000000"&gt;  &lt;font color="#0000ff"&gt;using&lt;/font&gt; System.Xml.Serialization;

  [XmlType( Namespace=&lt;font color="#004884"&gt;"urn:service"&lt;/font&gt; )]
  &lt;font color="#0000ff"&gt;public&lt;/font&gt; &lt;font color="#0000ff"&gt;class&lt;/font&gt; UberParam
  {
      &lt;font color="#0000ff"&gt;public&lt;/font&gt; &lt;font color="#0000ff"&gt;string&lt;/font&gt; param1;
      &lt;font color="#0000ff"&gt;public&lt;/font&gt; &lt;font color="#0000ff"&gt;string&lt;/font&gt; param2;
    
      [XmlAttribute()]
      [System.ComponentModel.DefaultValue( &lt;font color="#004884"&gt;"1.1"&lt;/font&gt; )]
      &lt;font color="#0000ff"&gt;public&lt;/font&gt; &lt;font color="#0000ff"&gt;string&lt;/font&gt; version = &lt;font color="#004884"&gt;"1.1"&lt;/font&gt;;
  }&lt;/pre&gt;
&lt;p&gt;By providing a fixed value for the version of the data type, the service 
developer has more metadata to work with and the client developer can focus on 
only the job at hand.&lt;/p&gt;&lt;pre style="COLOR: #000000"&gt;  UberParam uber = &lt;font color="#0000ff"&gt;new&lt;/font&gt; UberParam();
  uber.param1 = &lt;font color="#004884"&gt;"value"&lt;/font&gt;;
  uber.param2 = &lt;font color="#004884"&gt;"value"&lt;/font&gt;;
  MyService.Operation( uber );&lt;/pre&gt;
&lt;p&gt;Depending on the requirements, a Web Service acting more in the role of a 
traditional API might not need this level flexibility. In these cases, I still 
recommend a single parameter, but without the need of additional metadata, the 
recommendation is less founded.&lt;/p&gt;
&lt;p&gt;From Dare ...&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Also the developer has to know how to manage interdependencies between 
properties of the TemperatureRequest that are set if there are any that are 
mutually exclusive, know which properties are required and whether to initialize 
primitive values in the object to defaults without any help from the 
API.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;These issues are valid whether we have one parameter or multiple. The 
developer is still required to know something about the API and its 
requirements.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;The other reason I like the former [multiple parameters] is that it 
carries the impression that the XML Web Service end point is unchanging while 
the latter [single parameter] does not.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;As a client developer, I would find more comfort&amp;nbsp;by feeling a 
single-parameter service is constructed in a flexible enough way to withstand 
the pressures of evolution. &lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=274198" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/donsmith/archive/tags/Web+Services/default.aspx">Web Services</category><category domain="http://blogs.msdn.com/donsmith/archive/tags/Architecture/default.aspx">Architecture</category></item><item><title>One parameter to rule them all: Part 2</title><link>http://blogs.msdn.com/donsmith/archive/2004/11/29/271419.aspx</link><pubDate>Mon, 29 Nov 2004 09:51:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:271419</guid><dc:creator>donsmith</dc:creator><slash:comments>5</slash:comments><comments>http://blogs.msdn.com/donsmith/comments/271419.aspx</comments><wfw:commentRss>http://blogs.msdn.com/donsmith/commentrss.aspx?PostID=271419</wfw:commentRss><description>
&lt;p&gt;In my post yesterday, I recommended that Web Service operations should only 
have a single input parameter rather than multiple for the sake of versioning. 
In the comments of that post, Todd makes some really good points why having 
multiple parameters isn't such a bad thing. Rather than responding in comment 
form, I thought [since I want to illustrate with code snippets] I'd just 
respond&amp;nbsp;with a new entry. The fact that it also makes my new blog look more 
active isn't a bad thing either :-)&lt;/p&gt;
&lt;p&gt;
&lt;p&gt;&lt;em&gt;&lt;/em&gt;&lt;/p&gt;One of the most important considerations when designing Web 
Service endpoints is the message ... the XML on the wire. This is where the 
rubber meets the road. Decisions at this point&amp;nbsp;will impact versioning, 
interoperability, and other factors in the future.&amp;nbsp;This is why&amp;nbsp;the 
WS-* specifications are primarily about what the message should look like rather 
than how the message should be processed. The importance on the message is also 
a primary motivation behind the contract first development approach &lt;a href="http://weblogs.asp.net/cweyer"&gt;Christian&lt;/a&gt; details &lt;a href="http://weblogs.asp.net/cweyer/category/2608.aspx"&gt;here&lt;/a&gt; and &lt;a href="http://weblogs.asp.net/yassers/"&gt;Yasser&lt;/a&gt; writes about &lt;a href="http://msdn.microsoft.com/webservices/building/frameworkandstudio/designing/default.aspx?pull=/msdnmag/issues/02/12/webservicesdesign/default.aspx"&gt;here&lt;/a&gt;. 
Let's have a look at a simple operation that uses multiple parameters: 
(yes,&amp;nbsp;I'm eventually going to get around to my point ;) 
&lt;p&gt;&lt;pre style="COLOR: #000000"&gt;[WebService( Namespace=&lt;font color="#004884"&gt;"urn:many-param-service"&lt;/font&gt; )]
[SoapDocumentService( SoapBindingUse.Literal, 
  SoapParameterStyle.Bare )]
&lt;font color="#0000ff"&gt;public&lt;/font&gt; &lt;font color="#0000ff"&gt;class&lt;/font&gt; Service : WebService
{
  [WebMethod]
  &lt;font color="#0000ff"&gt;public&lt;/font&gt; ResponseType GetTemp( &lt;font color="#0000ff"&gt;string&lt;/font&gt; city, &lt;font color="#0000ff"&gt;string&lt;/font&gt; state )
  {
    &lt;font color="#0000ff"&gt;return&lt;/font&gt; TemperatureLib.Calculate( city, state );
  }
}&lt;/pre&gt;
&lt;p&gt;The input type and input message are represented like this in the WSDL 
contract for the operation above:&lt;/p&gt;&lt;pre&gt;&lt;font color="#0000ff"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#800000"&gt;wsdl:definitions&lt;/font&gt; &lt;font color="#ff0000"&gt;...&lt;/font&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;
  &lt;font color="#0000ff"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#800000"&gt;wsdl:types&lt;/font&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;
    &lt;font color="#0000ff"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#800000"&gt;s:schema&lt;/font&gt; &lt;font color="#ff0000"&gt;targetNamespace&lt;/font&gt;&lt;font color="#0000ff"&gt;="urn:many-param-service"&amp;gt;&lt;/font&gt;
      &lt;font color="#0000ff"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#800000"&gt;s:element&lt;/font&gt; &lt;font color="#ff0000"&gt;name&lt;/font&gt;&lt;font color="#0000ff"&gt;="city"&lt;/font&gt; &lt;font color="#ff0000"&gt;type&lt;/font&gt;&lt;font color="#0000ff"&gt;="s:string"&lt;/font&gt; &lt;font color="#0000ff"&gt;/&amp;gt;&lt;/font&gt;
      &lt;font color="#0000ff"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#800000"&gt;s:element&lt;/font&gt; &lt;font color="#ff0000"&gt;name&lt;/font&gt;&lt;font color="#0000ff"&gt;="state"&lt;/font&gt; &lt;font color="#ff0000"&gt;type&lt;/font&gt;&lt;font color="#0000ff"&gt;="s:string"&lt;/font&gt; &lt;font color="#0000ff"&gt;/&amp;gt;&lt;/font&gt;
      ...
    &lt;font color="#0000ff"&gt;&amp;lt;/&lt;/font&gt;&lt;font color="#800000"&gt;s:schema&lt;/font&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;
  &lt;font color="#0000ff"&gt;&amp;lt;/&lt;/font&gt;&lt;font color="#800000"&gt;wsdl:types&lt;/font&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;
  &lt;font color="#0000ff"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#800000"&gt;wsdl:message&lt;/font&gt; &lt;font color="#ff0000"&gt;name&lt;/font&gt;&lt;font color="#0000ff"&gt;="GetTempSoapIn"&amp;gt;&lt;/font&gt;
    &lt;font color="#0000ff"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#800000"&gt;wsdl:part&lt;/font&gt; &lt;font color="#ff0000"&gt;name&lt;/font&gt;&lt;font color="#0000ff"&gt;="city"&lt;/font&gt; &lt;font color="#ff0000"&gt;element&lt;/font&gt;&lt;font color="#0000ff"&gt;="tns:city"&lt;/font&gt; &lt;font color="#0000ff"&gt;/&amp;gt;&lt;/font&gt;
    &lt;font color="#0000ff"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#800000"&gt;wsdl:part&lt;/font&gt; &lt;font color="#ff0000"&gt;name&lt;/font&gt;&lt;font color="#0000ff"&gt;="state"&lt;/font&gt; &lt;font color="#ff0000"&gt;element&lt;/font&gt;&lt;font color="#0000ff"&gt;="tns:state"&lt;/font&gt; &lt;font color="#0000ff"&gt;/&amp;gt;&lt;/font&gt;
  &lt;font color="#0000ff"&gt;&amp;lt;/&lt;/font&gt;&lt;font color="#800000"&gt;wsdl:message&lt;/font&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;
    ...
&lt;font color="#0000ff"&gt;&amp;lt;/&lt;/font&gt;&lt;font color="#800000"&gt;wsdl:definitions&lt;/font&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/pre&gt;
&lt;p&gt;Notice how the city and state parameters are not contained in another 
element, but are direct children of the &lt;font face="Courier New"&gt;s:schema&lt;/font&gt; 
element. I'll tell you why this is a problem in a minute, but the 
&lt;em&gt;reason&lt;/em&gt; it's like that is because the &lt;font face="Courier New"&gt;wsdl:part&lt;/font&gt; names in the &lt;font face="Courier New"&gt;wsdl:message&lt;/font&gt; are not "parameter" and I specified &lt;font face="Courier New"&gt;SoapParameterStyle.Bare&lt;/font&gt; in code (they each impact the 
other depending on whether you're developing code-first or wsdl-first). 
&lt;em&gt;"Okay Don, so why not just use &lt;font face="Courier New"&gt;SoapParameterStyle.Wrapped&lt;/font&gt;?"&lt;/em&gt; Because then every 
node of that wrapper element becomes a parameter - even if you don't want it to 
be. Meaning, there's no way to send extra non-parameter metadata to the 
operation. Okay, I know I'm getting too vauge here so I'll use an example. 
Suppose we want to send version information to the operation. In the example 
above, there's nowhere for it to go. &lt;em&gt;"Why would we want to send version 
information to the operation?"&lt;/em&gt; Because as we version the operation, we 
should include version information so it's obvious what changed in each version. 
We can't get that information by simply adding new parameters to the&amp;nbsp;method 
signature. I'm not going to go into it here (I will in my article) but there is 
a approach &lt;a href="http://douglasp.com"&gt;Doug&lt;/a&gt; talks about &lt;a href="http://msdn.microsoft.com/msdntv/episode.aspx?xml=episodes/en/20030722WEBSVCSDP/manifest.xml"&gt;here&lt;/a&gt; 
about how to version datatypes that contain this version metadata. By using a 
single uber-parameter, we can include the traditional parameters as well as any 
metadata we need to send like version infomation. Then, instead of having to 
check for nulls, we can &lt;font face="Courier New"&gt;switch&lt;/font&gt; on the version 
metadata.&lt;/p&gt;
&lt;p&gt;Just for completeness, this is what the code for a single parameter operation 
might look like:&lt;/p&gt;&lt;pre style="COLOR: #000000"&gt;[WebService( Namespace=&lt;font color="#004884"&gt;"urn:one-param-service"&lt;/font&gt; )]
[SoapDocumentService( SoapBindingUse.Literal, 
  SoapParameterStyle.Bare )]
&lt;font color="#0000ff"&gt;public&lt;/font&gt; &lt;font color="#0000ff"&gt;class&lt;/font&gt; Service : System.Web.Services.WebService
{
  [WebMethod]
  &lt;font color="#0000ff"&gt;public&lt;/font&gt; ResponseType GetTemp( RequestType req )
  {
    ResponseType res = &lt;font color="#0000ff"&gt;new&lt;/font&gt; ResponseType();
    res.City = req.City;
    res.State = req.State;
    &lt;font color="#0000ff"&gt;return&lt;/font&gt; res;
  }
}&lt;/pre&gt;
&lt;p&gt;And&amp;nbsp;the input type and input message&amp;nbsp;in the WSDL contract for the 
operation will look like this:&lt;/p&gt;&lt;pre&gt;&lt;font color="#0000ff"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#800000"&gt;wsdl:definitions&lt;/font&gt; &lt;font color="#ff0000"&gt;...&lt;/font&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;
  &lt;font color="#0000ff"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#800000"&gt;wsdl:types&lt;/font&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;
    &lt;font color="#0000ff"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#800000"&gt;s:schema&lt;/font&gt; &lt;font color="#ff0000"&gt;...&lt;/font&gt;&lt;font color="#ff00ff"&gt;&lt;/font&gt;
      &lt;font color="#ff0000"&gt;targetNamespace&lt;/font&gt;&lt;font color="#0000ff"&gt;="urn:one-param-service"&amp;gt;&lt;/font&gt;
      &lt;font color="#0000ff"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#800000"&gt;s:element&lt;/font&gt; &lt;font color="#ff0000"&gt;name&lt;/font&gt;&lt;font color="#0000ff"&gt;="req"&lt;/font&gt; &lt;font color="#ff0000"&gt;type&lt;/font&gt;&lt;font color="#0000ff"&gt;="tns:RequestType"&lt;/font&gt; &lt;font color="#0000ff"&gt;/&amp;gt;&lt;/font&gt;
      &lt;font color="#0000ff"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#800000"&gt;s:complexType&lt;/font&gt; &lt;font color="#ff0000"&gt;name&lt;/font&gt;&lt;font color="#0000ff"&gt;="RequestType"&amp;gt;&lt;/font&gt;
        &lt;font color="#0000ff"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#800000"&gt;s:sequence&lt;/font&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;
          &lt;font color="#0000ff"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#800000"&gt;s:element&lt;/font&gt; &lt;font color="#ff0000"&gt;...&lt;/font&gt; &lt;font color="#ff0000"&gt;name&lt;/font&gt;&lt;font color="#0000ff"&gt;="City"&lt;/font&gt; &lt;font color="#ff0000"&gt;type&lt;/font&gt;&lt;font color="#0000ff"&gt;="s:string"&lt;/font&gt; &lt;font color="#0000ff"&gt;/&amp;gt;&lt;/font&gt;
          &lt;font color="#0000ff"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#800000"&gt;s:element&lt;/font&gt; &lt;font color="#ff0000"&gt;...&lt;/font&gt; &lt;font color="#ff0000"&gt;name&lt;/font&gt;&lt;font color="#0000ff"&gt;="State"&lt;/font&gt; &lt;font color="#ff0000"&gt;type&lt;/font&gt;&lt;font color="#0000ff"&gt;="s:string"&lt;/font&gt; &lt;font color="#0000ff"&gt;/&amp;gt;&lt;/font&gt;
        &lt;font color="#0000ff"&gt;&amp;lt;/&lt;/font&gt;&lt;font color="#800000"&gt;s:sequence&lt;/font&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;
      &lt;font color="#0000ff"&gt;&amp;lt;/&lt;/font&gt;&lt;font color="#800000"&gt;s:complexType&lt;/font&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;
      ...
    &lt;font color="#0000ff"&gt;&amp;lt;/&lt;/font&gt;&lt;font color="#800000"&gt;s:schema&lt;/font&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;
  &lt;font color="#0000ff"&gt;&amp;lt;/&lt;/font&gt;&lt;font color="#800000"&gt;wsdl:types&lt;/font&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;
  &lt;font color="#0000ff"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#800000"&gt;wsdl:message&lt;/font&gt; &lt;font color="#ff0000"&gt;name&lt;/font&gt;&lt;font color="#0000ff"&gt;="GetTempSoapIn"&amp;gt;&lt;/font&gt;
    &lt;font color="#0000ff"&gt;&amp;lt;&lt;/font&gt;&lt;font color="#800000"&gt;wsdl:part&lt;/font&gt; &lt;font color="#ff0000"&gt;name&lt;/font&gt;&lt;font color="#0000ff"&gt;="req"&lt;/font&gt; &lt;font color="#ff0000"&gt;element&lt;/font&gt;&lt;font color="#0000ff"&gt;="tns:req"&lt;/font&gt; &lt;font color="#0000ff"&gt;/&amp;gt;&lt;/font&gt;
  &lt;font color="#0000ff"&gt;&amp;lt;/&lt;/font&gt;&lt;font color="#800000"&gt;wsdl:message&lt;/font&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;
  ...
&lt;font color="#0000ff"&gt;&amp;lt;/&lt;/font&gt;&lt;font color="#800000"&gt;wsdl:definitions&lt;/font&gt;&lt;font color="#0000ff"&gt;&amp;gt;&lt;/font&gt;&lt;/pre&gt;
&lt;p&gt;A single parameter approach also has a bit to do with style. I don't feel the 
style aspect is&amp;nbsp;as menial as how you use spaces in your method signatures 
because it&amp;nbsp;adds a considerable level of consistency to them. And, as I 
mentioned above, it adds a level of elegancy to operations which consume 
metadata that doesn't work well as a traditional parameter. &lt;/p&gt;
&lt;p&gt;Todd also states: &lt;em&gt;"Sometimes it may make sense to put the new parameter 
on the TempRequest object, but not always. Following your example, if 
TempRequest really is Address, it makes sense to put a ZipCode field on the 
object rather than as another parameter to GetTemp. However, if ZipCode doesn't 
logically fit into TempRequest (ie, TempRequest is not an Address), then don't 
put it there."&lt;/em&gt; &lt;/p&gt;
&lt;p&gt;That's the beauty of using a single parameter. It's not important whether 
TempRequest is an Address or not - or if it contains an Address or not. As far 
as the contract is concerned, we know it contains everything GetTemp needs to 
function. When we use a single parameter it will &lt;em&gt;always&lt;/em&gt; make sense when 
something new is added. If you want to play with the differences between single 
and multiple parameters, I've posted some &lt;a href="http://dev4net.com/coding/WebServiceParams/WebServiceParams.zip"&gt;sample 
code here&lt;/a&gt; that might save you some time. Happy coding!&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=271419" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/donsmith/archive/tags/Web+Services/default.aspx">Web Services</category><category domain="http://blogs.msdn.com/donsmith/archive/tags/Architecture/default.aspx">Architecture</category></item><item><title>Two Web Service "Don'ts"</title><link>http://blogs.msdn.com/donsmith/archive/2004/11/27/two-web-service-don-ts.aspx</link><pubDate>Sun, 28 Nov 2004 02:40:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:271044</guid><dc:creator>donsmith</dc:creator><slash:comments>5</slash:comments><comments>http://blogs.msdn.com/donsmith/comments/271044.aspx</comments><wfw:commentRss>http://blogs.msdn.com/donsmith/commentrss.aspx?PostID=271044</wfw:commentRss><description>&lt;P&gt;There are at least 2 things I'm still seeing in some web service implementations we should not be seeing. In my first post, &lt;EM&gt;&lt;A href="http://blogs.msdn.com/donsmith/archive/2004/11/26/270844.aspx" mce_href="http://blogs.msdn.com/donsmith/archive/2004/11/26/270844.aspx"&gt;Refactoring XSLT&lt;/A&gt;&lt;/EM&gt;, I was shooting for &lt;EM&gt;original&lt;/EM&gt; ... &lt;EM&gt;interesting&lt;/EM&gt; ... maybe even &lt;EM&gt;useful&lt;/EM&gt; ... but &lt;STRONG&gt;not&lt;/STRONG&gt; a &lt;EM&gt;best practice&lt;/EM&gt; (at least not until more testing is done). In this post I'm&amp;nbsp;writing about 2 best practices - independent of the platform (.NET, J2EE, etc) being used. One of them you've [hopefully] heard 1000 times and this will be your 1001st. You might not have heard the other&amp;nbsp;one before ... or at least heard the rationale behind it.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT size=4&gt;Don't code on the edge&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Web Services are essentially the buttons and textboxes other applications use to access some functionality. The endpoint (an ASMX file in the case of .NET) is just that ... an endpoint ... and that's all it should be. You have no business putting application logic in an ASMX page (or its codebehind) than you do in a windows form. I would even go as far as to say there should only be one line of code (2 at the max) in each of your exposed operations. How 'bout an example?&lt;/P&gt;&lt;PRE style="COLOR: #000000"&gt;[System.Web.Services.WebMethod()]
&lt;FONT color=#0000ff&gt;public&lt;/FONT&gt; TempResponse GetTemp( TempRequest tempreq )
{
    &lt;FONT color=#0000ff&gt;return&lt;/FONT&gt; TempCalculator.GetTemp( tempreq );
}
&lt;/PRE&gt;
&lt;P&gt;As you can see, I'm calling a static &lt;FONT face="Courier New"&gt;GetTemp()&lt;/FONT&gt; method on a different class and returning its result. There might be another line if you have to call an instance method or maybe even another one if &lt;FONT face="Courier New"&gt;TempCalculator&lt;/FONT&gt; is on a different physical tier like &lt;A href="http://dasblonde.net/" mce_href="http://dasblonde.net/"&gt;Michele&lt;/A&gt; illustrates &lt;A href="http://www.dasblonde.net/PermaLink.aspx?guid=88cc6682-39b8-484c-8224-2d031223d8b5" mce_href="http://www.dasblonde.net/PermaLink.aspx?guid=88cc6682-39b8-484c-8224-2d031223d8b5"&gt;here&lt;/A&gt;, but the important thing to notice is the lack of any "temperature" code in the method's body. Let your business logic do that and put it in a different library assembly. "What's the big deal Don? Why not just put it in the codebehind?" If proper analysis and design have been accomplished on the business logic, it actually won't fit on the edge very easily. So, if you have business logic on the edge (in the endpoint operations or in the user interface) there's a very good chance the business logic has a poor design. Forcing the business logic in a separate library encourages solid software design.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT size=4&gt;One parameter and one return to rule them all&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;I'm actually illustrating this in my little WebMethod above. I'll admit my tent is pitched in the very middle of the messaging camp (opposed to the RPC camp), but that's not why I recommend&amp;nbsp;only one input&amp;nbsp;parameter and a single return type on all Web Service operations. The reasons really revolve around versioning and interoperability. I've been writing an article on versioning Web Service for months now to eventually be published on MSDN. I thought I lost it on a bad hard drive, but thanks to my close friend &lt;A href="http://yexley.net/blogs/bob" mce_href="http://yexley.net/blogs/bob"&gt;Yex&lt;/A&gt;, who&amp;nbsp;still had&amp;nbsp;a draft I sent him, I didn't have to start over from scratch. You'll have to take my word for it for now, but in the article I show how it is much easier to version datatypes (parameters and return types) than it is the interface of the operation. In other words, it's much easier to add a &lt;FONT face="Courier New"&gt;ZipCode&lt;/FONT&gt; member to our &lt;FONT face="Courier New"&gt;TempRequest&lt;/FONT&gt; type than it is to add a &lt;FONT face="Courier New"&gt;ZipCode&lt;/FONT&gt; parameter to our &lt;FONT face="Courier New"&gt;GetTemp()&lt;/FONT&gt; method while retaining compatibility with older and newer versions. We've also found the serialization behaviors between .NET and other platforms is very comparable with regard to custom types (opposed to primitive types). Lastly, it's a nice consistent pattern ... no surprises.&lt;/P&gt;
&lt;P&gt;I think one of the reasons&amp;nbsp;we're still seeing these bad practices is because developers aren't hearing and seeing them put in place often enough. &lt;A href="http://donxml.com/" mce_href="http://donxml.com/"&gt;DonXML&lt;/A&gt; talks about this problem in more detail &lt;A href="http://donxml.com/allthingstechie/archive/2004/10/21/1449.aspx" mce_href="http://donxml.com/allthingstechie/archive/2004/10/21/1449.aspx"&gt;here&lt;/A&gt;. I too have been guilty of using bad coding practices in demonstrations and sample code. Of course the main reason we do it is because we're trying to illustrate a certain concept and don't want to spend the time to work up a solid design. We also don't want to confuse the recipient with details outside of the thing we're trying to illustrate. So what's the answer? I think if we just&amp;nbsp;point out the bad practices to&amp;nbsp;the recipient - either&amp;nbsp;using&amp;nbsp;code comments or verbally - it would go a long way to curb this problem. You also know as well as I do that many real-world applications are just demos and sample code that has evolved. Let us all keep reminding everyone about the dangers of ignoring a solid design over productivity - becuase doing so will cause productivity to suffer eventually. Happy coding!&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=271044" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/donsmith/archive/tags/Web+Services/default.aspx">Web Services</category><category domain="http://blogs.msdn.com/donsmith/archive/tags/Architecture/default.aspx">Architecture</category></item></channel></rss>