<?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>All About Interop : XML</title><link>http://blogs.msdn.com/dotnetinterop/archive/tags/XML/default.aspx</link><description>Tags: XML</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>REST Q &amp; A - enough already</title><link>http://blogs.msdn.com/dotnetinterop/archive/2008/08/18/rest-q-a.aspx</link><pubDate>Mon, 18 Aug 2008 18:04:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8876599</guid><dc:creator>DotNetInterop</dc:creator><slash:comments>9</slash:comments><comments>http://blogs.msdn.com/dotnetinterop/comments/8876599.aspx</comments><wfw:commentRss>http://blogs.msdn.com/dotnetinterop/commentrss.aspx?PostID=8876599</wfw:commentRss><description>&lt;P&gt;Tim Bray at Sun has &lt;A class="" href="http://www.tbray.org/ongoing/When/200x/2008/08/18/On-REST" mce_href="http://www.tbray.org/ongoing/When/200x/2008/08/18/On-REST"&gt;some questions and comments on REST&lt;/A&gt;. &lt;/P&gt;
&lt;P&gt;First, let me say that the religious wars over WS-* and REST seem to be generated by a very small number of people who have a very&amp;nbsp;large amount of spare time. Don't these people have &lt;EM&gt;things to do&lt;/EM&gt;?&amp;nbsp; &lt;/P&gt;
&lt;P&gt;Can it possibly be enlightening or helpful for anyone at this time to read Mr Tim Bray's opinion, once again, that XSD and WSDL are "lousy and malformed"?&amp;nbsp; Really?&amp;nbsp; Wait, let's read four other "Thinkers" who chime in with &lt;A class="" href="http://en.wikipedia.org/wiki/Ad_nauseam" mce_href="http://en.wikipedia.org/wiki/Ad_nauseam"&gt;their own artfully crafted prose stating their position&lt;/A&gt; on how much they dislike XSD.&lt;/P&gt;
&lt;P&gt;This is all &lt;A class="" href="http://dictionary.reference.com/search?q=braying" mce_href="http://dictionary.reference.com/search?q=braying"&gt;utter baloney&lt;/A&gt;.&amp;nbsp; While one class of people will debate endlessly about the number of angels that can fit on the head of a pin, there are other people who have real jobs.&amp;nbsp; They need to get stuff done, they need to connect systems together in their own enterprise, or connect with partners.&amp;nbsp; Or they need to build frameworks and tools to help other people connect systems together.&amp;nbsp; Yes, XSD isn't as simple as we'd like.&amp;nbsp; Yes, it's hard to implement the spec.&amp;nbsp; Yes, there are strange corners in the spec.&amp;nbsp; Ok, already.&amp;nbsp; We got it.&amp;nbsp; We've heard it all.&amp;nbsp; And governments are wasteful and the tax system is unfair, too.&amp;nbsp; We mortals who have stuff to do - We have already accepted the imperfect nature of our circumstances.&amp;nbsp; We get that it isn't all as it should be, if we had designed everything with the foreknowledge that comes from experience.&amp;nbsp; That's the paradox, isn't it?&amp;nbsp; You only go around once, but you learn as you go.&amp;nbsp; .... Ok then, being practical we-have-stuff-to-do people, we don't sit around and dwell on what might have been, but we accept the reality and move on.&amp;nbsp; Ferpeetesake!&amp;nbsp;&amp;nbsp; GET ON WITH IT, Bray.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;Bray also repeated the complaint that WS-* was produced by "&lt;STRONG&gt;A Microsoft/IBM-driven process that was cripplingly product-linked and political.&lt;/STRONG&gt;"&amp;nbsp; Such a naive opinion to be repeating.&amp;nbsp; The way Bray wrote it, he could easily duck and say "it wasn't ME who said it, I was only repeating what someone else said. . ."&amp;nbsp; Uh-huh.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;Let me say this about that:&amp;nbsp;While it is true that the representatives of large software vendors&amp;nbsp;will inevitably represent the interest of the vendors in any spec standardization and rationalization process, to conclude that the vendors are unimportant or somehow &lt;EM&gt;harmful &lt;/EM&gt;to the process is naive beyond belief.&amp;nbsp; Suppose that the vendors did not participate in the WS-* process.&amp;nbsp; Then what?&amp;nbsp; Then WS-* is unsupported and you have no tools to use.&amp;nbsp; Then the vendors go and build something else and you have fragmentation in the marketspace and no agreement on what to use, and interop is still a pipe dream. &amp;nbsp;Sure the vendors change the process, but isn't that what the horse-trading process is about?&amp;nbsp;&amp;nbsp; Without the vendors, what would you have gotten? &lt;/P&gt;
&lt;P&gt;And don't even tell me REST.&amp;nbsp; REST is only possible having followed the WS-* effort.&amp;nbsp; REST benefits from all the foundation work on XML (whether you like XSD or not). &lt;/P&gt;
&lt;P&gt;Ok, so large vendors were hard to work with.&amp;nbsp;&amp;nbsp; How about some cheese with that whine? &amp;nbsp;&amp;nbsp;Once again, isn't this just the way the world works?&amp;nbsp; It's like buying a house and later complaining that the seller wouldn't give you the price you wanted.&amp;nbsp; It's a negotiation,&amp;nbsp;Bray.&amp;nbsp; You can't get everything you want.&lt;/P&gt;
&lt;P mce_keep="true"&gt;But that's the strange part.&amp;nbsp;Recently, &lt;A class="" href="http://www.tbray.org/ongoing/When/200x/2008/08/10/Donkeyists" mce_href="http://www.tbray.org/ongoing/When/200x/2008/08/10/Donkeyists"&gt;Bray himself cited a book about donkeys&lt;/A&gt;, and how they &lt;EM&gt;find tranquility in a chaotic world&lt;/EM&gt;.&amp;nbsp; Donkey sense. &amp;nbsp;But this is exactly what Bray is NOT doing.&amp;nbsp; &lt;/P&gt;
&lt;P mce_keep="true"&gt;-----&lt;/P&gt;
&lt;P&gt;Bray mentioned a dearth of tools around REST.&amp;nbsp; He cited &lt;A class="" href="http://www.restlet.org/" mce_href="http://www.restlet.org/"&gt;Restlet&lt;/A&gt; and Jersey as exceptions.&amp;nbsp; I don't know&amp;nbsp;Jersey, but I do know Restlet, a lightweight REST framework for Java.&amp;nbsp; If he mentions Restlet, why would Bray not also mention Windows Communication Foundation (WCF), I wonder?&amp;nbsp; is it lack of knowledge?&amp;nbsp;&amp;nbsp; just jingoism?&amp;nbsp; (edit: I suspect the latter,&amp;nbsp;having read &lt;A class="" href="http://search.msn.com/results.aspx?q=asinine&amp;amp;form=QBRE3" mce_href="http://search.msn.com/results.aspx?q=asinine&amp;amp;form=QBRE3"&gt;Bray's smug self-satisfied tone&lt;/A&gt; in his &lt;A class="" href="http://www.tbray.org/ongoing/When/200x/2007/05/11/WCF-REST" mce_href="http://www.tbray.org/ongoing/When/200x/2007/05/11/WCF-REST"&gt;previous comments on the REST support in WCF&lt;/A&gt;.&amp;nbsp; It's obvious he himself knows about WCF; I conclude he just doesn't want anyone else to know.)&amp;nbsp;&amp;nbsp;What I tried to post to Bray's comment section on his post of today (didn't work for some reason, the "pre-parse anlayzer could not be found" or some such drivel) is this: &amp;nbsp;WCF&amp;nbsp;since v3.5 provides a nice framework for building servers and clients that use message-based communication models, whether SOAP and WS-* based or &lt;A class="" href="http://msdn.microsoft.com/en-us/library/Aa395208.aspx" mce_href="http://msdn.microsoft.com/en-us/library/Aa395208.aspx"&gt;REST based&lt;/A&gt;. &lt;/P&gt;
&lt;P&gt;People can object and say that "it's not purely REST" but the beauty of WCF is that it is MESSAGE BASED, which Mr Bray apparently loves - and you the developer can defer your protocol choice (though not your arch model) until deployment. &lt;/P&gt;
&lt;P mce_keep="true"&gt;Unlike Restlet, WCF is mainstream, in wide use.&amp;nbsp; It is well supported by mainstream development tools, and there is plenty of good information on the web in the form of tutorials, sample apps, and so on.&amp;nbsp; WCF is well tested and performance-tuned.&amp;nbsp; It is of course very interoperable: regardless whether you use WCF on the client-side or on the server-side, you're gonna be able to connect with arbitrary REST endpoints, regardless of the language or platform those other endpoints&amp;nbsp;use.&amp;nbsp; &amp;nbsp; &lt;/P&gt;
&lt;P mce_keep="true"&gt;I would say more, but I gotta go; I have stuff to do. &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8876599" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/Interop/default.aspx">Interop</category><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/XSD/default.aspx">XSD</category><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/XML/default.aspx">XML</category><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/REST/default.aspx">REST</category></item><item><title>Connecting to Exchange using JAX-WS, part 1</title><link>http://blogs.msdn.com/dotnetinterop/archive/2008/07/29/connecting-to-exchange-using-jax-ws-part-1.aspx</link><pubDate>Tue, 29 Jul 2008 21:52:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8789662</guid><dc:creator>DotNetInterop</dc:creator><slash:comments>5</slash:comments><comments>http://blogs.msdn.com/dotnetinterop/comments/8789662.aspx</comments><wfw:commentRss>http://blogs.msdn.com/dotnetinterop/commentrss.aspx?PostID=8789662</wfw:commentRss><description>&lt;FONT face=Tahoma size=2&gt;
&lt;H3&gt;Yes, it is possible to Connect to Exchange using JAX-WS&lt;/H3&gt;
&lt;P&gt;The fear and trepidation I had when considering the effort to connect a Java application to Exchange Server 2007 was well founded. It wasn't easy. I'm going to spoil the ending and tell you, yes, it is possible to connect Java apps to Exchange Server via Web services, and you can do it securely and with good performance and reliability. But it took some starts and stops to make it happen. &lt;/P&gt;&lt;FONT face=Tahoma size=2&gt;&lt;!-- ------------------------------------------------------- --&gt;
&lt;H4&gt;Warning: Old Guy Reminiscing Ahead&lt;/H4&gt;
&lt;P&gt;Back a few years, I was a technical marketing guy for the Microsoft platform, and my main role Was talking to customers. One of the things I talked with customers about often, was interop. Pretty much every customer I talked to already had a signficant investment in information technology, they had a strategy that was in place and working, they had systems in place, working. They had off-the-shelf apps, they had some custom-built apps, and they had skillz. They were looking to make adjustments, to evolve their systems, to improve. It reminded me of the principles of Agile Development. &lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;EM&gt;Do you remember &lt;A href="http://en.wikipedia.org/wiki/Extreme_Programming" mce_href="http://en.wikipedia.org/wiki/Extreme_Programming"&gt;XP&lt;/A&gt;? Do you remember how trendy that was, like 3 or 4 years ago. Everyone was talking about XP, everyone was looking to apply XP principles into their approaches. That seems a long time ago. XP is &lt;B&gt;so 2004&lt;/B&gt;. &lt;/EM&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The approach that companies took with their information systems architecture was something like what developers did in a different domain with XP. Lots of little iterations, constant improvement, and steadily you get closer to your goal. &lt;/P&gt;
&lt;P&gt;I remember talking to customers about web services technology, about using standard XML-based protocols to enable better connections between disparate information systems. Yes, Virginia, this was actually a theme of my conversations back only a few years ago. Now it seems so obvious. Now that everything speaks XML and interconnection is fairly easy, the wisdom of using standard protocols to gain efficiencies in IT is apparent. But only a short time ago this issue was not so clearly understood. &lt;/P&gt;
&lt;P&gt;To make my case that web services and XML based protocols were the future, I'd show customers the investments that Microsoft was making into them. I'd tell them about all the standards was Microsoft working on. But the thing that customers wanted was hard evidence - not standards or papers. They wanted proof of XML usage in Microsoft products. So I'd talk about all the XML-based protocols that were already in the existing Microsoft systems they had: the web services libraries in the .NET Framework, the tooling in Visual Studio (but these were fairly obvious). The XML shredding capability that was introduced in SQL 2000 and improved in SQL 2005. Actually with the &lt;A href="http://msdn.microsoft.com/en-us/library/ms191268.aspx" mce_href="http://msdn.microsoft.com/en-us/library/ms191268.aspx"&gt;FOR XML&lt;/A&gt; clause you can do some pretty nifty things with the data that is already in your database. The &lt;A href="http://en.wikipedia.org/wiki/MSXML" mce_href="http://en.wikipedia.org/wiki/MSXML"&gt;MSXML&lt;/A&gt; component - now sort of just accepted as part of the landscape, a key, if almost forgotten enabler of AJAX - but 6 or 7 years ago it was undergoing rapid development.&lt;/P&gt;
&lt;P&gt;These are all pretty good examples of Microsoft's investment in XML and WS-*. But one of the things that really surprised people was the web services capabilities we were introducing into Office (with WordML and ExcelML and so on), and the Exchange Server. &lt;/P&gt;&lt;!-- ------------------------------------------------------- --&gt;
&lt;H4&gt;Exchange Server 2007 and Web services &lt;/H4&gt;
&lt;P&gt;Exchange Server 2003 had some limited web services capabilities. With Exchange Server 2007, Microsoft delivered an email and collab server that &lt;A href="http://msdn.microsoft.com/en-us/library/bb204119(EXCHG.80).aspx" mce_href="http://msdn.microsoft.com/en-us/library/bb204119(EXCHG.80).aspx"&gt;exposed all of its features through standard web services interfaces&lt;/A&gt;. Today if you have an Exchange Server, you can point your browser to http://my.exchange.server.com/ews/Exchange.asmx and get a WSDL for the server. Wow. That is pretty cool. &lt;/P&gt;
&lt;P&gt;Standards are standards, and complying to a standard doesn't guarantee interop. If you are designing a web services interface, you can get better interop by keeping your WSDL fairly simple, and constraining your interface definitions to avoid some of the more esoteric nooks and crannies of the XML Schema spec. This is advice we've all been following for years. It works. &lt;/P&gt;
&lt;P&gt;The problem with that advice is that it does not work if the information systems at the end of the wire are not simple, or if the requirements are not simple. For example, if you want WS-Addressing or delegated security, things can get complicated. And, similarly, Exchange Server is not simple. It stores lots of different types of things (email messages, contacts, tasks, notes, calendar entries, requests, resent items, recurrences, mime content type, cancellations, suggestions for new times, and so on). And then it compounds that complexity by adding in an unstructured aspect - document attachments and other unstructured data. Then there is stuff like impersonation, delegation (your admin assistant can update your calendar), out-of-office messages, and so on. It's pretty rich. &lt;/P&gt;
&lt;P&gt;With all that capability, necessarily, the interface to Exchange is not going to be simple. Look at the &lt;EM&gt;user&lt;/EM&gt; interface in Outlook - it is pretty rich. And the same is true with the &lt;EM&gt;network&lt;/EM&gt; interface on the wire, described in the WSDL. &lt;/P&gt;
&lt;P&gt;As a result, the WSDL for Exchange is complicated. It's big. It's got lots of nested structures. There are unions and restrictions and headers and bodies. It breaks all the rules for designing schema with interop in mind. &lt;/P&gt;
&lt;P&gt;Anyway, who needs web services, right? We can &lt;A href="http://blogs.msdn.com/dotnetinterop/archive/2008/07/21/connecting-java-to-exchange-over-webdav-with-apache-httpclient.aspx" mce_href="http://blogs.msdn.com/dotnetinterop/archive/2008/07/21/connecting-java-to-exchange-over-webdav-with-apache-httpclient.aspx"&gt;use WebDAV&lt;/A&gt;! &lt;/P&gt;&lt;!-- ------------------------------------------------------- --&gt;
&lt;H4&gt;Interop and the Exchange Server web services interface &lt;/H4&gt;
&lt;P&gt;First decision: which web services library to use? My first thought was to use the tried-and-true &lt;A href="http://ws.apache.org/axis/" mce_href="http://ws.apache.org/axis/"&gt;Apache AXIS 1.4&lt;/A&gt; library that I had been depending on since 2006. It wasn't &lt;EM&gt;THAT&lt;/EM&gt; old, and it worked for all the other interop tasks I had tried it on. It &lt;A href="http://dinoch.dyndns.org:7070/axis1.4/" mce_href="http://dinoch.dyndns.org:7070/axis1.4/"&gt;connected to .NET systems using ASMX or WCF.&lt;/A&gt; It was simple. I knew the tools. &lt;/P&gt;
&lt;P&gt;My first step was to grab the Exchange.wsdl, the types.xsd and the message.xsd. I knew that I needed to add a service definition to the end of the Exchange.wsdl file, because most WSDL compilers want it: &lt;/P&gt;
&lt;DIV style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 2pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 2pt; FONT-SIZE: 9pt; BACKGROUND: white; PADDING-BOTTOM: 2pt; BORDER-LEFT: windowtext 1pt solid; COLOR: black; LINE-HEIGHT: 98%; PADDING-TOP: 2pt; BORDER-BOTTOM: windowtext 1pt solid; FONT-FAMILY: Consolas, Courier New"&gt;&lt;PRE&gt;   &amp;lt;&lt;SPAN style="COLOR: #da70d6"&gt;wsdl&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #0000ff"&gt;service&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;name&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"ExchangeServices"&lt;/SPAN&gt;&amp;gt;
     &amp;lt;&lt;SPAN style="COLOR: #da70d6"&gt;wsdl&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #0000ff"&gt;port&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;name&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"ExchangeServicePort"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;binding&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"tns:ExchangeServiceBinding"&lt;/SPAN&gt;&amp;gt;
       &amp;lt;&lt;SPAN style="COLOR: #da70d6"&gt;soap&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #0000ff"&gt;address&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;location&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"https://myexchange.company.com/EWS/Exchange.asmx"&lt;/SPAN&gt;/&amp;gt;
     &amp;lt;/&lt;SPAN style="COLOR: #da70d6"&gt;wsdl&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #0000ff"&gt;port&lt;/SPAN&gt;&amp;gt;
   &amp;lt;/&lt;SPAN style="COLOR: #da70d6"&gt;wsdl&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #0000ff"&gt;service&lt;/SPAN&gt;&amp;gt;

&amp;lt;/&lt;SPAN style="COLOR: #da70d6"&gt;wsdl&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #0000ff"&gt;definitions&lt;/SPAN&gt;&amp;gt;
&lt;/PRE&gt;&lt;/DIV&gt;
&lt;P&gt;But very early the work with AXIS 1.4 was hitting roadblocks. That library generated source code that did not compile. It choked on quite a few things. Other people have &lt;A href="http://forums.microsoft.com/technet/showpost.aspx?postid=2199009&amp;amp;siteid=17" mce_href="http://forums.microsoft.com/technet/showpost.aspx?postid=2199009&amp;amp;siteid=17"&gt;walked this path&lt;/A&gt; but custom modifications to the generated code did not sound like fun to me. I quickly decided that I'd need to move to something else. &lt;/P&gt;
&lt;P&gt;My next idea was to move to &lt;A href="http://ws.apache.org/axis2/" mce_href="http://ws.apache.org/axis2/"&gt;AXIS2&lt;/A&gt;, which, coincidentally, is also at version 1.4. Now why they chose to call it "AXIS2 1.4" instead of "AXIS 2.4" is beyond me. There is a significant breakage in back-compatability with the move to AXIS to AXIS2, but still the version numbers are very confusing. &lt;/P&gt;
&lt;P&gt;AXIS2 introduces a number of changes over AXIS (1). The AXIS guys improved the XML schema support, for one. Also, they made the XML serialization engine pluggable, so you can use the built-in simple library (called ADB), or you can switch to use &lt;A href="http://jibx.sourceforge.net/" mce_href="http://jibx.sourceforge.net/"&gt;JiBX&lt;/A&gt; or &lt;A href="http://xmlbeans.apache.org/overview.html" mce_href="http://xmlbeans.apache.org/overview.html"&gt;XMLBeans&lt;/A&gt;. &lt;/P&gt;
&lt;P&gt;As with AXIS1, I ran the Exchange WSDL through the AXIS2 tools to generate the client-side proxies. This time, the code actually compiled. I was pleased to see that there was just one giant Java file generated for the entire Exchange interface. In AXIS 1.4, there was a whole series of files, 447 of em. Too many, thought I. But AXIS2 v1.4 generated just one file. Cool! &lt;/P&gt;
&lt;P&gt;And it was a big one. Opening the file in emacs - emacs asked me, "are you sure you want to open this file? it's really big!" Seriously. And compiling that single file with javac, I actually got a heap overflow. Wow! That's a big file. I just used the -X heap magic incantations on that file and I was able to compile it. &lt;/P&gt;
&lt;P&gt;I wrote up a simple proof of concept Java class that used the generated AXIS stub classes to connect to Exchange Server. When I ran the code, I got a failure: &lt;B&gt;"required attribute localTraversal is null" &lt;/B&gt;I had no idea where that was leading me. I searched in the WSDL and schema for Exchange but couldn't find any elements or attributes by that name. I considered ripping open the AXIS2 source code to try to troubleshoot it. Wasn't real excited about that prospect. I had no idea where that was leading me. &lt;/P&gt;
&lt;P&gt;My next step was to try the XMLbeans serialization option in AXIS 2. With this, I was back to generating ~ 400 Java files. But I didn't care, as long as the interop worked. And I had to update my client application code, because switching from ADB to XMLBeans necessitates a change in the programming model. I didn't care, though. Interop! (The things I do for interop!)&lt;/P&gt;
&lt;P&gt;The AXIS2 + XMLbeans combo was looking promising, but also failed, this time with &lt;/P&gt;&lt;PRE&gt;java.lang.ClassCastException: org.apache.xmlbeans.impl.values.XmlComplexContentImpl cannot be cast to com.microsoft.schemas.exchange.services._2006.types.Folder
IdType
&lt;/PRE&gt;
&lt;P&gt;This is apparently a common error, if there is a duplication in classes. I don't think I had that. I keep a clean workspace. Some of the XMLBeans people suggested on forums to upgrade to the later version of XMLBeans. There was no better suggestion I found. The AXIS2 library bundles XMLBeans 2.3.0, but XMLBeans standalone was at v2.4.0. So I downloaded 2.4.0, and tried to manually compile the schema with the scomp tool. &lt;/P&gt;&lt;PRE&gt;c:\apache\xmlbeans-2.3.0\bin\scomp -out GeneratedTypes.jar contract\ExchangeServices.wsdl  -compiler c:\sunjdk\bin\javac.exe
&lt;/PRE&gt;
&lt;P&gt;But, then, another runtime exception:&lt;/P&gt;&lt;PRE&gt;Exception in thread "main" java.lang.NoClassDefFoundError: com/microsoft/schemas/exchange/services/_2006/types/FolderIdType
        at ExchangeClient.Run(ExchangeClient.java:161)
        at ExchangeClient.main(ExchangeClient.java:217)
Caused by: java.lang.ClassNotFoundException: com.microsoft.schemas.exchange.services._2006.types.FolderIdType
        at java.net.URLClassLoader$1.run(Unknown Source)
&lt;/PRE&gt;
&lt;P&gt;It was one problem after another. Also, I had found the documentation and examples to be completely lacking for AXIS2. I couldn't find anyplace that gave me any hints. Why was it so hard to find information on this thing? And why did I have to use Class.Factory.Create(); instead of just calling new Class(). How dumb is this? And finally, there were 59 JAR files I needed to reference for AXIS2. That's what the doc told me. Commons-logging, xmlbeans, axis-api, axis-rt, corba, neethi, axiom, anogen, and on and on. I don't even know what those things are. The whole thing felt very... messy. I've already experienced JAR Hell and I don't want to go back there. I'm sure each one of those jars is required, but AXIS2 *could* be a little more seamless. As it is, it feels like a science project. &lt;/P&gt;
&lt;P&gt;Ok, time to switch horses. The AXIS Stuff was not giving me joy. My next attempt would be to use &lt;A href="https://jax-ws.dev.java.net/" mce_href="https://jax-ws.dev.java.net/"&gt;JAXWS&lt;/A&gt;. 
&lt;P&gt;With JAXWS, there is one runtime JAR. One. The code-gen produces... a JAR. How refreshing! I don't need 400 class files. I can just reference a JAR. (Yes, I know there are 400 classes inside the jar.&amp;nbsp; I don't care.&amp;nbsp; It's a single jar).&amp;nbsp; Hmm, someone ought to tell the AXIS project about this upstart JAXWS. The stub classes get generated and compile nicely. (small victory, cross fingers and hope for more). I am starting to like JAXWS. &lt;/P&gt;
&lt;P&gt;The programming model exposed by JAXWS-generated client-side classes is a little different than what I was used to. Rather than using return values from a stub method for the response, JAXWS has this idea of using the &lt;A href="http://search.msn.com/results.aspx?q=javax.xml.ws.holder&amp;amp;form=QBRE" mce_href="http://search.msn.com/results.aspx?q=javax.xml.ws.holder&amp;amp;form=QBRE"&gt;javax.xml.ws.Holder&lt;/A&gt; class for return values. Kinda odd, but... &lt;A href="http://uk.youtube.com/watch?v=Xz7_3n7xyDg" mce_href="http://uk.youtube.com/watch?v=Xz7_3n7xyDg"&gt;whatever&lt;/A&gt;. Maybe there is a way to change the client-side programming model, but I wasn't going to worry about that right then. &lt;/P&gt;
&lt;P&gt;There is some stuff in the Exchange interface (WSDL) having to do with impersonation and SerializedSecurityContext in each request on the EWS Service port, which is not useful. I'm using neither of those things, yet they are included in every Web services stub method. Passing null for these parameters does not satisfy, I get an error saying that I cannot set that to xsi:nil unless the schema has nillable='true'. I tried fiddling with the WSDL.. to set it to nillable in the right spots... That didn't work, so I just removed that stuff from the WSDL completely, from every wsdl:message in the WSDL file: &lt;/P&gt;
&lt;DIV style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 2pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 2pt; FONT-SIZE: 9pt; BACKGROUND: white; PADDING-BOTTOM: 2pt; BORDER-LEFT: windowtext 1pt solid; COLOR: black; LINE-HEIGHT: 98%; PADDING-TOP: 2pt; BORDER-BOTTOM: windowtext 1pt solid; FONT-FAMILY: Consolas, Courier New"&gt;&lt;PRE&gt;        &amp;lt;&lt;SPAN style="COLOR: #da70d6"&gt;wsdl&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #0000ff"&gt;message&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;name&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"GetFolderSoapIn"&lt;/SPAN&gt;&amp;gt;
                &amp;lt;&lt;SPAN style="COLOR: #da70d6"&gt;wsdl&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #0000ff"&gt;part&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;name&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"request"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;element&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"tns:GetFolder"&lt;/SPAN&gt; /&amp;gt;
&lt;SPAN style="COLOR: #b22222"&gt;&amp;lt;!-- &lt;/SPAN&gt;&lt;SPAN style="COLOR: #b22222"&gt;dinoch - change for JAXWS
                &amp;lt;wsdl:part name="Impersonation" element="t:ExchangeImpersonation"/&amp;gt;
                &amp;lt;wsdl:part name="S2SAuth" element="t:SerializedSecurityContext"/&amp;gt;
                &amp;lt;wsdl:part name="MailboxCulture" element="t:MailboxCulture"/&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #b22222"&gt;--&amp;gt;&lt;/SPAN&gt;
                &amp;lt;&lt;SPAN style="COLOR: #da70d6"&gt;wsdl&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #0000ff"&gt;part&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;name&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"RequestVersion"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;element&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"t:RequestServerVersion"&lt;/SPAN&gt;/&amp;gt;
        &amp;lt;/&lt;SPAN style="COLOR: #da70d6"&gt;wsdl&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #0000ff"&gt;message&lt;/SPAN&gt;&amp;gt;
&lt;/PRE&gt;&lt;/DIV&gt;
&lt;P&gt;and also from every soap:operation:&lt;/P&gt;
&lt;DIV style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 2pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 2pt; FONT-SIZE: 9pt; BACKGROUND: white; PADDING-BOTTOM: 2pt; BORDER-LEFT: windowtext 1pt solid; COLOR: black; LINE-HEIGHT: 98%; PADDING-TOP: 2pt; BORDER-BOTTOM: windowtext 1pt solid; FONT-FAMILY: Consolas, Courier New"&gt;&lt;PRE&gt;                &amp;lt;&lt;SPAN style="COLOR: #da70d6"&gt;wsdl&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #0000ff"&gt;operation&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;name&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"GetItem"&lt;/SPAN&gt;&amp;gt;
                        &amp;lt;&lt;SPAN style="COLOR: #da70d6"&gt;soap&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #0000ff"&gt;operation&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;soapAction&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"http://schemas.microsoft.com/exchange/services/2006/messages/GetItem"&lt;/SPAN&gt; /&amp;gt;
                        &amp;lt;&lt;SPAN style="COLOR: #da70d6"&gt;wsdl&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #0000ff"&gt;input&lt;/SPAN&gt;&amp;gt;
&lt;SPAN style="COLOR: #b22222"&gt;&amp;lt;!--&lt;/SPAN&gt;&lt;SPAN style="COLOR: #b22222"&gt;
                                &amp;lt;soap:header message="tns:GetItemSoapIn" part="Impersonation" use="literal"/&amp;gt;
                                &amp;lt;soap:header message="tns:GetItemSoapIn" part="S2SAuth" use="literal"/&amp;gt;
                                &amp;lt;soap:header message="tns:GetItemSoapIn" part="MailboxCulture" use="literal"/&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #b22222"&gt;--&amp;gt;&lt;/SPAN&gt;
                                &amp;lt;&lt;SPAN style="COLOR: #da70d6"&gt;soap&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #0000ff"&gt;header&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;message&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"tns:GetItemSoapIn"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;part&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"RequestVersion"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;use&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"literal"&lt;/SPAN&gt;/&amp;gt;
                                &amp;lt;&lt;SPAN style="COLOR: #da70d6"&gt;soap&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #0000ff"&gt;body&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;parts&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"request"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;use&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"literal"&lt;/SPAN&gt; /&amp;gt;
                        &amp;lt;/&lt;SPAN style="COLOR: #da70d6"&gt;wsdl&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #0000ff"&gt;input&lt;/SPAN&gt;&amp;gt;
                        &amp;lt;&lt;SPAN style="COLOR: #da70d6"&gt;wsdl&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #0000ff"&gt;output&lt;/SPAN&gt;&amp;gt;
                                &amp;lt;&lt;SPAN style="COLOR: #da70d6"&gt;soap&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #0000ff"&gt;body&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;parts&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"GetItemResult"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;use&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"literal"&lt;/SPAN&gt; /&amp;gt;
                                &amp;lt;&lt;SPAN style="COLOR: #da70d6"&gt;soap&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #0000ff"&gt;header&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;message&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"tns:GetItemSoapOut"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;part&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"ServerVersion"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;use&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"literal"&lt;/SPAN&gt;/&amp;gt;
                        &amp;lt;/&lt;SPAN style="COLOR: #da70d6"&gt;wsdl&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #0000ff"&gt;output&lt;/SPAN&gt;&amp;gt;
                &amp;lt;/&lt;SPAN style="COLOR: #da70d6"&gt;wsdl&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #0000ff"&gt;operation&lt;/SPAN&gt;&amp;gt;
                &amp;lt;&lt;SPAN style="COLOR: #da70d6"&gt;wsdl&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #0000ff"&gt;operation&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;name&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"CreateItem"&lt;/SPAN&gt;&amp;gt;
&lt;/PRE&gt;&lt;/DIV&gt;
&lt;P&gt;Ok, I was getting somewhere. With this change I was able to send a FindItem message over the wire to Exchange, and get message IDs back. &lt;B&gt;Very cool.&lt;/B&gt; The approach I was taking was to use findItem to get the item IDs, and then use GetItem on the Ids to get the full content. The FindItem() was working flawlessly, but the GetItem() was not. I was not getting the results I expected. No exceptions, but my data was not coming back. &lt;/P&gt;
&lt;P&gt;To troubleshoot this, I used &lt;A href="http://www.fiddler2.com/Fiddler2/" mce_href="http://www.fiddler2.com/Fiddler2/"&gt;Fiddler2&lt;/A&gt; to see the HTTP messages back and forth between Java and Exchange. Because the communication was using SSL for encryption, Fiddler2 does not work. Some people have used &lt;A href="http://www.charlesproxy.com/" mce_href="http://www.charlesproxy.com/"&gt;Charles&lt;/A&gt;, a similar web debugging proxy. But I already had Fiddler, so... With the fiddler tool I could see &lt;EM&gt;exactly&lt;/EM&gt; why the GetItem message was not giving me joy. (By the way, if you use Fiddler to decrypt SSL traffic, it's necessary to specify to the Java app that it should accept any SSL traffic - basically disable cert validation in the application. Only do this for testing purposes!!) &lt;/P&gt;
&lt;P&gt;Correct flow from a .NET app to Exchange:&lt;/P&gt;
&lt;DIV style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 2pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 2pt; FONT-SIZE: 9pt; BACKGROUND: white; PADDING-BOTTOM: 2pt; BORDER-LEFT: windowtext 1pt solid; COLOR: black; LINE-HEIGHT: 98%; PADDING-TOP: 2pt; BORDER-BOTTOM: windowtext 1pt solid; FONT-FAMILY: Consolas, Courier New"&gt;&lt;PRE&gt;&amp;lt;&lt;SPAN style="COLOR: #da70d6"&gt;soap&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #0000ff"&gt;Envelope&lt;/SPAN&gt; &lt;SPAN style="COLOR: #da70d6"&gt;xmlns&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #b8860b"&gt;soap&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"http://schemas.xmlsoap.org/soap/envelope/"&lt;/SPAN&gt;&amp;gt;
  &amp;lt;&lt;SPAN style="COLOR: #da70d6"&gt;soap&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #0000ff"&gt;Body&lt;/SPAN&gt;&amp;gt;
    &amp;lt;&lt;SPAN style="COLOR: #0000ff"&gt;GetItem&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;xmlns&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"http://schemas.microsoft.com/exchange/services/2006/messages"&lt;/SPAN&gt;&amp;gt;
      &amp;lt;&lt;SPAN style="COLOR: #0000ff"&gt;ItemShape&lt;/SPAN&gt;&amp;gt;
        &amp;lt;&lt;SPAN style="COLOR: #0000ff"&gt;BaseShape&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;xmlns&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"http://schemas.microsoft.com/exchange/services/2006/types"&lt;/SPAN&gt;&amp;gt;Default&amp;lt;/&lt;SPAN style="COLOR: #0000ff"&gt;BaseShape&lt;/SPAN&gt;&amp;gt;
        &amp;lt;&lt;SPAN style="COLOR: #0000ff"&gt;AdditionalProperties&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;xmlns&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"http://schemas.microsoft.com/exchange/services/2006/types"&lt;/SPAN&gt;&amp;gt;
          &amp;lt;&lt;SPAN style="COLOR: #0000ff"&gt;FieldURI&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;FieldURI&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"item:Subject"&lt;/SPAN&gt; /&amp;gt;
          &amp;lt;&lt;SPAN style="COLOR: #0000ff"&gt;FieldURI&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;FieldURI&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"item:Body"&lt;/SPAN&gt; /&amp;gt;
          &amp;lt;&lt;SPAN style="COLOR: #0000ff"&gt;FieldURI&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;FieldURI&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"item:Categories"&lt;/SPAN&gt; /&amp;gt;
          &amp;lt;&lt;SPAN style="COLOR: #0000ff"&gt;ExtendedFieldURI&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;PropertySetId&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"0006200E-0000-0000-C000-000000000046"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;PropertyId&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"35584"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;PropertyType&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"Integer"&lt;/SPAN&gt; /&amp;gt;
          &amp;lt;&lt;SPAN style="COLOR: #0000ff"&gt;ExtendedFieldURI&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;PropertyTag&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"0x10F3"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;PropertyType&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"String"&lt;/SPAN&gt; /&amp;gt;
          &amp;lt;&lt;SPAN style="COLOR: #0000ff"&gt;ExtendedFieldURI&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;PropertyTag&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"0x3008"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;PropertyType&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"SystemTime"&lt;/SPAN&gt; /&amp;gt;
        &amp;lt;/&lt;SPAN style="COLOR: #0000ff"&gt;AdditionalProperties&lt;/SPAN&gt;&amp;gt;
      &amp;lt;/&lt;SPAN style="COLOR: #0000ff"&gt;ItemShape&lt;/SPAN&gt;&amp;gt;
      &amp;lt;&lt;SPAN style="COLOR: #0000ff"&gt;ItemIds&lt;/SPAN&gt;&amp;gt;
        &amp;lt;&lt;SPAN style="COLOR: #0000ff"&gt;ItemId&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;Id&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"AAAZAERpbm8uQ2hpZXNhQG1pY3Jvc29mdC5jb20ARgAAAAAALBHixAbt0hGt6gCAX5/eGgcAd75VstDi0RGt3QCAX5/eGgAAAnopngAAEKx2OMNuVUuHEMvofVOxpwANFT4iewAA"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;ChangeKey&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"AAAAABQAAAAdMskaJAAzTpK1s6mN4vCnAAhyCw=="&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;xmlns&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"http://schemas.microsoft.com/exchange/services/2006/types"&lt;/SPAN&gt; /&amp;gt;
&lt;/PRE&gt;&lt;/DIV&gt;
&lt;P&gt;Broken flow from a JAXWS app to Exchange:&lt;/P&gt;
&lt;DIV style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 2pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 2pt; FONT-SIZE: 9pt; BACKGROUND: white; PADDING-BOTTOM: 2pt; BORDER-LEFT: windowtext 1pt solid; COLOR: black; LINE-HEIGHT: 98%; PADDING-TOP: 2pt; BORDER-BOTTOM: windowtext 1pt solid; FONT-FAMILY: Consolas, Courier New"&gt;&lt;PRE&gt;&amp;lt;&lt;SPAN style="COLOR: #da70d6"&gt;S&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #0000ff"&gt;Envelope&lt;/SPAN&gt; &lt;SPAN style="COLOR: #da70d6"&gt;xmlns&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #b8860b"&gt;S&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"http://schemas.xmlsoap.org/soap/envelope/"&lt;/SPAN&gt;&amp;gt;
  &amp;lt;&lt;SPAN style="COLOR: #da70d6"&gt;S&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #0000ff"&gt;Header&lt;/SPAN&gt;&amp;gt;
    &amp;lt;&lt;SPAN style="COLOR: #da70d6"&gt;ns2&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #0000ff"&gt;RequestServerVersion&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;xmlns&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"http://schemas.microsoft.com/exchange/services/2006/messages"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #da70d6"&gt;xmlns&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #b8860b"&gt;ns2&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"http://schemas.microsoft.com/exchange/services/2006/types"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;Version&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"Exchange2007_SP1"&lt;/SPAN&gt; /&amp;gt;
  &amp;lt;/&lt;SPAN style="COLOR: #da70d6"&gt;S&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #0000ff"&gt;Header&lt;/SPAN&gt;&amp;gt;
  &amp;lt;&lt;SPAN style="COLOR: #da70d6"&gt;S&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #0000ff"&gt;Body&lt;/SPAN&gt;&amp;gt;
    &amp;lt;&lt;SPAN style="COLOR: #0000ff"&gt;GetItem&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;xmlns&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"http://schemas.microsoft.com/exchange/services/2006/messages"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #da70d6"&gt;xmlns&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #b8860b"&gt;ns2&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"http://schemas.microsoft.com/exchange/services/2006/types"&lt;/SPAN&gt;&amp;gt;
      &amp;lt;&lt;SPAN style="COLOR: #0000ff"&gt;ItemShape&lt;/SPAN&gt;&amp;gt;
        &amp;lt;&lt;SPAN style="COLOR: #da70d6"&gt;ns2&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #0000ff"&gt;BaseShape&lt;/SPAN&gt;&amp;gt;Default&amp;lt;/&lt;SPAN style="COLOR: #da70d6"&gt;ns2&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #0000ff"&gt;BaseShape&lt;/SPAN&gt;&amp;gt;
        &amp;lt;&lt;SPAN style="COLOR: #da70d6"&gt;ns2&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #0000ff"&gt;AdditionalProperties&lt;/SPAN&gt;&amp;gt;
          &amp;lt;&lt;SPAN style="COLOR: #da70d6"&gt;ns2&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #0000ff"&gt;Path&lt;/SPAN&gt; &lt;SPAN style="COLOR: #da70d6"&gt;xmlns&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #b8860b"&gt;xsi&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"http://www.w3.org/2001/XMLSchema-instance"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #da70d6"&gt;xsi&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #b8860b"&gt;type&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"ns2:PathToUnindexedFieldType"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;FieldURI&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"item:Subject"&lt;/SPAN&gt; /&amp;gt;
          &amp;lt;&lt;SPAN style="COLOR: #da70d6"&gt;ns2&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #0000ff"&gt;Path&lt;/SPAN&gt; &lt;SPAN style="COLOR: #da70d6"&gt;xmlns&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #b8860b"&gt;xsi&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"http://www.w3.org/2001/XMLSchema-instance"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #da70d6"&gt;xsi&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #b8860b"&gt;type&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"ns2:PathToUnindexedFieldType"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;FieldURI&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"item:Body"&lt;/SPAN&gt; /&amp;gt;
          &amp;lt;&lt;SPAN style="COLOR: #da70d6"&gt;ns2&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #0000ff"&gt;Path&lt;/SPAN&gt; &lt;SPAN style="COLOR: #da70d6"&gt;xmlns&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #b8860b"&gt;xsi&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"http://www.w3.org/2001/XMLSchema-instance"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #da70d6"&gt;xsi&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #b8860b"&gt;type&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"ns2:PathToUnindexedFieldType"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;FieldURI&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"item:Categories"&lt;/SPAN&gt; /&amp;gt;
        &amp;lt;/&lt;SPAN style="COLOR: #da70d6"&gt;ns2&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #0000ff"&gt;AdditionalProperties&lt;/SPAN&gt;&amp;gt;
      &amp;lt;/&lt;SPAN style="COLOR: #0000ff"&gt;ItemShape&lt;/SPAN&gt;&amp;gt;
      &amp;lt;&lt;SPAN style="COLOR: #0000ff"&gt;ItemIds&lt;/SPAN&gt;&amp;gt;
        &amp;lt;&lt;SPAN style="COLOR: #da70d6"&gt;ns2&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #0000ff"&gt;ItemId&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;ChangeKey&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"AAAAABQAAAAdMskaJAAzTpK1s6mN4vCnAAhyCw=="&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;Id&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"AAMkAGUwNmJhYWVjLTI1ZTgtMTFkMy05MDc5LTAwODA1ZjMxZjgyNgBGAAAAAAAsEeLEBu3SEa3qAIBfn94aBwB3vlWy0OLREa3dAIBfn94aAAACeimeAAAQrHY4w25VS4cQy+h9U7GnAA0VPiJ7AAA="&lt;/SPAN&gt; /&amp;gt;
&lt;/PRE&gt;&lt;/DIV&gt;
&lt;P&gt;Exchange wasn't sending me the data I expected, because the JAXWS request message was not what Exchange expected it to be. With this understanding, I looked into the contract. For the element in question, the schema used a ref="type" structure, and this was the only use of the ref in the entire contract. Clearly causing a problem; JAXWS was formatting it strangely. I modified it to eliminate the ref, just as a test. &lt;/P&gt;
&lt;DIV style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 2pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 2pt; FONT-SIZE: 9pt; BACKGROUND: white; PADDING-BOTTOM: 2pt; BORDER-LEFT: windowtext 1pt solid; COLOR: black; LINE-HEIGHT: 98%; PADDING-TOP: 2pt; BORDER-BOTTOM: windowtext 1pt solid; FONT-FAMILY: Consolas, Courier New"&gt;&lt;PRE&gt;  &lt;SPAN style="COLOR: #b22222"&gt;&amp;lt;!-- &lt;/SPAN&gt;&lt;SPAN style="COLOR: #b22222"&gt;Arrays of paths &lt;/SPAN&gt;&lt;SPAN style="COLOR: #b22222"&gt;--&amp;gt;&lt;/SPAN&gt;
  &amp;lt;&lt;SPAN style="COLOR: #da70d6"&gt;xs&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #0000ff"&gt;complexType&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;name&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"NonEmptyArrayOfPathsToElementType"&lt;/SPAN&gt;&amp;gt;
    &lt;SPAN style="COLOR: #b22222"&gt;&amp;lt;!-- &lt;/SPAN&gt;&lt;SPAN style="COLOR: #b22222"&gt;using choice here so that proxy generator will not flatten the array and thus lose the
                item element names &lt;/SPAN&gt;&lt;SPAN style="COLOR: #b22222"&gt;--&amp;gt;&lt;/SPAN&gt;
    &amp;lt;&lt;SPAN style="COLOR: #da70d6"&gt;xs&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #0000ff"&gt;choice&lt;/SPAN&gt; maxOccurs =&lt;SPAN style="COLOR: #bc8f8f"&gt;"unbounded"&lt;/SPAN&gt;&amp;gt;
&lt;SPAN style="COLOR: #b22222"&gt;&amp;lt;!-- &lt;/SPAN&gt;&lt;SPAN style="COLOR: #b22222"&gt;dinoch - change for jaxws &lt;/SPAN&gt;&lt;SPAN style="COLOR: #b22222"&gt;--&amp;gt;&lt;/SPAN&gt;
  &amp;lt;&lt;SPAN style="COLOR: #da70d6"&gt;xs&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #0000ff"&gt;element&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;name&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"Path"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;type&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"t:BasePathToElementType"&lt;/SPAN&gt;/&amp;gt;
  &amp;lt;&lt;SPAN style="COLOR: #da70d6"&gt;xs&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #0000ff"&gt;element&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;name&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"FieldURI"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;type&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"t:PathToUnindexedFieldType"&lt;/SPAN&gt; /&amp;gt;
  &amp;lt;&lt;SPAN style="COLOR: #da70d6"&gt;xs&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #0000ff"&gt;element&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;name&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"IndexedFieldURI"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;type&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"t:PathToIndexedFieldType"&lt;/SPAN&gt; /&amp;gt;
  &amp;lt;&lt;SPAN style="COLOR: #da70d6"&gt;xs&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #0000ff"&gt;element&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;name&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"ExtendedFieldURI"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;type&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"t:PathToExtendedFieldType"&lt;/SPAN&gt;/&amp;gt;

&lt;SPAN style="COLOR: #b22222"&gt;&amp;lt;!--&lt;/SPAN&gt;&lt;SPAN style="COLOR: #b22222"&gt;
      &amp;lt;xs:element ref="t:Path"/&amp;gt;
&lt;/SPAN&gt;&lt;SPAN style="COLOR: #b22222"&gt;--&amp;gt;&lt;/SPAN&gt;

    &amp;lt;/&lt;SPAN style="COLOR: #da70d6"&gt;xs&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #0000ff"&gt;choice&lt;/SPAN&gt;&amp;gt;
  &amp;lt;/&lt;SPAN style="COLOR: #da70d6"&gt;xs&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #0000ff"&gt;complexType&lt;/SPAN&gt;&amp;gt;
&lt;/PRE&gt;&lt;/DIV&gt;
&lt;P&gt;After re-generating the client-side stubs, I was able to get the GetItem message to work nicely. Here's the message from JAXWS after the change in schema: &lt;/P&gt;
&lt;DIV style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 2pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 2pt; FONT-SIZE: 9pt; BACKGROUND: white; PADDING-BOTTOM: 2pt; BORDER-LEFT: windowtext 1pt solid; COLOR: black; LINE-HEIGHT: 98%; PADDING-TOP: 2pt; BORDER-BOTTOM: windowtext 1pt solid; FONT-FAMILY: Consolas, Courier New"&gt;&lt;PRE&gt;&amp;lt;&lt;SPAN style="COLOR: #da70d6"&gt;S&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #0000ff"&gt;Envelope&lt;/SPAN&gt; &lt;SPAN style="COLOR: #da70d6"&gt;xmlns&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #b8860b"&gt;S&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"http://schemas.xmlsoap.org/soap/envelope/"&lt;/SPAN&gt;&amp;gt;
  &amp;lt;&lt;SPAN style="COLOR: #da70d6"&gt;S&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #0000ff"&gt;Header&lt;/SPAN&gt;&amp;gt;
    &amp;lt;&lt;SPAN style="COLOR: #da70d6"&gt;ns2&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #0000ff"&gt;RequestServerVersion&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;xmlns&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"http://schemas.microsoft.com/exchange/services/2006/messages"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #da70d6"&gt;xmlns&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #b8860b"&gt;ns2&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"http://schemas.microsoft.com/exchange/services/2006/types"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;Version&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"Exchange2007_SP1"&lt;/SPAN&gt; /&amp;gt;
  &amp;lt;/&lt;SPAN style="COLOR: #da70d6"&gt;S&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #0000ff"&gt;Header&lt;/SPAN&gt;&amp;gt;
  &amp;lt;&lt;SPAN style="COLOR: #da70d6"&gt;S&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #0000ff"&gt;Body&lt;/SPAN&gt;&amp;gt;
    &amp;lt;&lt;SPAN style="COLOR: #0000ff"&gt;GetItem&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;xmlns&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"http://schemas.microsoft.com/exchange/services/2006/messages"&lt;/SPAN&gt; &lt;SPAN style="COLOR: #da70d6"&gt;xmlns&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #b8860b"&gt;ns2&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"http://schemas.microsoft.com/exchange/services/2006/types"&lt;/SPAN&gt;&amp;gt;
      &amp;lt;&lt;SPAN style="COLOR: #0000ff"&gt;ItemShape&lt;/SPAN&gt;&amp;gt;
        &amp;lt;&lt;SPAN style="COLOR: #da70d6"&gt;ns2&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #0000ff"&gt;BaseShape&lt;/SPAN&gt;&amp;gt;Default&amp;lt;/&lt;SPAN style="COLOR: #da70d6"&gt;ns2&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #0000ff"&gt;BaseShape&lt;/SPAN&gt;&amp;gt;
        &amp;lt;&lt;SPAN style="COLOR: #da70d6"&gt;ns2&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #0000ff"&gt;AdditionalProperties&lt;/SPAN&gt;&amp;gt;
          &amp;lt;&lt;SPAN style="COLOR: #da70d6"&gt;ns2&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #0000ff"&gt;FieldURI&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;FieldURI&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"item:Subject"&lt;/SPAN&gt; /&amp;gt;
          &amp;lt;&lt;SPAN style="COLOR: #da70d6"&gt;ns2&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #0000ff"&gt;FieldURI&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;FieldURI&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"item:Body"&lt;/SPAN&gt; /&amp;gt;
          &amp;lt;&lt;SPAN style="COLOR: #da70d6"&gt;ns2&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #0000ff"&gt;FieldURI&lt;/SPAN&gt; &lt;SPAN style="COLOR: #b8860b"&gt;FieldURI&lt;/SPAN&gt;=&lt;SPAN style="COLOR: #bc8f8f"&gt;"item:Categories"&lt;/SPAN&gt; /&amp;gt;
        &amp;lt;/&lt;SPAN style="COLOR: #da70d6"&gt;ns2&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #0000ff"&gt;AdditionalProperties&lt;/SPAN&gt;&amp;gt;
      &amp;lt;/&lt;SPAN style="COLOR: #0000ff"&gt;ItemShape&lt;/SPAN&gt;&amp;gt;
      &amp;lt;&lt;SPAN style="COLOR: #0000ff"&gt;ItemIds&lt;/SPAN&gt;&amp;gt;
&lt;/PRE&gt;&lt;/DIV&gt;
&lt;P&gt;After that, it was a matter of writing up the code to use the jaxws-generated stubs. It all works nicely now. It's pretty darn fast, too! &lt;/P&gt;
&lt;P&gt;Let me summarize what I did to get Java to talk to Exchange:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Modified the exchange.wsdl to include a service definition, and to remove all occurrences of impersonation, S2SAuth, and MailboxCulture from each wsdl:message.&lt;/LI&gt;
&lt;LI&gt;Modified the types.xsd to eliminate the ref="t:Path", and replace it with actual elements&lt;/LI&gt;
&lt;LI&gt;Use Fiddler2 to trace and debug the SOAP messages. &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;The bottom line is that web services interop is possible even with complicated schema and interfaces, if you are willing to get your hands dirty on the schema, and if you choose the right tools. &lt;/P&gt;
&lt;P&gt;In part 2 of this story, I'll show you some of the application code that uses the JAXWS-generated client classes, and I'll pack up the source code for everything too. &lt;/P&gt;
&lt;P&gt;Great resources: &lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="http://tp.its.yale.edu/confluence/display/EXCH/Introduction+to+MS+Exchange+Web+Services+via+Java%28JAXWS%29?focusedCommentId=3080591" mce_href="http://tp.its.yale.edu/confluence/display/EXCH/Introduction+to+MS+Exchange+Web+Services+via+Java%28JAXWS%29?focusedCommentId=3080591"&gt;Good hints from a Yaley&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/cc540448(EXCHG.80).aspx" mce_href="http://msdn.microsoft.com/en-us/library/cc540448(EXCHG.80).aspx"&gt;Tech article library on MSDN, covering Exchange Web Services&lt;/A&gt; &lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://www.fiddler2.com/Fiddler2/" mce_href="http://www.fiddler2.com/Fiddler2/"&gt;Fiddler2&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="http://forums.microsoft.com/TechNet/ShowForum.aspx?ForumID=838&amp;amp;SiteID=17" mce_href="http://forums.microsoft.com/TechNet/ShowForum.aspx?ForumID=838&amp;amp;SiteID=17"&gt;TechNet forum on Exchange Development&lt;/A&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Cheers, &lt;BR&gt;-Dino &lt;/P&gt;&lt;/FONT&gt;&lt;!-- ------------------------------------------------------- --&gt;&lt;/FONT&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8789662" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/Interop/default.aspx">Interop</category><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/AXIS/default.aspx">AXIS</category><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/XML/default.aspx">XML</category><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/Java/default.aspx">Java</category><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/Exchange/default.aspx">Exchange</category><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/JAXWS/default.aspx">JAXWS</category></item><item><title>Facebook Thrift, Google ProtoBufs, and Interop</title><link>http://blogs.msdn.com/dotnetinterop/archive/2008/07/10/facebook-thrift-google-protobufs-and-interop.aspx</link><pubDate>Thu, 10 Jul 2008 21:49:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8718231</guid><dc:creator>DotNetInterop</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/dotnetinterop/comments/8718231.aspx</comments><wfw:commentRss>http://blogs.msdn.com/dotnetinterop/commentrss.aspx?PostID=8718231</wfw:commentRss><description>&lt;P&gt;Dare had an &lt;A class="" href="http://www.25hoursaday.com/weblog/2008/07/10/TheRevengeOfRPCGoogleProtocolBuffersAndFacebookThrift.aspx" mce_href="http://www.25hoursaday.com/weblog/2008/07/10/TheRevengeOfRPCGoogleProtocolBuffersAndFacebookThrift.aspx"&gt;en-pointe analysis&lt;/A&gt; of the emergence of various new non-standarcd communications protocols, such as &lt;A class="" href="http://developers.facebook.com/thrift/" mce_href="http://developers.facebook.com/thrift/"&gt;Facebook Thrift&lt;/A&gt; and &lt;A class="" href="http://code.google.com/p/protobuf/" mce_href="http://code.google.com/p/protobuf/"&gt;Google Protocol buffers&lt;/A&gt;, and how they compare to the standards-based comms protocols like RSS, ATOM or even WS-*.&amp;nbsp; Dare correctly points out that these tools can be useful if you tightly control the endpoints involved in the communication, and, if you're certain the set of communicating endpoints&amp;nbsp;will never expand to include anything you don't tightly control (acquisition?&amp;nbsp;partner?).&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&lt;EM&gt;[I updated this blog entry a couple days after it was first published.&amp;nbsp; The text added is enclosed in square brackets.]&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;After one is accustomed to fire and police protection, and very smooth roads, and&amp;nbsp;storm sewers that keep the roads clear when it rains, it can be easy to forget, and to&amp;nbsp;chafe under the income tax burden that keeps all those government systems functioning.&amp;nbsp; &amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the same way, paying the angle-bracket-tax can get annoying after a while, too.&amp;nbsp; Starting in 1999 or so, we, as an industry, moved away from binary &lt;EM&gt;[remote-procedure call]&lt;/EM&gt; protocols such as those dragged in by DCE RPC, CORBA IIOP, Microsoft DCOM, or Java RMI.&amp;nbsp; Instead we have invested heavily in the development of tools and frameworks&amp;nbsp;&amp;nbsp;that use an XML-based message-passing paradigm to improve interop.&amp;nbsp; We achieved critical mass on &lt;EM&gt;[message-based]&lt;/EM&gt;communication standards, and everyone was happy.&amp;nbsp; Except now some of us are not, and we apparently want RPC again. &lt;/P&gt;
&lt;P&gt;We want binary serialization because it is so darn efficient.&amp;nbsp; We want opaque data formats because those angle brackets are just so tiresome. &lt;/P&gt;
&lt;P&gt;Well, we embrace those efficiencies at our peril.&amp;nbsp; We have been here before!&amp;nbsp;&amp;nbsp; I am not saying that there is no place for Protocol Bugg^H^Hffers.&amp;nbsp; What I am saying is that we as an industry shifted to XML-based message passing for a good reason, and that reason has not disappeared.&amp;nbsp; We're used to the smooth roads and working sewers.&amp;nbsp; Let's not have a revolution and toss all that aside.&amp;nbsp; Use optimized communications where it makes sense.&amp;nbsp;&lt;EM&gt;[And don't drag in RPC when all we want is binary serialization.]&lt;/EM&gt; &amp;nbsp;Dare shows the way.&lt;/P&gt;
&lt;P&gt;Last thing - just dreaming a bit here... wouldn't it be cool for developers if there was a single programming framework that could do angle brackets as well as optimized binary transfers?&amp;nbsp;&lt;EM&gt;[And everything was a message? Not a remote procedure call in sight?]&lt;/EM&gt; &amp;nbsp;Wouldn't it be cool if you could code it once, and then select the serialization mechanism at configuration time, in metadata.&amp;nbsp; Wait, wouldn't it be even coooler if .. this is gonna sound crazy, but.... wouldn't it be cool if we could have multiple communication endpoints running at the same time, each dedicated to a different wire protocol, but using the same backing business logic.&amp;nbsp; One endpoint could speak XML, another could speak binary, and they could run at the same time.&amp;nbsp; &amp;nbsp; &lt;A class="" href="http://msdn.microsoft.com/en-us/netframework/aa663324.aspx" mce_href="http://msdn.microsoft.com/en-us/netframework/aa663324.aspx"&gt;That &lt;EM&gt;would &lt;/EM&gt;be cool&lt;/A&gt;, wouldn't it? &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8718231" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/Interop/default.aspx">Interop</category><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/XML/default.aspx">XML</category><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/WCF/default.aspx">WCF</category></item><item><title>Open Source and Interoperability</title><link>http://blogs.msdn.com/dotnetinterop/archive/2008/06/18/open-source-and-interoperability.aspx</link><pubDate>Wed, 18 Jun 2008 17:42:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8611070</guid><dc:creator>DotNetInterop</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/dotnetinterop/comments/8611070.aspx</comments><wfw:commentRss>http://blogs.msdn.com/dotnetinterop/commentrss.aspx?PostID=8611070</wfw:commentRss><description>&lt;P&gt;Open. Source. Is. Not. Interoperability.&lt;/P&gt;
&lt;P&gt;&lt;A class="" href="http://www.tedneward.com/" mce_href="http://www.tedneward.com/"&gt;Ted Neward&lt;/A&gt; is an entertaining and talented writer, not to mention a stand-up guy, and a first-rate technogeek.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But that doesn't mean he is always right. I was just reading and &lt;A class="" href="http://blogs.tedneward.com/2008/04/02/Is+Microsoft+Serious.aspx" mce_href="http://blogs.tedneward.com/2008/04/02/Is+Microsoft+Serious.aspx"&gt;old post of his&lt;/A&gt; which I missed during my unscheduled sabbatical, in which he writes:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;EM&gt;They [Microsoft] need to have an interoperability story that developers can believe in, which means some kind of open-source-friendly play&lt;/EM&gt;, &lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I still, &lt;B&gt;still&lt;/B&gt; totally do not get why Interop and Open Source are used so interchangeably, by so many people.&amp;nbsp; Often by people&amp;nbsp;whose viewpoints I respect,&amp;nbsp;such as the esteemed Mr Neward.&amp;nbsp;Or if not used interchangeably, why they are viewed as so closely related by so many people.&amp;nbsp; I do not see these two things&amp;nbsp;as mutually dependent. They are completely independent factors.&lt;/P&gt;
&lt;P&gt;Interop is not open source.&amp;nbsp; Open source does not guarantee interop.&amp;nbsp;Period. &lt;/P&gt;
&lt;P&gt;I am not making quality judgments on either open source or interop.&amp;nbsp; I am not saying that one of them is good and one is bad.&amp;nbsp; &lt;EM&gt;I am saying &lt;/EM&gt;they are two different things.&amp;nbsp; They are "silicon based computers" and "big endian bit ordering".&amp;nbsp; They are related, they are neighbors, they are acquaintances, but they are not interchangeable.&amp;nbsp; Nor does one imply the other. &amp;nbsp; &lt;/P&gt;
&lt;P&gt;Repeat after me: &lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Interop is not open source.&lt;/LI&gt;
&lt;LI&gt;Interop does not require open source implementations&lt;/LI&gt;
&lt;LI&gt;Open source does not guarantee Interop &lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;People will disagree with this; I expect to hear some feedback saying "With open source I can see the code and therefore it is easier to build something that interconnects with it."&amp;nbsp; I'm not buying that.&amp;nbsp; That is lazy thinking or bad engineering or both. &amp;nbsp; I can imagine that open source would imply interop, if you limit the&amp;nbsp;definition of interoperability to mean "connect with previously written code in the same executable image."&amp;nbsp; In other words, merging distinct code bases.&amp;nbsp; This is a case where just linking up to a shared library can work, but sometimes seeing the code allows some better opportunity.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;But this limited definition of interoperability is definitely not the mainstream one that companies and organizations are dealing with today.&amp;nbsp; They want to connect large lego blocks together: Connect System A&amp;nbsp; and System B together in a business process flow that makes sense, and which may evolve over time.&amp;nbsp;&amp;nbsp;Large-grained interop.&amp;nbsp; This is not merging two distinct code bases together.&amp;nbsp;&amp;nbsp;Oftentimes the "code base" is not available - it is a pre-packed app.&amp;nbsp; Maybe it is Oracle, or maybe it is a Salesforce.com app.&amp;nbsp; Maybe the other end is a Sharepoint Portal, or a Medical Records management system from Lawson.&amp;nbsp; These might be called system-to-system interop or app-to-app interop if you like, where network protocols are the thing, not compile-time-constants.&amp;nbsp; Data interfaces, not code classes or interfaces. &lt;/P&gt;
&lt;P&gt;In that situation, which I am arguing is THE mainstream challenge that architects and devs confront when they use the word "interop", looking at &amp;nbsp;source code is not helpful, and I won't hesitate to argue, I think it would be &lt;EM&gt;counterproductive&lt;/EM&gt;.&amp;nbsp;&amp;nbsp; Yeah, you read me right - it actually is &lt;U&gt;harmful &lt;/U&gt;to look at the code if you want to connect two big apps together. &lt;/P&gt;
&lt;P&gt;What is necessary to enable interop in these cases is &lt;STRONG&gt;PROTOCOLS&lt;/STRONG&gt;, people.&amp;nbsp; Standard protocols would be nice to have, but don't misunderstand - &lt;EM&gt;standardized protocols are not a requirement for interop&lt;/EM&gt;.&amp;nbsp; The requirement is for PUBLISHED protocols, not necessarily standard ones.&amp;nbsp; PUBLISHED NETWORK PROTOCOLS ALLOW INTEROP.&amp;nbsp; This is why a Java or .NET app can connect to an IBM transaction processing system, even though the on-the-wire protocols are completely closed and proprietary to IBM.&amp;nbsp; The protocols are &lt;EM&gt;documented&lt;/EM&gt;.&amp;nbsp;&amp;nbsp;&amp;nbsp; They are closed yet published.&amp;nbsp; And because IBM's DTP protocols are published (not publicly per se, but published to those who license the protocols), anyone can implement the client-side of the exchange. &lt;/P&gt;
&lt;P&gt;The same goes true for, say, Microsoft SQL Server. There is an on-the-wire protocol known as TDS, also known as &lt;A class="" href="http://msdn.microsoft.com/en-US/library/ms191220.aspx" mce_href="http://msdn.microsoft.com/en-US/library/ms191220.aspx"&gt;tabular data stream&lt;/A&gt;.&amp;nbsp; Microsoft publishes TDS under license to partners, but I believe some have reverse-engineered it.&amp;nbsp; The fact that the protocol is constant and published means that, for example, DataDirect can build an OLEDB driver or a type-4 JDBC driver&amp;nbsp;for SQL Server.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;It's the Protocols, Silly! &lt;/P&gt;
&lt;P&gt;Standardized protocols are nice to have because the standard, if it is based on freely-available IP (or at the very least, IP available under &lt;A class="" href="http://en.wikipedia.org/wiki/Reasonable_and_Non_Discriminatory_Licensing" mce_href="http://en.wikipedia.org/wiki/Reasonable_and_Non_Discriminatory_Licensing"&gt;RAND&lt;/A&gt; terms), encourages wider adoption and thus the virtuous cycle inherent in &lt;A class="" href="http://en.wikipedia.org/wiki/Metcalfe%27s_law" mce_href="http://en.wikipedia.org/wiki/Metcalfe%27s_law"&gt;Metcalfe's Law&lt;/A&gt;.&amp;nbsp; Standardized protocols are essential if you want &lt;EM&gt;broad &lt;/EM&gt;interoperability, which of course is really important, and is what most of us are after anyway.&amp;nbsp; Above I said that standards are not required, and I stand by that statement.&amp;nbsp; But practically speaking, standards are almost a &lt;EM&gt;&lt;A class="" href="http://encarta.msn.com/dictionary_/sine-qua-non.html" mce_href="http://encarta.msn.com/dictionary_/sine-qua-non.html"&gt;sine-qua-non&lt;/A&gt; &lt;/EM&gt;of meaningful interop.&amp;nbsp; &amp;nbsp; &lt;/P&gt;
&lt;P&gt;Web Services and XML are just common protocols, and their widespread adoption (owing in large part to the fact that they are standards) is the true source of their value to companies and organizations (again see &lt;A class="" href="http://en.wikipedia.org/wiki/Metcalfe%27s_law" mce_href="http://en.wikipedia.org/wiki/Metcalfe%27s_law"&gt;Metcalfe's Law&lt;/A&gt;).&amp;nbsp; It is not required that web service endpoints, either client or server, be implemented with an open-source web services stack, in order to get good interoperability.&amp;nbsp; Instead it is essential that the endpoints conform to the standard protocol definitions.&amp;nbsp; And the corollary is, the protocol definitions must be sufficiently clear, complete, relatively simple to implement, and relatively simple to test, such that faithful implementations of the protocols can eb validated easily and will interconnect transparently.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is why .NET WCF clients can easily interconnect with Web Services enpoints running under IBM WebSphere App Server, though neither the .NET Framework nor the WebSphere web services libraries are open source.&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;Open Source Is Not Interoperability.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8611070" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/Interop/default.aspx">Interop</category><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/XML/default.aspx">XML</category><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/Websphere/default.aspx">Websphere</category><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/Java/default.aspx">Java</category><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/Web+Service/default.aspx">Web Service</category></item><item><title>Java/XML Binding Options?  WebSphere prefers JAXB 2.0...</title><link>http://blogs.msdn.com/dotnetinterop/archive/2008/03/24/java-xml-binding-options-websphere-prefers-jaxb-2-0.aspx</link><pubDate>Mon, 24 Mar 2008 17:54:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8331690</guid><dc:creator>DotNetInterop</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/dotnetinterop/comments/8331690.aspx</comments><wfw:commentRss>http://blogs.msdn.com/dotnetinterop/commentrss.aspx?PostID=8331690</wfw:commentRss><description>&lt;P&gt;I'm looking to&amp;nbsp;put together more Java and .NET interop samples.&amp;nbsp;If any of you have any particular requests, let me know.&amp;nbsp; One of the key areas for interop I'm looking at is XML serialization.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;Today I was scanning the web looking for insight into the leading Java-to-XML binding frameworks.&amp;nbsp;For those of you who are .NET literate but not Java literate, "&lt;A class="" href="http://en.wikipedia.org/wiki/XML_data_binding" mce_href="http://en.wikipedia.org/wiki/XML_data_binding"&gt;XML data binding&lt;/A&gt;" is the term Java people (and maybe programmers for other platforms too) use for what we .NET-heads call "XML Serialization".&amp;nbsp; &amp;nbsp;According to my unofficial count, there are, let's see... ah...roughly..... &lt;EM&gt;a zillion &lt;/EM&gt;different options.&amp;nbsp;&amp;nbsp; XStream, &lt;A class="" href="http://xmlbeans.apache.org/" mce_href="http://xmlbeans.apache.org/"&gt;XMLBeans&lt;/A&gt;, &lt;A class="" href="http://en.wikipedia.org/wiki/JAXB" mce_href="http://en.wikipedia.org/wiki/JAXB"&gt;JAXB&lt;/A&gt;, &lt;A class="" href="http://jibx.sourceforge.net/" mce_href="http://jibx.sourceforge.net/"&gt;JiBX&lt;/A&gt;, &lt;A class="" href="http://www.castor.org/" mce_href="http://www.castor.org/"&gt;Castor&lt;/A&gt;, &lt;A class="" href="http://zeus.objectweb.org/" mce_href="http://zeus.objectweb.org/"&gt;Zeus&lt;/A&gt;, &lt;A class="" href="http://sourceforge.net/projects/jxquick" mce_href="http://sourceforge.net/projects/jxquick"&gt;Quick&lt;/A&gt;, etc.&amp;nbsp; Then there are the vendor options, like &lt;A class="" href="http://search.msn.com/results.aspx?q=electric+xml" mce_href="http://search.msn.com/results.aspx?q=electric+xml"&gt;Electric XML&lt;/A&gt; (from The Mind Electric, which was bought by Webmethods, which was bought by SoftwareAG, which ... ??&amp;nbsp;who knows what they are doing with Glue now? when I visited the &lt;A class="" href="http://www.webmethods.com/" mce_href="http://www.webmethods.com"&gt;webmethods.com&lt;/A&gt; website, it was down?).&amp;nbsp; At one point, Oracle had its own option, IBM had its own option, BEA's was what became XMLBeans (via the "Beehive" gambit), and there were many others, I'm sure.&lt;/P&gt;
&lt;P&gt;Let a thousand flowers bloom indeed. The problem with this "1000 flowers" approach is it presents a challenge to any developer who wants to just solve a problem.&amp;nbsp; Where's the critical mass?&amp;nbsp; Every developer has to go and &lt;A class="" href="http://search.msn.com/results.aspx?q=java+xml+binding" mce_href="http://search.msn.com/results.aspx?q=java+xml+binding"&gt;evaluate this decision&lt;/A&gt;, and who knows which is the right choice for any given set of circumstances?&amp;nbsp; Choice is great but too many choices can lead to higher decisions costs, and too much redundancy can stifle progress.&amp;nbsp; One set of devs learns techniques and tools for JiBX and the next set learns the same for XMLBeans and ne'er the twain shall meet.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;As I was looking, I learned that IBM's &lt;A class="" href="http://www-1.ibm.com/support/docview.wss?rs=180&amp;amp;uid=swg21264563" mce_href="http://www-1.ibm.com/support/docview.wss?rs=180&amp;amp;uid=swg21264563"&gt;WebSphere Feature Pack for Web Services&lt;/A&gt;, released in June 2007, &lt;A class="" href="http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.websphere.wsfep.multiplatform.doc/info/ae/ae/cwbs_jaxb.html" mce_href="http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.websphere.wsfep.multiplatform.doc/info/ae/ae/cwbs_jaxb.html"&gt;provides JAXB 2.0 support&lt;/A&gt; as the preferred Java-XML binding mechanism.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;Seeing that JAXB is also the &lt;A class="" href="http://java.sun.com/developer/technicalArticles/WebServices/jaxb/" mce_href="http://java.sun.com/developer/technicalArticles/WebServices/jaxb/"&gt;JCP-blessed option&lt;/A&gt;, it seems like the question "Which Java-XML binding framework is the mainstream one?" has been answered. Maybe this discussion has been over for a long time and I just missed the memo?&lt;/P&gt;
&lt;P&gt;I am sure there will be numerous little frameworks that continue to explore the boundaries of XML-to-Java data binding, but JAXB seems like the mainstream winner approach for now.&amp;nbsp; It is the Honda Accord or Toyota Camry of Java-to-XML binding - a safe, reliable, well-supported, well-known choice. Other options may have nifty features or cooler styling, but parts, service and maintenance on the Accord is going to be cheap and easy in the long term.&amp;nbsp; You can't go wrong wiith that.&lt;/P&gt;
&lt;P mce_keep="true"&gt;I've produced numerous examples of how to interoperate between Java and .NET using XML, and I chose other frameworks for the Java side, including &lt;A class="" href="http://blogs.msdn.com/dotnetinterop/archive/2005/02/11/apache-xmlbeans-and-net-xml-serialization.aspx" mce_href="http://blogs.msdn.com/dotnetinterop/archive/2005/02/11/apache-xmlbeans-and-net-xml-serialization.aspx"&gt;XMLBeans&lt;/A&gt; and &lt;A class="" href="http://blogs.msdn.com/dotnetinterop/archive/2007/10/10/date-and-time-values-and-xstream-interop.aspx" mce_href="http://blogs.msdn.com/dotnetinterop/archive/2007/10/10/date-and-time-values-and-xstream-interop.aspx"&gt;most recently, XStream&lt;/A&gt;, but at this point I think JAXB is going to be my mainstream preference for an Java XML data binding framework going forward.&lt;/P&gt;
&lt;P mce_keep="true"&gt;If anyone has any guidance that disagrees with this, please advise!&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8331690" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/Interop/default.aspx">Interop</category><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/XML/default.aspx">XML</category><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/Websphere/default.aspx">Websphere</category><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/Java/default.aspx">Java</category><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/JAXB/default.aspx">JAXB</category></item><item><title>How to Build a REST app in .NET (with WCF)</title><link>http://blogs.msdn.com/dotnetinterop/archive/2008/03/20/how-to-build-a-rest-app-in-net-with-wcf.aspx</link><pubDate>Thu, 20 Mar 2008 21:46:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8327651</guid><dc:creator>DotNetInterop</dc:creator><slash:comments>15</slash:comments><comments>http://blogs.msdn.com/dotnetinterop/comments/8327651.aspx</comments><wfw:commentRss>http://blogs.msdn.com/dotnetinterop/commentrss.aspx?PostID=8327651</wfw:commentRss><description>&lt;FONT face=Calibri&gt;&lt;SIZE=3&gt;
&lt;P&gt;My &lt;A href="http://blogs.msdn.com/dotnetinterop/archive/2008/03/18/how-to-build-a-rest-app-in-net-not.aspx" mce_href="http://blogs.msdn.com/dotnetinterop/archive/2008/03/18/how-to-build-a-rest-app-in-net-not.aspx"&gt;prior post&lt;/A&gt; talked about how NOT to write a REST app in .NET. I mentioned WCF as the preferred option. In this post, I'll describe the steps for how &lt;EM&gt;you should&lt;/EM&gt; do it. &lt;/P&gt;
&lt;H3&gt;Some background&lt;/H3&gt;
&lt;P&gt;First up, you should use &lt;A href="http://msdn2.microsoft.com/en-us/library/ms735119.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/ms735119.aspx"&gt;WCF&lt;/A&gt; to build your REST app. WCF is the &lt;B&gt;Windows Communication Foundation&lt;/B&gt;. (&lt;EM&gt;Microsoft has such a strong &lt;A href="http://encarta.msn.com/dictionary_/penchant.html" mce_href="http://encarta.msn.com/dictionary_/penchant.html"&gt;penchant&lt;/A&gt; for creating acronyms, that there are &lt;A href="http://www.ewbi.com/mlomsa/" mce_href="http://www.ewbi.com/mlomsa/"&gt;web sites dedicated solely to cataloging them.&lt;/A&gt; &lt;/EM&gt;) WCF is part of the .NET Framework, first added in .NET 3.0. WCF is used by applications developers when building apps that communicate, whether using REST, SOAP, or something else. These days, most applications need to communicate. &lt;/P&gt;
&lt;P&gt;The basic metaphor in WCF is that &lt;EM&gt;services&lt;/EM&gt; receive and respond to incoming communication, and clients initiate those communications. The communication is modeled as an &lt;B&gt;interface&lt;/B&gt; in code, and the service is a &lt;B&gt;class&lt;/B&gt; or type that implements that interface. Services run within a &lt;B&gt;host&lt;/B&gt; on any Windows computer - a desktop, laptop or a big server machine. You can also run services on Windows Mobile devices like smart phones! &lt;/P&gt;
&lt;P&gt;Therefore for any WCF app, you need a service interface, a service implementation, and a host. &lt;/P&gt;
&lt;P&gt;We'll be building a REST service - an application that receives and understands HTTP GET Requests according to the REST pattern. &lt;/P&gt;
&lt;H3&gt;No Visual Studio required&lt;/H3&gt;
&lt;P&gt;Contrary to what you may believe, you do not need to have Visual Studio in order to build .NET applications, including WCF applications. But all of the posts I have seen on the topic assume Visual Studio. VS2008 is the commercial application developer's tool that Microsoft sells; the 2008 version includes some nice WCF design and development tools. It is by far the easiest way to build a WCF app; using VS2008 to build WCF apps also allows you to take advantage of other Visual Studio goodies like unit testing, Intellisense, debugging, profiling, and so on. I highly recommend it. If, however, you just want to get something done quickly and you don't have and don't want to pay for the commercial tool, you can also build WCF apps using a text editor (like emacs), and the command line tools included in the .NET SDK (a free download). In this post, I will show you how. &lt;/P&gt;
&lt;H3&gt;Hosting a WCF Service&lt;/H3&gt;
&lt;P&gt;WCF provides various options when it comes to hosting a service. These options are: 
&lt;OL&gt;
&lt;LI&gt;"Self hosted" - within a Console or Windows Forms application.&lt;/LI&gt;
&lt;LI&gt;Hosted within IIS&lt;/LI&gt;
&lt;LI&gt;As a Windows Service&lt;/LI&gt;
&lt;LI&gt;Hosted within Windows Activation Service. This option was added with IIS7, available in Windows Vista or Windows Server 2008. &lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;You can read more about these options, and how to choose between them, &lt;A href="http://msdn2.microsoft.com/en-us/library/ms730158.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/ms730158.aspx"&gt;here&lt;/A&gt;. &lt;/P&gt;
&lt;H3&gt;My Recommendation: Do your WCF Prototype work in a self-hosted app.&lt;/H3&gt;
&lt;P&gt;If you are developing an application to prototype some ideas, then you probably want the simplest environment possible. This, for me, is often the self-hosted route - it gives me the most control and the lightweight approach I need. Hosting WCF services within IIS can also be a lightweight approach. For this post, though, I'm going to show you how to write a WCF app that is self-hosted in a console EXE. This way you can use the console output as a diagnostic tool while tweaking and tuning the app. You can start it and stop it manually. It's easy and accessible. &lt;/P&gt;
&lt;P&gt;There is a nifty WCF Service Host that is included as part of Visual Studio 2008, called &lt;A href="http://msdn2.microsoft.com/en-us/library/bb552363.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/bb552363.aspx"&gt;WcfSvcHost.exe&lt;/A&gt;. This is a Windows Forms app that hosts any WCF service you create. It collapses into the system tray, it's got some nice usability features. On the other hand, (1) I'm presuming no Visual Studio, so you don't have WcfSvcHost.exe, dear reader. And (2), this hosting app doesn't give me the control I want. [&lt;EM&gt;In particular, it does not give me control over how to handle errors in the service layer, which is something I really want.&lt;/EM&gt;]&lt;/P&gt;
&lt;P&gt;Rolling your own host for a WCF service is a pretty simple affair. Here's my code to do it. &lt;/P&gt;&lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue255;\red255\green255\blue255;\red0\green0\blue0;\red0\green128\blue0;\red43\green145\blue175;\red163\green21\blue21;}??\fs20 \cf1 namespace\cf0  ionic.samples.WcfRest\par ??\{\par ??\par ??    \cf4 // console-based app to Host the WCF / REST service \par ??\cf0     \cf1 public\cf0  \cf1 class\cf0  \cf5 ConsoleServiceHost\par ??\cf0     \{\par ??        \cf1 public\cf0  \cf1 static\cf0  \cf1 void\cf0  Main()\par ??        \{\par ??            \cf1 string\cf0  addressRoot = \cf6 "http://localhost:8080/"\cf0 ;\par ??\par ??            \cf4 // get the type we are hosting \par ??\cf0             System.\cf5 Type\cf0  t1 = \cf1 typeof\cf0 (ionic.samples.WcfRest.NorthwindDataService);\par ??\par ??            \cf4 // Create a new ServiceHost to start and stop the service \par ??\cf0             \cf4 // (The URI specified here is used for MEX inquiries)\par ??\cf0             System.ServiceModel.ServiceHost serviceHost1 =\par ??                \cf1 new\cf0  System.ServiceModel.ServiceHost(t1, \cf1 new\cf0  System.Uri(addressRoot)); \par ??\par ??            \cf4 // Create the REST binding\par ??\cf0             System.ServiceModel.WebHttpBinding restBinding = \cf1 new\cf0  System.ServiceModel.WebHttpBinding();\par ??\par ??            \cf4 // Create the REST endpoint.  We need to do this explicitly in order to add a custom behavior to it. \par ??\cf0             \cf1 var\cf0  restEndPoint =\par ??                \cf1 new\cf0  System.ServiceModel.Description.ServiceEndpoint\par ??                    (System.ServiceModel.Description.ContractDescription.GetContract(\cf1 typeof\cf0 (ionic.samples.WcfRest.IDataService)),\par ??                    restBinding,\par ??                    \cf1 new\cf0  System.ServiceModel.EndpointAddress(addressRoot + \cf6 "rest"\cf0 ));\par ??\par ??            \cf4 // Add a customm behavior to the REST endpoint\par ??\cf0             restEndPoint.Behaviors.Add(\cf1 new\cf0  ionic.samples.WcfRest.FaultingWebHttpBehavior());\par ??\par ??            \cf4 // Add the endpoint to the service\par ??\cf0             serviceHost1.Description.Endpoints.Add(restEndPoint);\par ??\par ??            \cf4 // Open the ServiceHost to create listeners and start listening for messages\par ??\cf0             serviceHost1.Open();\par ??            System.\cf5 Console\cf0 .WriteLine(\cf6 "Service implementation: "\cf0  + t1.ToString());\par ??            System.\cf5 Console\cf0 .WriteLine(\cf6 "The service is ready."\cf0 );\par ??            System.\cf5 Console\cf0 .WriteLine(\cf6 "Service Address: "\cf0  + addressRoot + \cf6 "rest"\cf0 );\par ??            System.\cf5 Console\cf0 .WriteLine();\par ??            System.\cf5 Console\cf0 .WriteLine(\cf6 "Press &amp;lt;ENTER&amp;gt; to terminate the service."\cf0 );\par ??            System.\cf5 Console\cf0 .WriteLine();\par ??            System.\cf5 Console\cf0 .ReadLine();\par ??\par ??            \cf4 // Close to shutdown the service\par ??\cf0             serviceHost1.Close();\par ??        \}\par ??    \}\par ??\}}
--&gt;
&lt;DIV style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: windowtext 1pt solid; FONT-SIZE: 10pt; BACKGROUND: white; BORDER-LEFT: windowtext 1pt solid; COLOR: black; BORDER-BOTTOM: windowtext 1pt solid; FONT-FAMILY: Courier New"&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;namespace&lt;/SPAN&gt; ionic.samples.WcfRest&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;2&lt;/SPAN&gt;&amp;nbsp;{&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;3&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;4&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;// console-based app to Host the WCF / REST service &lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;5&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;class&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;ConsoleServiceHost&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;6&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;7&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;static&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; Main()&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;8&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;9&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt; addressRoot = &lt;SPAN style="COLOR: #a31515"&gt;"http://localhost:8080/"&lt;/SPAN&gt;;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;10&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;11&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;// get the type we are hosting &lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;12&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; System.&lt;SPAN style="COLOR: #2b91af"&gt;Type&lt;/SPAN&gt; t1 = &lt;SPAN style="COLOR: blue"&gt;typeof&lt;/SPAN&gt;(ionic.samples.WcfRest.NorthwindDataService);&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;13&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;14&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;// Create a new ServiceHost to start and stop the service &lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;15&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;// (The URI specified here is used for MEX inquiries)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;16&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; System.ServiceModel.ServiceHost serviceHost1 =&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;17&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; System.ServiceModel.ServiceHost(t1, &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; System.Uri(addressRoot)); &lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;18&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;19&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;// Create the REST binding&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;20&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; System.ServiceModel.WebHttpBinding restBinding = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; System.ServiceModel.WebHttpBinding();&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;21&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;22&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;// Create the REST endpoint.&amp;nbsp; We need to do this explicitly in order to add a custom behavior to it. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;23&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;var&lt;/SPAN&gt; restEndPoint =&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;24&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; System.ServiceModel.Description.ServiceEndpoint&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;25&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; (System.ServiceModel.Description.ContractDescription.GetContract(&lt;SPAN style="COLOR: blue"&gt;typeof&lt;/SPAN&gt;(ionic.samples.WcfRest.IDataService)),&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;26&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; restBinding,&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;27&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; System.ServiceModel.EndpointAddress(addressRoot + &lt;SPAN style="COLOR: #a31515"&gt;"rest"&lt;/SPAN&gt;));&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;28&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;29&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;// Add a customm behavior to the REST endpoint&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;30&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; restEndPoint.Behaviors.Add(&lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; ionic.samples.WcfRest.FaultingWebHttpBehavior());&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;31&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;32&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;// Add the endpoint to the service&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;33&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; serviceHost1.Description.Endpoints.Add(restEndPoint);&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;34&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;35&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;// Open the ServiceHost to create listeners and start listening for messages&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;36&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; serviceHost1.Open();&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;37&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; System.&lt;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;.WriteLine(&lt;SPAN style="COLOR: #a31515"&gt;"Service implementation: "&lt;/SPAN&gt; + t1.ToString());&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;38&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; System.&lt;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;.WriteLine(&lt;SPAN style="COLOR: #a31515"&gt;"The service is ready."&lt;/SPAN&gt;);&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;39&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; System.&lt;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;.WriteLine(&lt;SPAN style="COLOR: #a31515"&gt;"Service Address: "&lt;/SPAN&gt; + addressRoot + &lt;SPAN style="COLOR: #a31515"&gt;"rest"&lt;/SPAN&gt;);&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;40&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; System.&lt;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;.WriteLine();&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;41&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; System.&lt;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;.WriteLine(&lt;SPAN style="COLOR: #a31515"&gt;"Press &amp;lt;ENTER&amp;gt; to terminate the service."&lt;/SPAN&gt;);&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;42&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; System.&lt;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;.WriteLine();&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;43&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; System.&lt;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;.ReadLine();&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;44&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;45&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;// Close to shutdown the service&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;46&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; serviceHost1.Close();&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;47&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;48&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;49&lt;/SPAN&gt;&amp;nbsp;}&lt;/P&gt;&lt;/DIV&gt;
&lt;P&gt;I will call your attention to some highlights there: First, you will see that things like base addresses, service interfaces, and service implementation classes are all specified in code (line 12, 17, 25, etc). This stuff &lt;EM&gt;could be specified&lt;/EM&gt; in config files, and commonly is. But in this case, I am specifying all of it in code. There is no config file required here. &lt;/P&gt;
&lt;P&gt;Second, is the use of &lt;A href="http://msdn2.microsoft.com/en-us/library/system.servicemodel.webhttpbinding.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/system.servicemodel.webhttpbinding.aspx"&gt;WebHttpBinding&lt;/A&gt;, on line 20. This is the binding in WCF, new for .NET 3.5, that supports REST. &lt;/P&gt;
&lt;P&gt;Finally, a subtle bit - notice the custom behavior I added to the endpoint. &lt;B&gt;FaultingWebHttpBehavior&lt;/B&gt; on line 30.&amp;nbsp; That behavior gives me the error handling control I mentioned earlier.&amp;nbsp; More about that later. &lt;/P&gt;
&lt;P&gt;Ok, that's the host. Now I need the service interface and the service implementation. &lt;/P&gt;
&lt;H3&gt;The Interface&lt;/H3&gt;
&lt;P&gt;The database I am using is the &lt;A href="http://www.microsoft.com/downloads/details.aspx?FamilyID=06616212-0356-46A0-8DA2-EEBC53A68034&amp;amp;displaylang=en" mce_href="http://www.microsoft.com/downloads/details.aspx?FamilyID=06616212-0356-46A0-8DA2-EEBC53A68034&amp;amp;displaylang=en"&gt;Northwind sample database&lt;/A&gt; which has been shipped with Microsoft database products for years. My service will simply return information for orders in the database - order date, customer, order contents, shipping address, and so on. &lt;/P&gt;
&lt;P&gt;This is a simplistic interface, with just one method. It takes a single parameter as input - the order ID - and returns order information in an XML document. Here's the final product:&lt;/P&gt;&lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue0;\red255\green255\blue255;\red163\green21\blue21;\red0\green0\blue255;\red43\green145\blue175;}??\fs20     [ServiceContract(Namespace = \cf3 "urn:ionic.samples.2008.03.wcfrest"\cf0 )]\par ??    \cf4 public\cf0  \cf4 interface\cf0  \cf5 IDataService\par ??\cf0     \{\par ??        [OperationContract]\par ??        [WebGet(\par ??            BodyStyle = WebMessageBodyStyle.Bare,\par ??          RequestFormat = WebMessageFormat.Xml,\par ??          ResponseFormat = WebMessageFormat.Xml,\par ??          UriTemplate = \cf3 "Northwind/Order/\{orderId\}"\cf0 )]\par ??        OrderInfoMsg GetOrderInfo(\cf4 string\cf0  orderId);\par ??    \}}
--&gt;
&lt;DIV style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: windowtext 1pt solid; FONT-SIZE: 10pt; BACKGROUND: white; BORDER-LEFT: windowtext 1pt solid; COLOR: black; BORDER-BOTTOM: windowtext 1pt solid; FONT-FAMILY: Courier New"&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [ServiceContract(Namespace = &lt;SPAN style="COLOR: #a31515"&gt;"urn:ionic.samples.2008.03.wcfrest"&lt;/SPAN&gt;)]&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;2&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;interface&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;IDataService&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;3&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;4&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; [OperationContract]&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;5&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; [WebGet(&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;6&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; BodyStyle = WebMessageBodyStyle.Bare,&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;7&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; RequestFormat = WebMessageFormat.Xml,&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;8&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; ResponseFormat = WebMessageFormat.Xml,&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;9&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; UriTemplate = &lt;SPAN style="COLOR: #a31515"&gt;"Northwind/Order/{orderId}"&lt;/SPAN&gt;)]&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;10&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; OrderInfoMsg GetOrderInfo(&lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt; orderId);&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;11&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;/DIV&gt;
&lt;P&gt;Things to notice: 
&lt;OL&gt;
&lt;LI&gt;Standard WCF-isms like &lt;A class="" href="http://msdn2.microsoft.com/en-us/library/system.servicemodel.operationcontractattribute.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/system.servicemodel.operationcontractattribute.aspx"&gt;OperationContract&lt;/A&gt; and &lt;A class="" href="http://msdn2.microsoft.com/en-us/library/system.servicemodel.servicecontractattribute.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/system.servicemodel.servicecontractattribute.aspx"&gt;ServiceContract&lt;/A&gt;. 
&lt;LI&gt;The WebGet attribute is new for .NET 3.5, and is the one you want to use for a method that handles REST requests. 
&lt;LI&gt;The UriTemplate specifies the form of the URI requests this method will be tickled for. Also it does automagic URI-to-method-parameter mapping. &lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;The interface for a service in WCF is exhibited at multiple levels - in code (C# in this case), and on the wire (XML in this case). When doign web services design, a best practice for interoperability is to define the WSDL first, and then implement the services and clients from that WSDL. But REST has no WSDL, and the development style is more rapid iteration. In keeping with that tradition, in my case, I defined the interface in C#, and then iterated on it until I got XML in a shape I liked. &lt;/P&gt;
&lt;P&gt;The OrderInfoMsg type, which is the response type I finally arrived at here, looks like this: &lt;/P&gt;&lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue0;\red255\green255\blue255;\red163\green21\blue21;\red0\green0\blue255;\red43\green145\blue175;}??\fs20     [DataContract(Namespace = \cf3 "urn:ionic.samples.2008.03.Rest"\cf0 )]\par ??    \cf4 public\cf0  \cf4 class\cf0  \cf5 OrderInfoMsg\par ??\cf0     \{\par ??        [DataMember]\par ??        \cf4 public\cf0  OrderT Order;\par ??        [DataMember]\par ??        \cf4 public\cf0  ApplicationFaultT Fault;\par ??\par ??        [DataMember]\par ??        \cf4 public\cf0  MessageInfoT MessageInfo;\par ??\par ??\par ??        \cf4 public\cf0  OrderInfoMsg()\par ??        \{\par ??            MessageInfo = \cf4 new\cf0  MessageInfoT();\par ??        \}\par ??    \}}
--&gt;
&lt;DIV style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: windowtext 1pt solid; FONT-SIZE: 10pt; BACKGROUND: white; BORDER-LEFT: windowtext 1pt solid; COLOR: black; BORDER-BOTTOM: windowtext 1pt solid; FONT-FAMILY: Courier New"&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [DataContract(Namespace = &lt;SPAN style="COLOR: #a31515"&gt;"urn:ionic.samples.2008.03.Rest"&lt;/SPAN&gt;)]&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;2&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;class&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;OrderInfoMsg&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;3&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;4&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; [DataMember]&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;5&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; OrderT Order;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;6&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; [DataMember]&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;7&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; ApplicationFaultT Fault;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;8&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;9&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; [DataMember]&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;10&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; MessageInfoT MessageInfo;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;11&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;12&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;13&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; OrderInfoMsg()&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;14&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;15&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; MessageInfo = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; MessageInfoT();&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;16&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;17&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;/DIV&gt;
&lt;P&gt;There are 3 parts to the class - one part contains information about the order, one part to contain information about any fault that occurred on the server side, and a final part to contain generic message information. The fault information is key, because REST doesn't formally specify a way to handle faults, or what they look like. So your REST application has to consider that itself. My approach is to include a way to pass fault information back to the caller explicitly. The MessageInfo part gets filled implicitly, with a timestamp and other information. Think of that as a basic message "dog tags". &lt;/P&gt;
&lt;P&gt;I won't show all the code for the other classes. They are just basic &lt;A href="http://en.wikipedia.org/wiki/Data_Transfer_Object" mce_href="http://en.wikipedia.org/wiki/Data_Transfer_Object"&gt;Data Transfer Objects&lt;/A&gt;. 
&lt;H3&gt;The Service Implementation&lt;/H3&gt;
&lt;P&gt;The service implementation is obviously going to be pretty basic. All we need to do is query SQL Server for the order information, and then form an XML document in reply. &lt;/P&gt;
&lt;P&gt;Here's where there is some fun involved. We can use LINQ-to-SQL to do the queries and fill the Data Transfer Object. Check the code: &lt;/P&gt;&lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue0;\red255\green255\blue255;\red0\green0\blue255;\red43\green145\blue175;\red163\green21\blue21;}??\fs20         \cf3 public\cf0  OrderInfoMsg GetOrderInfo(\cf3 string\cf0  orderId)\par ??        \{\par ??            \cf3 int\cf0  n = 0;\par ??            \cf3 try\par ??\cf0             \{\par ??                n = System.\cf4 Int32\cf0 .Parse(orderId);\par ??            \}\par ??            \cf3 catch\par ??\cf0             \{\par ??                \cf3 return\cf0  \cf3 new\cf0  OrderInfoMsg\par ??                \{\par ??                    Fault = \cf3 new\cf0  ApplicationFaultT\par ??                    \{\par ??                        message = \cf5 "Bad input, please pass a valid order number"\cf0 ,\par ??                        code = 11\par ??                    \}\par ??                \};\par ??            \}\par ??\par ??            OrderInfoMsg oim = \cf3 null\cf0 ;\par ??            \cf3 try\par ??\cf0             \{\par ??                oim =\par ??                 (\cf3 from\cf0  o \cf3 in\cf0  db.Orders\par ??                  \cf3 where\cf0  o.OrderID == n\par ??                  \cf3 select\cf0  \cf3 new\cf0  OrderInfoMsg\par ??                     \{\par ??                         Order = \cf3 new\cf0  OrderT\par ??                         \{\par ??                             OrderID = o.OrderID,\par ??                             Customer = (\cf3 from\cf0  c \cf3 in\cf0  db.Customers\par ??                                         \cf3 where\cf0  o.CustomerID == c.CustomerID\par ??                                         \cf3 select\cf0  \cf3 new\cf0  CustomerT\par ??                                         \{\par ??                                             CompanyName = c.CompanyName,\par ??                                             ContactName = c.ContactName,\par ??                                             ContactTitle = c.ContactTitle,\par ??                                             Phone = c.Phone\par ??                                         \}).Single(),\par ??                             OrderDate = o.OrderDate,\par ??                             ShipInfo = \cf3 new\cf0  ShipInfoT\par ??                             \{\par ??                                 ShipName = o.ShipName,\par ??                                 ShipAddress = o.ShipAddress,\par ??                                 ShipCity = o.ShipCity,\par ??                                 ShipPostalCode = o.ShipPostalCode,\par ??                                 ShipCountry = o.ShipCountry,\par ??                             \},\par ??                             Items =\par ??                             (\cf3 from\cf0  od \cf3 in\cf0  db.Order_Details\par ??                              \cf3 where\cf0  od.OrderID == o.OrderID\par ??                              \cf3 select\cf0  \cf3 new\cf0  ItemT \{ \par ??                                  ProductName = od.Product.ProductName, \par ??                                  Quantity = od.Quantity, \par ??                                  UnitPrice = od.UnitPrice \}).ToArray()\par ??                         \}\par ??                     \}).Single();\par ??\par ??            \}\par ??            \cf3 catch\cf0  (System.\cf4 Exception\cf0  exc1)\par ??            \{\par ??                oim = \cf3 new\cf0  OrderInfoMsg\par ??                \{\par ??                    Fault = \cf3 new\cf0  ApplicationFaultT\par ??                    \{\par ??                        message = \cf5 "Could not retrieve Order Information. Maybe you passed bad input?"\cf0 ,\par ??                        innerMessage = \cf5 "Exception: "\cf0  + exc1.Message,\par ??                        code = 12\par ??                    \}\par ??                \};\par ??            \}\par ??\par ??            \cf3 return\cf0  oim;\par ??\par ??        \}\par ??    \}}
--&gt;
&lt;DIV style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: windowtext 1pt solid; FONT-SIZE: 10pt; BACKGROUND: white; BORDER-LEFT: windowtext 1pt solid; COLOR: black; BORDER-BOTTOM: windowtext 1pt solid; FONT-FAMILY: Courier New"&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; OrderInfoMsg GetOrderInfo(&lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt; orderId)&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;2&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;3&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;int&lt;/SPAN&gt; n = 0;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;4&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;try&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;5&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;6&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; n = System.&lt;SPAN style="COLOR: #2b91af"&gt;Int32&lt;/SPAN&gt;.Parse(orderId);&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;7&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;8&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;catch&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;9&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;10&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;return&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; OrderInfoMsg&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;11&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;12&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Fault = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; ApplicationFaultT&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;13&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;14&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; message = &lt;SPAN style="COLOR: #a31515"&gt;"Bad input, please pass a valid order number"&lt;/SPAN&gt;,&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;15&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; code = 11&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;16&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;17&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;18&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;19&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;20&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; OrderInfoMsg oim = &lt;SPAN style="COLOR: blue"&gt;null&lt;/SPAN&gt;;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;21&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;try&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;22&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;23&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; oim =&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;24&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; (&lt;SPAN style="COLOR: blue"&gt;from&lt;/SPAN&gt; o &lt;SPAN style="COLOR: blue"&gt;in&lt;/SPAN&gt; db.Orders&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;25&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;where&lt;/SPAN&gt; o.OrderID == n&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;26&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;select&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; OrderInfoMsg&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;27&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;28&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Order = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; OrderT&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;29&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;30&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; OrderID = o.OrderID,&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;31&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Customer = (&lt;SPAN style="COLOR: blue"&gt;from&lt;/SPAN&gt; c &lt;SPAN style="COLOR: blue"&gt;in&lt;/SPAN&gt; db.Customers&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;32&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;where&lt;/SPAN&gt; o.CustomerID == c.CustomerID&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;33&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;select&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; CustomerT&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;34&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;35&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; CompanyName = c.CompanyName,&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;36&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ContactName = c.ContactName,&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;37&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ContactTitle = c.ContactTitle,&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;38&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Phone = c.Phone&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;39&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }).Single(),&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;40&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; OrderDate = o.OrderDate,&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;41&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ShipInfo = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; ShipInfoT&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;42&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;43&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ShipName = o.ShipName,&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;44&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ShipAddress = o.ShipAddress,&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;45&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ShipCity = o.ShipCity,&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;46&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ShipPostalCode = o.ShipPostalCode,&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;47&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ShipCountry = o.ShipCountry,&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;48&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; },&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;49&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Items =&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;50&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; (&lt;SPAN style="COLOR: blue"&gt;from&lt;/SPAN&gt; od &lt;SPAN style="COLOR: blue"&gt;in&lt;/SPAN&gt; db.Order_Details&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;51&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;where&lt;/SPAN&gt; od.OrderID == o.OrderID&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;52&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;select&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; ItemT { &lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;53&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; ProductName = od.Product.ProductName, &lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;54&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; Quantity = od.Quantity, &lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;55&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; UnitPrice = od.UnitPrice }).ToArray()&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;56&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;57&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }).Single();&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;58&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;59&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;60&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;catch&lt;/SPAN&gt; (System.&lt;SPAN style="COLOR: #2b91af"&gt;Exception&lt;/SPAN&gt; exc1)&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;61&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;62&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; oim = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; OrderInfoMsg&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;63&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;64&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Fault = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; ApplicationFaultT&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;65&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;66&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; message = &lt;SPAN style="COLOR: #a31515"&gt;"Could not retrieve Order Information. Maybe you passed bad input?"&lt;/SPAN&gt;,&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;67&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; innerMessage = &lt;SPAN style="COLOR: #a31515"&gt;"Exception: "&lt;/SPAN&gt; + exc1.Message,&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;68&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; code = 12&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;69&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;70&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;71&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;72&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;73&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;return&lt;/SPAN&gt; oim;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;74&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;75&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;/DIV&gt;
&lt;P&gt;Lines 4 through 18 are just validation of the input. The LINQ stuff starts on line 21. Line 26 is where I create the new OrderInfoMsg and the following lines fill that data structure based on information retrieved from the SQL database. &lt;/P&gt;
&lt;P&gt;At first that LINQ stuff may look novel and confusing, but it is really a simple way to do database queries. Keep in mind though, that the REST stuff in WCF is not dependent on LINQ in any way. You could create and fill the OrderInfoMsg any old way, including using an old-fashioned DataReader if you like. &lt;/P&gt;
&lt;P&gt;But I find LINQ a nice upgrade. At line 49, you can see I fill an array of line items for the order. That's nice, concise, readable code. 
&lt;P&gt;In line 62 you can see some error handling, and the use of the object initializers that are new for C# 3.0. Again, nice, clean code. &lt;/P&gt;
&lt;H3&gt;Where does this LINQ stuff come from?&lt;/H3&gt;
&lt;P&gt;The LINQ mappings for the Northwind database are defined in a generated C# file, which is not shown here, and which, I confess, I produced using Visual Studio. I know, I know. I promised that VS wasn't required. But I figured that digression was allowed, seeing as how the main point of this post is not LINQ but how to use WCF to build a REST app. You don't need LINQ to retrieve data. It's just a little extra &lt;A class="" href="http://www.famousfoods.com/emerilsbambq.html" mce_href="http://www.famousfoods.com/emerilsbambq.html"&gt;BAM!&lt;/A&gt; for you in this sample. &lt;/P&gt;
&lt;H3&gt;The FaultingWebHttpBehavior&lt;/H3&gt;
&lt;P&gt;I found that when there was an error in the service, it would return an HTML page to the caller. This has been &lt;A href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2248288&amp;amp;SiteID=1"&gt;noticed by others&lt;/A&gt;. A fellow by the name of Andre posted code for an endpoint behavior that would prevent the generation of HTML messages. I liked it and used it here. This is the custom behavior I added to the endpoint, in the service host code, shown above. &lt;/P&gt;&lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue255;\red255\green255\blue255;\red0\green0\blue0;\red128\green128\blue128;\red0\green128\blue0;\red43\green145\blue175;\red163\green21\blue21;}??\fs20 \cf1 namespace\cf0  ionic.samples.WcfRest\par ??\{\par ??    \cf4 ///\cf5  \cf4 &amp;lt;summary&amp;gt;\par ??\cf0     \cf4 ///\cf5  A \cf4 &amp;lt;see cref="WebHttpBehavior"/&amp;gt;\cf5  that returns error messages to the caller \par ??\cf0     \cf4 ///\cf5  when an exception occurs on the server/service. \par ??\cf0     \cf4 ///\cf5  \cf4 &amp;lt;/summary&amp;gt;\par ??\par ??\cf0     \cf1 public\cf0  \cf1 class\cf0  \cf6 FaultingWebHttpBehavior\cf0  : System.ServiceModel.Description.WebHttpBehavior\par ??    \{\par ??\par ??\par ??        \cf1 protected\cf0  \cf1 override\cf0  \cf1 void\cf0  AddServerErrorHandlers(System.ServiceModel.Description.ServiceEndpoint endpoint,\par ??                               System.ServiceModel.Dispatcher.EndpointDispatcher endpointDispatcher)\par ??        \{\par ??            endpointDispatcher.ChannelDispatcher.ErrorHandlers.Clear();\par ??            endpointDispatcher.ChannelDispatcher.ErrorHandlers.Add(\cf1 new\cf0  ErrorHandler());\par ??        \}\par ??\par ??        \cf1 public\cf0  \cf1 class\cf0  \cf6 ErrorHandler\cf0  : System.ServiceModel.Dispatcher.IErrorHandler\par ??        \{\par ??\cf1             #region\cf0  IErrorHandler Members\par ??\par ??            \cf1 public\cf0  \cf1 bool\cf0  HandleError(System.\cf6 Exception\cf0  error)\par ??            \{\par ??                \cf1 return\cf0  \cf1 true\cf0 ;\par ??            \}\par ??\par ??            \cf1 public\cf0  \cf1 void\cf0  ProvideFault(System.\cf6 Exception\cf0  error,\par ??                         System.ServiceModel.Channels.MessageVersion version,\par ??                         \cf1 ref\cf0  System.ServiceModel.Channels.Message fault)\par ??            \{\par ??                System.ServiceModel.FaultCode faultCode =\par ??                  System.ServiceModel.FaultCode.CreateSenderFaultCode(error.GetType().Name,\par ??                                              \cf7 "urn:ionic.samples.serviceexception"\cf0 );\par ??                fault = System.ServiceModel.Channels.Message.CreateMessage(version, faultCode, error.Message, \cf1 null\cf0 );\par ??            \}\par ??\par ??\cf1             #endregion\par ??\cf0         \}\par ??    \}\par ??\}}
--&gt;
&lt;DIV style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: windowtext 1pt solid; FONT-SIZE: 10pt; BACKGROUND: white; BORDER-LEFT: windowtext 1pt solid; COLOR: black; BORDER-BOTTOM: windowtext 1pt solid; FONT-FAMILY: Courier New"&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;namespace&lt;/SPAN&gt; ionic.samples.WcfRest&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;2&lt;/SPAN&gt;&amp;nbsp;{&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;3&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;&amp;lt;summary&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;4&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt; A &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;&amp;lt;see cref="WebHttpBehavior"/&amp;gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt; that returns error messages to the caller &lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;5&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt; when an exception occurs on the server/service. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;6&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;&amp;lt;/summary&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;7&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;8&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;class&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;FaultingWebHttpBehavior&lt;/SPAN&gt; : System.ServiceModel.Description.WebHttpBehavior&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;9&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;10&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;11&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;12&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;protected&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;override&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; AddServerErrorHandlers(System.ServiceModel.Description.ServiceEndpoint endpoint,&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;13&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; System.ServiceModel.Dispatcher.EndpointDispatcher endpointDispatcher)&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;14&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;15&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; endpointDispatcher.ChannelDispatcher.ErrorHandlers.Clear();&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;16&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; endpointDispatcher.ChannelDispatcher.ErrorHandlers.Add(&lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; ErrorHandler());&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;17&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;18&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;19&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;class&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;ErrorHandler&lt;/SPAN&gt; : System.ServiceModel.Dispatcher.IErrorHandler&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;20&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;21&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; #region&lt;/SPAN&gt; IErrorHandler Members&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;22&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;23&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;bool&lt;/SPAN&gt; HandleError(System.&lt;SPAN style="COLOR: #2b91af"&gt;Exception&lt;/SPAN&gt; error)&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;24&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;25&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;return&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;true&lt;/SPAN&gt;;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;26&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;27&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;28&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; ProvideFault(System.&lt;SPAN style="COLOR: #2b91af"&gt;Exception&lt;/SPAN&gt; error,&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;29&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; System.ServiceModel.Channels.MessageVersion version,&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;30&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;ref&lt;/SPAN&gt; System.ServiceModel.Channels.Message fault)&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;31&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;32&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; System.ServiceModel.FaultCode faultCode =&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;33&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; System.ServiceModel.FaultCode.CreateSenderFaultCode(error.GetType().Name,&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;34&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;SPAN style="COLOR: #a31515"&gt;"urn:ionic.samples.serviceexception"&lt;/SPAN&gt;);&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;35&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; fault = System.ServiceModel.Channels.Message.CreateMessage(version, faultCode, error.Message, &lt;SPAN style="COLOR: blue"&gt;null&lt;/SPAN&gt;);&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;36&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;37&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;38&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; #endregion&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;39&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;40&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;41&lt;/SPAN&gt;&amp;nbsp;}&lt;/P&gt;&lt;/DIV&gt;
&lt;H3&gt;The REST messages&lt;/H3&gt;
&lt;P&gt;The request looks something like this: &lt;/P&gt;&lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue0;\red255\green255\blue255;}??\fs20 GET /rest/Northwind/Order/11049 HTTP/1.1\par ??Accept: */*\par ??Accept-Language: en-us\par ??UA-CPU: x86\par ??Accept-Encoding: gzip, deflate\par ??User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0;)\par ??Host: dinoch-2:8080\par ??Proxy-Connection: Keep-Alive}
--&gt;
&lt;DIV style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: windowtext 1pt solid; FONT-SIZE: 10pt; BACKGROUND: white; BORDER-LEFT: windowtext 1pt solid; COLOR: black; BORDER-BOTTOM: windowtext 1pt solid; FONT-FAMILY: Courier New"&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1&lt;/SPAN&gt;&amp;nbsp;GET /rest/Northwind/Order/11049 HTTP/1.1&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;2&lt;/SPAN&gt;&amp;nbsp;Accept: */*&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;3&lt;/SPAN&gt;&amp;nbsp;Accept-Language: en-us&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;4&lt;/SPAN&gt;&amp;nbsp;UA-CPU: x86&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;5&lt;/SPAN&gt;&amp;nbsp;Accept-Encoding: gzip, deflate&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;6&lt;/SPAN&gt;&amp;nbsp;User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0;)&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;7&lt;/SPAN&gt;&amp;nbsp;Host: dinoch-2:8080&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;8&lt;/SPAN&gt;&amp;nbsp;Proxy-Connection: Keep-Alive&lt;/P&gt;&lt;/DIV&gt;
&lt;P&gt;Obviously, any application on any computer can generate that sort of request. I used an IE browser, but it could be anything, and in a real REST app it won't be just a browser. &lt;/P&gt;
&lt;P&gt;And the response looks like this: &lt;/P&gt;&lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue0;\red255\green255\blue255;}??\fs20 HTTP/1.1 200 OK\par ??Content-Length: 1189\par ??Content-Type: application/xml; charset=utf-8\par ??Server: Microsoft-HTTPAPI/2.0\par ??Date: Thu, 20 Mar 2008 20:34:59 GMT\par ??\par ??&amp;lt;OrderInfoMsg ...&amp;gt;\par ??}
--&gt;
&lt;DIV style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: windowtext 1pt solid; FONT-SIZE: 10pt; BACKGROUND: white; BORDER-LEFT: windowtext 1pt solid; COLOR: black; BORDER-BOTTOM: windowtext 1pt solid; FONT-FAMILY: Courier New"&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1&lt;/SPAN&gt;&amp;nbsp;HTTP/1.1 200 OK&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;2&lt;/SPAN&gt;&amp;nbsp;Content-Length: 1189&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;3&lt;/SPAN&gt;&amp;nbsp;Content-Type: application/xml; charset=utf-8&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;4&lt;/SPAN&gt;&amp;nbsp;Server: Microsoft-HTTPAPI/2.0&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;5&lt;/SPAN&gt;&amp;nbsp;Date: Thu, 20 Mar 2008 20:34:59 GMT&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;6&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;7&lt;/SPAN&gt;&amp;nbsp;&amp;lt;OrderInfoMsg ...&amp;gt;&lt;/P&gt;&lt;/DIV&gt;
&lt;P&gt;The prettified XML looks like this: &lt;/P&gt;&lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof1252\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue255;\red255\green255\blue255;\red163\green21\blue21;\red255\green0\blue0;\red0\green0\blue0;}??\fs20 \cf1 &amp;lt;\cf3 OrderInfoMsg\cf1  \cf4 xmlns\cf1 =\cf0 "\cf1 urn:ionic.samples.2008.03.Rest\cf0 "\cf1  \cf4 xmlns:i\cf1 =\cf0 "\cf1 http://www.w3.org/2001/XMLSchema-instance\cf0 "\cf1 &amp;gt;\par ??  &amp;lt;\cf3 Fault\cf1  \cf4 i:nil\cf1 =\cf0 "\cf1 true\cf0 "\cf1 /&amp;gt;\par ??  &amp;lt;\cf3 MessageInfo\cf1 &amp;gt;\par ??    &amp;lt;\cf3 ApplicationId\cf1 &amp;gt;\cf0 319a80e4-3e64-4328-a5d1-468b354c370a\cf1 &amp;lt;/\cf3 ApplicationId\cf1 &amp;gt;\par ??    &amp;lt;\cf3 ApplicationName\cf1 &amp;gt;\cf0 WcfRestService, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null\cf1 &amp;lt;/\cf3 ApplicationName\cf1 &amp;gt;\par ??    &amp;lt;\cf3 OkToStore\cf1 &amp;gt;\cf0 true\cf1 &amp;lt;/\cf3 OkToStore\cf1 &amp;gt;\par ??    &amp;lt;\cf3 generated\cf1 &amp;gt;\cf0 2008-03-20T13:34:59.3459363-07:00\cf1 &amp;lt;/\cf3 generated\cf1 &amp;gt;\par ??    &amp;lt;\cf3 originatingHost\cf1 &amp;gt;\cf0 dinoch-2\cf1 &amp;lt;/\cf3 originatingHost\cf1 &amp;gt;\par ??  &amp;lt;/\cf3 MessageInfo\cf1 &amp;gt;\par ??  &amp;lt;\cf3 Order\cf1 &amp;gt;\par ??    &amp;lt;\cf3 Customer\cf1 &amp;gt;\par ??      &amp;lt;\cf3 CompanyName\cf1 &amp;gt;\cf0 Gourmet Lanchonetes\cf1 &amp;lt;/\cf3 CompanyName\cf1 &amp;gt;\par ??      &amp;lt;\cf3 ContactName\cf1 &amp;gt;\cf0 Andr\'e9 Fonseca\cf1 &amp;lt;/\cf3 ContactName\cf1 &amp;gt;\par ??      &amp;lt;\cf3 ContactTitle\cf1 &amp;gt;\cf0 Sales Associate\cf1 &amp;lt;/\cf3 ContactTitle\cf1 &amp;gt;\par ??      &amp;lt;\cf3 Phone\cf1 &amp;gt;\cf0 (11) 555-9482\cf1 &amp;lt;/\cf3 Phone\cf1 &amp;gt;\par ??    &amp;lt;/\cf3 Customer\cf1 &amp;gt;\par ??    &amp;lt;\cf3 Items\cf1 &amp;gt;\par ??      &amp;lt;\cf3 Item\cf1 &amp;gt;\par ??        &amp;lt;\cf3 ProductName\cf1 &amp;gt;\cf0 Chang\cf1 &amp;lt;/\cf3 ProductName\cf1 &amp;gt;\par ??        &amp;lt;\cf3 Quantity\cf1 &amp;gt;\cf0 10\cf1 &amp;lt;/\cf3 Quantity\cf1 &amp;gt;\par ??        &amp;lt;\cf3 UnitPrice\cf1 &amp;gt;\cf0 19.0000\cf1 &amp;lt;/\cf3 UnitPrice\cf1 &amp;gt;\par ??      &amp;lt;/\cf3 Item\cf1 &amp;gt;\par ??      &amp;lt;\cf3 Item\cf1 &amp;gt;\par ??        &amp;lt;\cf3 ProductName\cf1 &amp;gt;\cf0 Queso Manchego La Pastora\cf1 &amp;lt;/\cf3 ProductName\cf1 &amp;gt;\par ??        &amp;lt;\cf3 Quantity\cf1 &amp;gt;\cf0 4\cf1 &amp;lt;/\cf3 Quantity\cf1 &amp;gt;\par ??        &amp;lt;\cf3 UnitPrice\cf1 &amp;gt;\cf0 38.0000\cf1 &amp;lt;/\cf3 UnitPrice\cf1 &amp;gt;\par ??      &amp;lt;/\cf3 Item\cf1 &amp;gt;\par ??    &amp;lt;/\cf3 Items\cf1 &amp;gt;\par ??    &amp;lt;\cf3 OrderDate\cf1 &amp;gt;\cf0 1996-05-24T00:00:00\cf1 &amp;lt;/\cf3 OrderDate\cf1 &amp;gt;\par ??    &amp;lt;\cf3 OrderID\cf1 &amp;gt;\cf0 11049\cf1 &amp;lt;/\cf3 OrderID\cf1 &amp;gt;\par ??    &amp;lt;\cf3 ShipInfo\cf1 &amp;gt;\par ??      &amp;lt;\cf3 ShipAddress\cf1 &amp;gt;\cf0 Av. Brasil, 442\cf1 &amp;lt;/\cf3 ShipAddress\cf1 &amp;gt;\par ??      &amp;lt;\cf3 ShipCity\cf1 &amp;gt;\cf0 Campinas\cf1 &amp;lt;/\cf3 ShipCity\cf1 &amp;gt;\par ??      &amp;lt;\cf3 ShipCountry\cf1 &amp;gt;\cf0 Brazil\cf1 &amp;lt;/\cf3 ShipCountry\cf1 &amp;gt;\par ??      &amp;lt;\cf3 ShipName\cf1 &amp;gt;\cf0 Gourmet Lanchonetes\cf1 &amp;lt;/\cf3 ShipName\cf1 &amp;gt;\par ??      &amp;lt;\cf3 ShipPostalCode\cf1 &amp;gt;\cf0 04876-786\cf1 &amp;lt;/\cf3 ShipPostalCode\cf1 &amp;gt;\par ??      &amp;lt;\cf3 ShipRegion\cf1  \cf4 i:nil\cf1 =\cf0 "\cf1 true\cf0 "\cf1 /&amp;gt;\par ??    &amp;lt;/\cf3 ShipInfo\cf1 &amp;gt;\par ??  &amp;lt;/\cf3 Order\cf1 &amp;gt;\par ??&amp;lt;/\cf3 OrderInfoMsg\cf1 &amp;gt;}
--&gt;
&lt;DIV style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: windowtext 1pt solid; FONT-SIZE: 10pt; BACKGROUND: white; BORDER-LEFT: windowtext 1pt solid; COLOR: black; BORDER-BOTTOM: windowtext 1pt solid; FONT-FAMILY: Courier New"&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;OrderInfoMsg&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;xmlns&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;urn:ionic.samples.2008.03.Rest&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;xmlns:i&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;http://www.w3.org/2001/XMLSchema-instance&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;2&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Fault&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;i:nil&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;true&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;/&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;3&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;MessageInfo&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;4&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;ApplicationId&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;319a80e4-3e64-4328-a5d1-468b354c370a&lt;SPAN style="COLOR: blue"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;ApplicationId&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;5&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;ApplicationName&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;WcfRestService, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null&lt;SPAN style="COLOR: blue"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;ApplicationName&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;6&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;OkToStore&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;true&lt;SPAN style="COLOR: blue"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;OkToStore&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;7&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;generated&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;2008-03-20T13:34:59.3459363-07:00&lt;SPAN style="COLOR: blue"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;generated&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;8&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;originatingHost&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;dinoch-2&lt;SPAN style="COLOR: blue"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;originatingHost&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;9&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;MessageInfo&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;10&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Order&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;11&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Customer&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;12&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;CompanyName&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;Gourmet Lanchonetes&lt;SPAN style="COLOR: blue"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;CompanyName&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;13&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;ContactName&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;André Fonseca&lt;SPAN style="COLOR: blue"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;ContactName&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;14&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;ContactTitle&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;Sales Associate&lt;SPAN style="COLOR: blue"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;ContactTitle&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;15&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Phone&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;(11) 555-9482&lt;SPAN style="COLOR: blue"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Phone&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;16&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Customer&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;17&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Items&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;18&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Item&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;19&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;ProductName&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;Chang&lt;SPAN style="COLOR: blue"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;ProductName&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;20&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Quantity&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;10&lt;SPAN style="COLOR: blue"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Quantity&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;21&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;UnitPrice&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;19.0000&lt;SPAN style="COLOR: blue"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;UnitPrice&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;22&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Item&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;23&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Item&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;24&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;ProductName&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;Queso Manchego La Pastora&lt;SPAN style="COLOR: blue"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;ProductName&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;25&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Quantity&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;4&lt;SPAN style="COLOR: blue"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Quantity&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;26&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;UnitPrice&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;38.0000&lt;SPAN style="COLOR: blue"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;UnitPrice&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;27&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Item&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;28&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Items&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;29&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;OrderDate&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;1996-05-24T00:00:00&lt;SPAN style="COLOR: blue"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;OrderDate&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;30&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;OrderID&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;11049&lt;SPAN style="COLOR: blue"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;OrderID&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;31&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;ShipInfo&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;32&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;ShipAddress&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;Av. Brasil, 442&lt;SPAN style="COLOR: blue"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;ShipAddress&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;33&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;ShipCity&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;Campinas&lt;SPAN style="COLOR: blue"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;ShipCity&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;34&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;ShipCountry&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;Brazil&lt;SPAN style="COLOR: blue"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;ShipCountry&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;35&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;ShipName&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;Gourmet Lanchonetes&lt;SPAN style="COLOR: blue"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;ShipName&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;36&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;ShipPostalCode&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;04876-786&lt;SPAN style="COLOR: blue"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;ShipPostalCode&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;37&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;ShipRegion&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;i:nil&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;true&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;/&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;38&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;nbsp; &amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;ShipInfo&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;39&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Order&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;40&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;OrderInfoMsg&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;
&lt;P&gt;Clean, simple, easy. &lt;/P&gt;
&lt;P&gt;But wait! There's more! What if you don't want XML but want that data in JSON? A simple flip of an attribute in the Service definition gives us this as a response: &lt;/P&gt;&lt;!--
{\rtf1\ansi\ansicpg\lang1024\noproof65001\uc1 \deff0{\fonttbl{\f0\fnil\fcharset0\fprq1 Courier New;}}{\colortbl;??\red0\green0\blue0;\red255\green255\blue255;\red163\green21\blue21;\red0\green0\blue255;}??\fs20 \{\par ??  \cf3 "Fault"\cf0 :\cf4 null\cf0 ,\par ??  \cf3 "MessageInfo"\cf0 :\{\par ??    \cf3 "ApplicationId"\cf0 :\cf3 "319a80e4-3e64-4328-a5d1-468b354c370a"\cf0 ,\par ??    \cf3 "ApplicationName"\cf0 :\cf3 "WcfRestService, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"\cf0 ,\par ??    \cf3 "OkToStore"\cf0 :\cf4 true\cf0 ,\par ??    \cf3 "generated"\cf0 :\cf3 "\\/Date(1206047182582-0700)\\/"\cf0 ,\par ??    \cf3 "originatingHost"\cf0 :\cf3 "dinoch-2"\par ??\cf0     \},\par ??  \cf3 "Order"\cf0 :\{\par ??    \cf3 "Customer"\cf0 :\{\par ??      \cf3 "CompanyName"\cf0 :\cf3 "La maison d'Asie"\cf0 ,\par ??      \cf3 "ContactName"\cf0 :\cf3 "Annette Roulet"\cf0 ,\par ??      \cf3 "ContactTitle"\cf0 :\cf3 "Sales Manager"\cf0 ,\par ??      \cf3 "Phone"\cf0 :\cf3 "61.77.61.10"\par ??\cf0       \},\par ??    \cf3 "Items"\cf0 :[\par ??      \{\cf3 "ProductName"\cf0 :\cf3 "Guaran\u225 ? Fant\u225 ?stica"\cf0 ,\cf3 "Quantity"\cf0 :10,\cf3 "UnitPrice"\cf0 :4.5000\}\par ??    ],\par ??    \cf3 "OrderDate"\cf0 :\cf3 "\\/Date(833180400000-0700)\\/"\cf0 ,\par ??    \cf3 "OrderID"\cf0 :11051,\par ??    \cf3 "ShipInfo"\cf0 :\{\par ??      \cf3 "ShipAddress"\cf0 :\cf3 "1 rue Alsace-Lorraine"\cf0 ,\par ??      \cf3 "ShipCity"\cf0 :\cf3 "Toulouse"\cf0 ,\par ??      \cf3 "ShipCountry"\cf0 :\cf3 "France"\cf0 ,\par ??      \cf3 "ShipName"\cf0 :\cf3 "La maison d'Asie"\cf0 ,\par ??      \cf3 "ShipPostalCode"\cf0 :\cf3 "31000"\cf0 ,\par ??      \cf3 "ShipRegion"\cf0 :\cf4 null\par ??\cf0       \}\par ??    \}\par ??\}}
--&gt;
&lt;DIV style="BORDER-RIGHT: windowtext 1pt solid; BORDER-TOP: windowtext 1pt solid; FONT-SIZE: 10pt; BACKGROUND: white; BORDER-LEFT: windowtext 1pt solid; COLOR: black; BORDER-BOTTOM: windowtext 1pt solid; FONT-FAMILY: Courier New"&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1&lt;/SPAN&gt;&amp;nbsp;{&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;2&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: #a31515"&gt;"Fault"&lt;/SPAN&gt;:&lt;SPAN style="COLOR: blue"&gt;null&lt;/SPAN&gt;,&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;3&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: #a31515"&gt;"MessageInfo"&lt;/SPAN&gt;:{&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;4&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: #a31515"&gt;"ApplicationId"&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #a31515"&gt;"319a80e4-3e64-4328-a5d1-468b354c370a"&lt;/SPAN&gt;,&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;5&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: #a31515"&gt;"ApplicationName"&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #a31515"&gt;"WcfRestService, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"&lt;/SPAN&gt;,&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;6&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: #a31515"&gt;"OkToStore"&lt;/SPAN&gt;:&lt;SPAN style="COLOR: blue"&gt;true&lt;/SPAN&gt;,&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;7&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: #a31515"&gt;"generated"&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #a31515"&gt;"\/Date(1206047182582-0700)\/"&lt;/SPAN&gt;,&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;8&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: #a31515"&gt;"originatingHost"&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #a31515"&gt;"dinoch-2"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;9&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; },&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;10&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: #a31515"&gt;"Order"&lt;/SPAN&gt;:{&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;11&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: #a31515"&gt;"Customer"&lt;/SPAN&gt;:{&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;12&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;SPAN style="COLOR: #a31515"&gt;"CompanyName"&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #a31515"&gt;"La maison d'Asie"&lt;/SPAN&gt;,&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;13&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;SPAN style="COLOR: #a31515"&gt;"ContactName"&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #a31515"&gt;"Annette Roulet"&lt;/SPAN&gt;,&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;14&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;SPAN style="COLOR: #a31515"&gt;"ContactTitle"&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #a31515"&gt;"Sales Manager"&lt;/SPAN&gt;,&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;15&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;SPAN style="COLOR: #a31515"&gt;"Phone"&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #a31515"&gt;"61.77.61.10"&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;16&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; },&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;17&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: #a31515"&gt;"Items"&lt;/SPAN&gt;:[&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;18&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; {&lt;SPAN style="COLOR: #a31515"&gt;"ProductName"&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #a31515"&gt;"Guaraná Fantástica"&lt;/SPAN&gt;,&lt;SPAN style="COLOR: #a31515"&gt;"Quantity"&lt;/SPAN&gt;:10,&lt;SPAN style="COLOR: #a31515"&gt;"UnitPrice"&lt;/SPAN&gt;:4.5000}&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;19&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ],&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;20&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: #a31515"&gt;"OrderDate"&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #a31515"&gt;"\/Date(833180400000-0700)\/"&lt;/SPAN&gt;,&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;21&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: #a31515"&gt;"OrderID"&lt;/SPAN&gt;:11051,&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;22&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: #a31515"&gt;"ShipInfo"&lt;/SPAN&gt;:{&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;23&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;SPAN style="COLOR: #a31515"&gt;"ShipAddress"&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #a31515"&gt;"1 rue Alsace-Lorraine"&lt;/SPAN&gt;,&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;24&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;SPAN style="COLOR: #a31515"&gt;"ShipCity"&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #a31515"&gt;"Toulouse"&lt;/SPAN&gt;,&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;25&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;SPAN style="COLOR: #a31515"&gt;"ShipCountry"&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #a31515"&gt;"France"&lt;/SPAN&gt;,&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;26&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;SPAN style="COLOR: #a31515"&gt;"ShipName"&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #a31515"&gt;"La maison d'Asie"&lt;/SPAN&gt;,&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;27&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;SPAN style="COLOR: #a31515"&gt;"ShipPostalCode"&lt;/SPAN&gt;:&lt;SPAN style="COLOR: #a31515"&gt;"31000"&lt;/SPAN&gt;,&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;28&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;SPAN style="COLOR: #a31515"&gt;"ShipRegion"&lt;/SPAN&gt;:&lt;SPAN style="COLOR: blue"&gt;null&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;29&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; }&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;30&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;31&lt;/SPAN&gt;&amp;nbsp;}&lt;/P&gt;&lt;/DIV&gt;
&lt;P&gt;Pretty nifty, eh?&lt;/P&gt;
&lt;P&gt;That's how to write a REST app in .NET. &lt;/P&gt;
&lt;H3&gt;Where are we?&lt;/H3&gt;
&lt;P&gt;Well, I hope I've shown you a couple things here. First, it's easy to use WCF to build REST apps, using the .NET Framework 3.5. Second, you can build WCF apps with free command line tools. Finally, LINQ is cool, and is a nice complement to REST approaches. &lt;/P&gt;
&lt;P&gt;Grab the source code attached here&amp;nbsp;and try it yourself. &lt;/P&gt;&lt;/SIZE&gt;&lt;/FONT&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8327651" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/dotnetinterop/attachment/8327651.ashx" length="68814" type="application/x-zip-compressed" /><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/Interop/default.aspx">Interop</category><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/XML/default.aspx">XML</category><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/SDK/default.aspx">SDK</category><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/.NET/default.aspx">.NET</category><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/WCF/default.aspx">WCF</category><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/REST/default.aspx">REST</category><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/emacs/default.aspx">emacs</category></item><item><title>Date and Time Values and Java Interop: a concrete example using XStream</title><link>http://blogs.msdn.com/dotnetinterop/archive/2007/10/10/date-and-time-values-and-xstream-interop.aspx</link><pubDate>Wed, 10 Oct 2007 17:51:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5174180</guid><dc:creator>DotNetInterop</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/dotnetinterop/comments/5174180.aspx</comments><wfw:commentRss>http://blogs.msdn.com/dotnetinterop/commentrss.aspx?PostID=5174180</wfw:commentRss><description>&lt;FONT size=2 family="Calibri"&gt;
&lt;P&gt;Last month &lt;A class="" href="http://blogs.msdn.com/dotnetinterop/archive/2007/09/27/datetime-and-interop-again.aspx" mce_href="http://blogs.msdn.com/dotnetinterop/archive/2007/09/27/datetime-and-interop-again.aspx"&gt;I posted&lt;/A&gt; on Date and Time values and interop.&amp;nbsp; One of the key points I made is that you can lose information (specifically timezone information) when you transition from .NET to something else.&amp;nbsp;&amp;nbsp; If you stay within .NET, then you don't lose that information, even if you serialize to XML and then de-serialize.&amp;nbsp; If you transition outside of .NET, then you may lose information. &lt;/P&gt;
&lt;H3&gt;What do I mean by "serialize"?&amp;nbsp; &lt;/H3&gt;
&lt;P&gt;It is possible to produce an XML instance document that contains the state&amp;nbsp;stored within a .NET type.&amp;nbsp; Imagine a Person object that contains a name,&amp;nbsp;a birthdate, and a coolness rating.&amp;nbsp; These three data items might appear as three elements within the XML instance document that is produced via "serialization".&amp;nbsp; This is exactly what happens within a web services call.&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;Digression: Within a traditional request/response communication transaction, there are four transition points, points at which data enters or leaves an application.&amp;nbsp;Outbound transitions occur&amp;nbsp;when data is emitted from the app.&amp;nbsp; We call this serialization.&amp;nbsp;&amp;nbsp;&amp;nbsp;Inbound transitions occur when data enters the app from outside; this happens via de-serialization.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;The first outbound transition occurs when&amp;nbsp;transmitting the request on the caller.&amp;nbsp;The request is converted from an object graph stored in the memory of the .NET&amp;nbsp;application, into an XML instance document, via serialization.&amp;nbsp; The serialized request is then transmitted via some mechanism to the server.&amp;nbsp; On the receiving (server) side, the request is then converted into an in-memory object graph; this is an inbound transition, which occurs via de-serialization.&amp;nbsp; The server then performs some action and sends the response, which is a mirror image of the request, from the point of view of serialization and de-serialization.&amp;nbsp; Both outbound and inbound transitions are of the kind I&amp;nbsp; described in &lt;A class="" href="http://blogs.msdn.com/dotnetinterop/archive/2007/09/27/datetime-and-interop-again.aspx" mce_href="http://blogs.msdn.com/dotnetinterop/archive/2007/09/27/datetime-and-interop-again.aspx"&gt;that prior post&lt;/A&gt;, a transition you need to be careful about.&amp;nbsp; &lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;With each transition, there are two types of pitfalls, In my prior post I spoke of the loss of information. There is also the converse pitfall - one side of the transmission could provide more information than can be handled by the other.&amp;nbsp; Let's look at this case now.&amp;nbsp; &lt;/P&gt;
&lt;H3&gt;An Example&lt;/H3&gt;
&lt;P&gt;Here's a concrete example.&amp;nbsp; I'm going to take some data and serialize it to XML using .NET, and then de-serialize it from XML into an instance of a Java object.&amp;nbsp; For now I am not going to concern myself with the transport - the details of how the XML instance document gets from the .NET app to the Java application.&amp;nbsp; It could be any one of a number of ways:&amp;nbsp; REST-style invocation, shared filesystem, shared database, message queue, smtp, ftp, tcp transfer, and so on.&amp;nbsp; It could be wrapped in&amp;nbsp;syntactic sugar so you can call it a "web services call".&amp;nbsp; &amp;nbsp;It doesn't really matter.&amp;nbsp; I'm concerned here only with the serialization and de-serialization. &lt;/P&gt;
&lt;P&gt;For the Java side, I selected the &lt;A class="" href="http://xstream.codehaus.org/" mce_href="http://xstream.codehaus.org/"&gt;XStream&lt;/A&gt; Java XML Serialization package (version 1.2.2).&amp;nbsp; The thing about Java is, there are about a thousand and one XML Serialization libraries out there, and you know, every one of them is a little different.&amp;nbsp; Apparently many people each thought they could build a better mousetrap, and so there are now a zillion choices for Java-based XML serialization libraries.&amp;nbsp; As to which is "best" ?&amp;nbsp; I will leave that to someone with more time than I have.&amp;nbsp; In any case, XStream is pretty easy to use, and seems to be reasonably common, so I chose that.&amp;nbsp; (I have previously used JAXB as well as the &lt;A class="" href="http://xmlbeans.apache.org/" mce_href="http://xmlbeans.apache.org/"&gt;Apache XMLBeans&lt;/A&gt;&amp;nbsp;library.&amp;nbsp; This time, I chose a different library.)&lt;/P&gt;
&lt;P&gt;Ok,&amp;nbsp;now in this scenario, the classes on the .NET side and on the Java side are pretty simple. The .NET class looks like this:&lt;/P&gt;
&lt;DIV style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: Courier New"&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; [XmlRoot(&lt;SPAN style="COLOR: #a31515"&gt;"person"&lt;/SPAN&gt;)]&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;2&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;class&lt;/SPAN&gt; Person &lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;3&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;4&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; Person() {}&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;5&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; Person(&lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt; name, &lt;SPAN style="COLOR: #2b91af"&gt;DateTime&lt;/SPAN&gt; birthdate, &lt;SPAN style="COLOR: blue"&gt;int&lt;/SPAN&gt; rating) &lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;6&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;7&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; _birthdate= birthdate;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;8&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; _rating= rating;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;9&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; _name= name;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;10&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;11&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;12&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [XmlElement(&lt;SPAN style="COLOR: #a31515"&gt;"name"&lt;/SPAN&gt;)]&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;13&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt; _name;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;14&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;15&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [XmlElement(&lt;SPAN style="COLOR: #a31515"&gt;"rating"&lt;/SPAN&gt;)]&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;16&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;int&lt;/SPAN&gt; _rating;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;17&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;18&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [XmlElement(&lt;SPAN style="COLOR: #a31515"&gt;"birthdate"&lt;/SPAN&gt;, DataType=&lt;SPAN style="COLOR: #a31515"&gt;"dateTime"&lt;/SPAN&gt;)]&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;19&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; System.&lt;SPAN style="COLOR: #2b91af"&gt;DateTime&lt;/SPAN&gt; _birthdate;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;20&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;/DIV&gt;
&lt;P mce_keep="true"&gt;You can see that&amp;nbsp;one of the data members in the .NET type is a DateTime value.&amp;nbsp; There are a&amp;nbsp;number of options for serializing a DateTime value into XML.&amp;nbsp; One option is to serialize it as a number, for example a time_t quantity which from my Un*x days is a 32-bit quantity representing the number of seconds that have elapsed since January 1st, 1970.&amp;nbsp; This is an interesting option but not one I explored for this example.&amp;nbsp; Another set of options is to serialize it as one of the xsd built-in types, like xsd:dateTime, xsd:date, or xsd:time, as defined in the XML Schema standard.&amp;nbsp;&amp;nbsp; I chose the xsd dateTime type, as you can see from the attribute on line 18 in the code above.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;There is a corresponding Java class; It looks like this: &lt;/P&gt;
&lt;DIV style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: Courier New"&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;class&lt;/SPAN&gt; MyData&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;2&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;3&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: green"&gt;// fields to be serialized&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;4&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;String&lt;/SPAN&gt; name;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;5&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;int&lt;/SPAN&gt; count; &lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;6&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; java.util.&lt;SPAN style="COLOR: #2b91af"&gt;Date&lt;/SPAN&gt; date;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;7&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;/DIV&gt;
&lt;P mce_keep="true"&gt;The Java class lacks annotations because the XStream library I chose allows me to specify the Java-to-XML binding in code, programmatically.&amp;nbsp; &lt;/P&gt;
&lt;H3&gt;Serializing from .NET&lt;/H3&gt;
&lt;P mce_keep="true"&gt;I use this kind of code to serialize from an instance of the object in .NET to an XML document: &lt;/P&gt;
&lt;DIV style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: Courier New"&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; XmlSerializerNamespaces ns = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; XmlSerializerNamespaces();&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;2&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; ns.Add( &lt;SPAN style="COLOR: #a31515"&gt;""&lt;/SPAN&gt;, &lt;SPAN style="COLOR: #a31515"&gt;""&lt;/SPAN&gt; );&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;3&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;4&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; System.&lt;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;.WriteLine(&lt;SPAN style="COLOR: #a31515"&gt;"\n\nThe serialized Person:\n"&lt;/SPAN&gt;);&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;5&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; s1.Serialize(&lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; XTWFND(System.&lt;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;.Out), d1, ns);&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;6&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; System.&lt;SPAN style="COLOR: #2b91af"&gt;Console&lt;/SPAN&gt;.WriteLine(&lt;SPAN style="COLOR: #a31515"&gt;"\n"&lt;/SPAN&gt;);&lt;/P&gt;&lt;/DIV&gt;
&lt;P mce_keep="true"&gt;The XmlSerializerNamespaces thing just tells the serializer to omit the default namespaces.&amp;nbsp; I do this only to tidy up the resulting XML.&amp;nbsp; Also, that XTWFND is defined like so: &lt;/P&gt;
&lt;DIV style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: Courier New"&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt; XmlTextWriterFormattedNoDeclaration&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;2&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt; helper class : eliminates the XML Documentation at the&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;3&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt; start of a XML doc. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;4&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt;&lt;SPAN style="COLOR: green"&gt; XTWFND = XmlTextWriterFormattedNoDeclaration&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;5&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;class&lt;/SPAN&gt; XTWFND&amp;nbsp; : System.Xml.XmlTextWriter {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;6&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; XTWFND (System.IO.&lt;SPAN style="COLOR: #2b91af"&gt;TextWriter&lt;/SPAN&gt; w) : &lt;SPAN style="COLOR: blue"&gt;base&lt;/SPAN&gt;(w) { Formatting= System.Xml.Formatting.Indented;}&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;7&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;override&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; WriteStartDocument () { }&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;8&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;/DIV&gt;
&lt;P mce_keep="true"&gt;It is a helper class, an XmlTextWriter that indents and does not emit an XML Declaration line; again, this is for cleaner XML but is not strictly necessary for interop.&lt;/P&gt;
&lt;P mce_keep="true"&gt;The XML resulting from this code looks like this: &lt;/P&gt;
&lt;DIV style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: Courier New"&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;person&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;name&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;Yiifusxxwic&lt;SPAN style="COLOR: blue"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;name&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;rating&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;859&lt;SPAN style="COLOR: blue"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;rating&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;birthdate&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;2007-10-08T22:56:45.8697911-07:00&lt;SPAN style="COLOR: blue"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;birthdate&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;person&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;
&lt;H3&gt;Serializing from Java&lt;/H3&gt;
&lt;P&gt;In Java with XStream, we can do something similar. The code to serialize looks like this: &lt;/P&gt;
&lt;DIV style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: Courier New"&gt;
&lt;P style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Person p1= getInstance();&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; XStream xstream= &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; XStream();&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; xstream.alias(&lt;SPAN style="COLOR: #a31515"&gt;"person"&lt;/SPAN&gt;, Person.&lt;SPAN style="COLOR: blue"&gt;class&lt;/SPAN&gt;);&lt;/P&gt;
&lt;P style="MARGIN: 0px" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: #2b91af"&gt;System&lt;/SPAN&gt;.out.println(xstream.toXML(p1));&lt;/P&gt;&lt;/DIV&gt;
&lt;P&gt;And then&amp;nbsp;XStream infers the element names from the names of the&amp;nbsp;members in the class.&amp;nbsp; The resulting XML document looks like this: &lt;/P&gt;
&lt;DIV style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: Courier New"&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;person&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;name&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;Mvsnyzilgen&lt;SPAN style="COLOR: blue"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;name&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;rating&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;426&lt;SPAN style="COLOR: blue"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;rating&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;birthdate&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;2007-10-08 23:17:11.679 PDT&lt;SPAN style="COLOR: blue"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;birthdate&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;person&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;
&lt;P&gt;Looks pretty similar to the XML generated from .NET, right? Yes, it is &lt;STRONG&gt;Similar&lt;/STRONG&gt;, but &lt;STRONG&gt;not the same.&lt;/STRONG&gt; And because the XML is not the same format on either end of the wire, interop isn't happening. &lt;/P&gt;
&lt;P&gt;When .NET serializes the DateTime value, it uses the xsd:dateTime format, which includes a timezone specified in "offset from UTC". The default Date serialization in XStream does not. But, there is a nice ISO8601DateConverter in XStream. This gives you application code like so: &lt;/P&gt;
&lt;DIV style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: Courier New"&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Person p1= getInstance();&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;2&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; XStream xstream= &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; XStream();&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;3&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xstream.alias(&lt;SPAN style="COLOR: #a31515"&gt;"person"&lt;/SPAN&gt;, Person.&lt;SPAN style="COLOR: blue"&gt;class&lt;/SPAN&gt;);&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;4&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xstream.registerConverter(&lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; ISO8601DateConverter());&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;5&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;6&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: #2b91af"&gt;System&lt;/SPAN&gt;.out.println(xstream.toXML(p1));&lt;/P&gt;&lt;/DIV&gt;
&lt;P&gt;This modified usage gives you XML out of the Java application like this: &lt;/P&gt;
&lt;DIV style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: Courier New"&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;person&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;name&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;Kgdtqgcdyxg&lt;SPAN style="COLOR: blue"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;name&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;rating&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;211&lt;SPAN style="COLOR: blue"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;rating&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;birthdate&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;2007-10-08T23:21:44.931-07:00&lt;SPAN style="COLOR: blue"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;birthdate&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;person&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/DIV&gt;
&lt;P&gt;...which is much closer to what we want.&lt;/P&gt;
&lt;H3&gt;Deserializing&lt;/H3&gt;
&lt;P&gt;De-serializing from within .NET is pretty simple. We can do it with code like this:&lt;/P&gt;
&lt;DIV style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: Courier New"&gt;
&lt;P style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt; xmlFromXstream =&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: #a31515"&gt;"&amp;lt;person&amp;gt;\n"&lt;/SPAN&gt; +&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: #a31515"&gt;"&amp;nbsp; &amp;lt;name&amp;gt;Jjqbrkqcnuk&amp;lt;/name&amp;gt;\n"&lt;/SPAN&gt; +&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: #a31515"&gt;"&amp;nbsp; &amp;lt;rating&amp;gt;934&amp;lt;/rating&amp;gt;\n"&lt;/SPAN&gt; +&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: #a31515"&gt;"&amp;nbsp; &amp;lt;birthdate&amp;gt;2007-10-08T23:21:44.931-07:00&amp;lt;/birthdate&amp;gt;\n"&lt;/SPAN&gt; +&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: #a31515"&gt;"&amp;lt;/person&amp;gt;\n"&lt;/SPAN&gt;;&lt;/P&gt;
&lt;P style="MARGIN: 0px" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Person d2 = (Person)s1.Deserialize(&lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; System.Xml.XmlTextReader(&lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; System.IO.&lt;SPAN style="COLOR: #2b91af"&gt;StringReader&lt;/SPAN&gt;(xmlFromXstream)));&lt;/P&gt;&lt;/DIV&gt;
&lt;P&gt;And slurping in the XML as generated from XStream, &lt;EM&gt;just works.&lt;/EM&gt; &lt;/P&gt;
&lt;P&gt;De-serializing from within Java with XStream is similar. The code looks like this:&lt;/P&gt;
&lt;DIV style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: Courier New"&gt;
&lt;P style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: #2b91af"&gt;String&lt;/SPAN&gt; xmlFromDotNet = &lt;SPAN style="COLOR: #a31515"&gt;"&amp;lt;person&amp;gt;"&lt;/SPAN&gt; +&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: #a31515"&gt;"&amp;nbsp; &amp;lt;name&amp;gt;Sxgiyg&amp;lt;/name&amp;gt;"&lt;/SPAN&gt; +&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: #a31515"&gt;"&amp;nbsp; &amp;lt;rating&amp;gt;859&amp;lt;/rating&amp;gt;"&lt;/SPAN&gt; +&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: #a31515"&gt;"&amp;nbsp; &amp;lt;birthdate&amp;gt;2007-10-08T22:06:28.8700931-07:00&amp;lt;/birthdate&amp;gt;"&lt;/SPAN&gt; +&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;SPAN style="COLOR: #a31515"&gt;"&amp;lt;/person&amp;gt;"&lt;/SPAN&gt;;&lt;/P&gt;
&lt;P style="MARGIN: 0px" mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Person p2 = (Person)xstream.fromXML(xmlFromDotNet);&lt;/P&gt;&lt;/DIV&gt;
&lt;P&gt;But this &lt;EM&gt;does not work&lt;/EM&gt;. This is because .NET serializes time values with a higher precision than Java can deal with. Look closely at the birthdate values generated from .NET and compare them to the birthdate values generated from Java.&amp;nbsp; If you look carefully you will see that the dates generated from .NET have&amp;nbsp;7 decimal digits of precision, while Java has just 3.&amp;nbsp; And Java is not able to de-serialize from the more precise representation generated by .NET!&amp;nbsp; Ack!&amp;nbsp; &lt;/P&gt;
&lt;P&gt;What to do?&amp;nbsp; The easiest thing to do, if you don't mind the loss of precision,&amp;nbsp;is to&amp;nbsp;modify the .NET class to serialize&amp;nbsp;the dateTime value into something XStream&amp;nbsp;can handle.&amp;nbsp; We can do this by modifying the type to look like this:&lt;/P&gt;
&lt;DIV style="FONT-SIZE: 10pt; BACKGROUND: white; COLOR: black; FONT-FAMILY: Courier New"&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;1&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; [XmlRoot(&lt;SPAN style="COLOR: #a31515"&gt;"person"&lt;/SPAN&gt;)]&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;2&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;class&lt;/SPAN&gt; Person&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;3&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;4&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;private&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;static&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt; formatString= &lt;SPAN style="COLOR: #a31515"&gt;"yyyy-MM-ddTHH:mm:ss.fffzzz"&lt;/SPAN&gt;;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;5&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;6&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; Person() { }&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;7&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; Person(&lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt; name, &lt;SPAN style="COLOR: #2b91af"&gt;DateTime&lt;/SPAN&gt; birthdate, &lt;SPAN style="COLOR: blue"&gt;int&lt;/SPAN&gt; rating)&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;8&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;9&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; _birthdate = birthdate;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;10&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; _rating = rating;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;11&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; _name = name;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;12&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;13&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;14&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [XmlElement(&lt;SPAN style="COLOR: #a31515"&gt;"name"&lt;/SPAN&gt;)]&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;15&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt; _name;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;16&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;17&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [XmlElement(&lt;SPAN style="COLOR: #a31515"&gt;"rating"&lt;/SPAN&gt;)]&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;18&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;int&lt;/SPAN&gt; _rating;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;19&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;20&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [XmlElement(&lt;SPAN style="COLOR: #a31515"&gt;"birthdate"&lt;/SPAN&gt;)]&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;21&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt; _bdayString&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;22&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;23&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;get&lt;/SPAN&gt; { &lt;SPAN style="COLOR: blue"&gt;return&lt;/SPAN&gt; _birthdate.ToString(formatString); }&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;24&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;set&lt;/SPAN&gt; &lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;25&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; { &lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;26&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;try&lt;/SPAN&gt; {&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;27&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; _birthdate = &lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;28&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; System.&lt;SPAN style="COLOR: #2b91af"&gt;DateTime&lt;/SPAN&gt;.ParseExact(&lt;SPAN style="COLOR: blue"&gt;value&lt;/SPAN&gt;,&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;29&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;string&lt;/SPAN&gt;[] {formatString}, &lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;30&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; System.Globalization.&lt;SPAN style="COLOR: #2b91af"&gt;CultureInfo&lt;/SPAN&gt;(&lt;SPAN style="COLOR: #a31515"&gt;"en-US"&lt;/SPAN&gt;, &lt;SPAN style="COLOR: blue"&gt;true&lt;/SPAN&gt;), &lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;31&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; System.Globalization. &lt;SPAN style="COLOR: #2b91af"&gt;DateTimeStyles&lt;/SPAN&gt;.AllowWhiteSpaces);&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;32&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; }&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;33&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;catch&lt;/SPAN&gt; {}&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;34&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; }&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;35&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;36&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;37&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [XmlIgnore]&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;38&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; System.&lt;SPAN style="COLOR: #2b91af"&gt;DateTime&lt;/SPAN&gt; _birthdate;&lt;/P&gt;
&lt;P style="MARGIN: 0px"&gt;&lt;SPAN style="COLOR: #2b91af"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;39&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;/DIV&gt;
&lt;P&gt;This "hides" the actual DateTime value from the XML serializer with the XmlIgnore attribute, but then serializes in its place, a string, formatted just the way Java wants it. The getter and setter on the string property allows the serialization and de-serialization to work reflexively, using the same format.&amp;nbsp; The XML generated from that Person type works nicely with the Java code I showed previously.&amp;nbsp; &lt;/P&gt;
&lt;H3&gt;Where are We?&lt;/H3&gt;
&lt;P&gt;This example shows that .NET and Java can use XML to interop, but it shows some of the pitfalls associated with DateTime values and loss of information on serialization.&amp;nbsp; In particular it shows that you need to serialize an common dateTime format (ISO8601&amp;nbsp;mostly works)&amp;nbsp;and you need to be careful of precision on either side.&amp;nbsp; We did not cover Nillable Date values&amp;nbsp; - that's another pitfall I will leave for another day.&amp;nbsp; &lt;/P&gt;
&lt;P mce_keep="true"&gt;Check the attachments for the full source code. &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;/FONT&gt;&lt;FONT size=3&gt;&lt;/FONT&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=5174180" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/dotnetinterop/attachment/5174180.ashx" length="3041" type="application/x-zip-compressed" /><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/Interop/default.aspx">Interop</category><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/XML/default.aspx">XML</category><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/.NET/default.aspx">.NET</category><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/Java/default.aspx">Java</category></item><item><title>Open XML a superb standard - says Mono dude </title><link>http://blogs.msdn.com/dotnetinterop/archive/2007/09/11/open-xml-a-superb-standard-says-mono-dude.aspx</link><pubDate>Wed, 12 Sep 2007 05:25:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4874258</guid><dc:creator>DotNetInterop</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/dotnetinterop/comments/4874258.aspx</comments><wfw:commentRss>http://blogs.msdn.com/dotnetinterop/commentrss.aspx?PostID=4874258</wfw:commentRss><description>&lt;FONT size=3&gt;&lt;FONT face=Calibri&gt;
&lt;P&gt;Slashdot reports that Miguel de Icaza, founder of GNOME and Mono, recently remarked in a Google groups discussion that Open XML is a “superb standard” and that the spec has been unfairly criticized. “&lt;EM&gt;OOXML is a superb standard and yet, it has been FUDed so badly by its competitors that serious people believe that there is something fundamentally wrong with it. This is at a time when OOXML as a spec is in much better shape than any other spec on that space. Besides, it is always better to have two implementations and then standardize than trying to standardize a single implementation.&lt;/EM&gt;”&lt;/P&gt;
&lt;P&gt;The slashdot post:&lt;BR&gt;&lt;A href="http://linux.slashdot.org/linux/07/09/10/2343256.shtml" mce_href="http://linux.slashdot.org/linux/07/09/10/2343256.shtml"&gt;http://linux.slashdot.org/linux/07/09/10/2343256.shtml&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;The google groups discussion thread:&lt;BR&gt;&lt;A href="http://groups.google.com/group/tiraniaorg-blog-comments/browse_thread/thread/2a07b8b50038d8c8/d582162af2d63d57" mce_href="http://groups.google.com/group/tiraniaorg-blog-comments/browse_thread/thread/2a07b8b50038d8c8/d582162af2d63d57"&gt;http://groups.google.com/group/tiraniaorg-blog-comments/browse_thread/thread/2a07b8b50038d8c8/d582162af2d63d57&lt;/A&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4874258" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/Interop/default.aspx">Interop</category><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/OpenXML/default.aspx">OpenXML</category><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/XML/default.aspx">XML</category></item><item><title>Fact Check – IBM’s Steve Mills claims on MS and SOA</title><link>http://blogs.msdn.com/dotnetinterop/archive/2007/08/09/fact-check-ibm-s-steve-mills-claims-on-ms-and-soa.aspx</link><pubDate>Fri, 10 Aug 2007 03:13:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4315768</guid><dc:creator>DotNetInterop</dc:creator><slash:comments>7</slash:comments><comments>http://blogs.msdn.com/dotnetinterop/comments/4315768.aspx</comments><wfw:commentRss>http://blogs.msdn.com/dotnetinterop/commentrss.aspx?PostID=4315768</wfw:commentRss><description>&lt;P&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;We saw &lt;A href="http://news.zdnet.co.uk/software/0%2c1000000121%2c39288465%2c00.htm" mce_href="http://news.zdnet.co.uk/software/0%2c1000000121%2c39288465%2c00.htm"&gt;an article on CNET&lt;/A&gt; that included quotes from Steve Mills of IBM directly related to Interop, SOA and Microsoft.&amp;nbsp; Since Interop is one of our passions, we thought it would be worthwhile to respond.&amp;nbsp; Given that we are approaching an election here in the US, we are employing a CNN technique. Let's check the facts. &lt;SPAN style="FONT-FAMILY: Times New Roman"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;&lt;STRONG&gt;Claim:&lt;/STRONG&gt;&amp;nbsp; Steve Mills is Senior VP of IBM Software.&lt;SPAN style="FONT-FAMILY: Times New Roman"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;&lt;STRONG&gt;Microsoft Fact Check:&lt;/STRONG&gt;&amp;nbsp; &lt;STRONG&gt;TRUE. &lt;/STRONG&gt;Mr. Mills runs IBM Software, which is about a USD $18B business for IBM.&amp;nbsp;&amp;nbsp; By the way, IBM Software Group contributes about 40% of IBM's pre-tax profit, according to &lt;A href="http://www.computerworld.com/action/article.do?command=printArticleBasic&amp;amp;articleId=293415" mce_href="http://www.computerworld.com/action/article.do?command=printArticleBasic&amp;amp;articleId=293415"&gt;a recent ComputerWorld article&lt;/A&gt;.&amp;nbsp; &lt;SPAN style="FONT-FAMILY: Times New Roman"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;&lt;STRONG&gt;Claim:&lt;/STRONG&gt;&amp;nbsp; Microsoft's approach to SOA [is] stymied by its emphasis on linking Microsoft-compatible processes. "We're doing all platforms; all applications," IBM Software Group executive Steven Mills told ZDNet.co.uk. "We're integrating everything. Microsoft is trying to provide connectivity capabilities for those that are running on Windows platforms. That's a profound difference."&lt;SPAN style="FONT-FAMILY: Times New Roman"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;&lt;STRONG&gt;Microsoft Fact Check:&lt;/STRONG&gt;&amp;nbsp; Mr. Mills seems to be commenting on &lt;A href="http://www.microsoft.com/soa" mce_href="http://www.microsoft.com/soa"&gt;Microsoft SOA infrastructure software&lt;/A&gt;, including the .NET Framework (and WCF, and WF, and all the constituent technologies), BizTalk Server, Host Integration technologies, and so on.&amp;nbsp; If the claim is that this Microsoft software runs only on Windows, then this is &lt;STRONG&gt;TRUE&lt;/STRONG&gt;.&amp;nbsp;&amp;nbsp; This is not a particularly novel, interesting or relevant observation.&amp;nbsp;&amp;nbsp; Incidentally, it applies to Mr. Mills' portfolio as well: CICS and IMS for example.&amp;nbsp; Or consider DB2: it runs on many systems, but the capabilities in the mainframe version&amp;nbsp;differ from those versions for other platforms. &lt;SPAN style="FONT-FAMILY: Times New Roman"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;Mr. Mills seems to be saying something different:&amp;nbsp; he seems to be implying, because BizTalk Server (as one example) runs only on Windows, then it can connect only to other Windows-based systems or applications.&amp;nbsp; That is &lt;STRONG&gt;FALSE&lt;/STRONG&gt;.&amp;nbsp; The facts are: the vast majority of the over 7,000 BizTalk Server customers use the technology to connect with assets on UNIX, Linux and mainframe based systems: 92% perform heterogeneous platform integration.&amp;nbsp; In fact, Microsoft has long offered a technology that does &lt;A href="http://www.microsoft.com/hiserver/default.mspx" mce_href="http://www.microsoft.com/hiserver/default.mspx"&gt;nothing but integrat&lt;SPAN style="COLOR: #1f497d"&gt;e&lt;/SPAN&gt; with IBM's iSeries and zSeries technologies&lt;/A&gt;. (it accomplishes this via IBM's proprietary protocols, which Microsoft must license). &lt;SPAN style="FONT-FAMILY: Times New Roman"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;&lt;STRONG&gt;Claim:&lt;/STRONG&gt; "Their perspective is how to make Windows environments connect, as long as you're using Microsoft technology. Our view is: how do you make every environment connect whether you are using Microsoft or anyone else's technology," Mills said.&lt;SPAN style="FONT-FAMILY: Times New Roman"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;&lt;STRONG&gt;Microsoft Fact Check:&lt;/STRONG&gt;&amp;nbsp; This is the continuation of Mr. Mills' previous thought.&amp;nbsp;&amp;nbsp;&amp;nbsp; In virtually every enterprise above a certain size or age, the rule is heterogeneity in IT.&amp;nbsp; Whether you're an &lt;A href="http://www.microsoft.com/casestudies/casestudy.aspx?casestudyid=1000003766" mce_href="http://www.microsoft.com/casestudies/casestudy.aspx?casestudyid=1000003766"&gt;international bank&lt;/A&gt;, a &lt;A href="http://www.microsoft.com/casestudies/casestudy.aspx?casestudyid=4000000313" mce_href="http://www.microsoft.com/casestudies/casestudy.aspx?casestudyid=4000000313"&gt;specialty manufacturer&lt;/A&gt;, or &lt;A href="http://www.microsoft.com/casestudies/casestudy.aspx?casestudyid=201405" mce_href="http://www.microsoft.com/casestudies/casestudy.aspx?casestudyid=201405"&gt;a chain of sushi restaurants&lt;/A&gt;, there's a myriad of information systems and applications you need to deal with, and better connections among those systems allows you to run your business better.&amp;nbsp; That's what SOA is about, and that's what Microsoft's SOA platform infrastructure is designed to help with.&amp;nbsp; Thus, &lt;STRONG&gt;FALSE.&lt;/STRONG&gt;&lt;SPAN style="FONT-FAMILY: Times New Roman"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;&lt;STRONG&gt;Claim:&lt;/STRONG&gt; Mills claimed there is a big difference between IBM and Microsoft's approaches, saying that, in contrast to Microsoft, IBM uses open standards for XML and web services.&lt;SPAN style="FONT-FAMILY: Times New Roman"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;&lt;STRONG&gt;Microsoft Fact Check:&lt;/STRONG&gt;&amp;nbsp; &lt;STRONG&gt;FALSE. &lt;/STRONG&gt;Implying that Microsoft does not support standards like XML and WS-* is odd.&amp;nbsp; This denies the reality of the past 7 years, during which Microsoft has repeatedly been &lt;A href="http://mediaproducts.gartner.com/reprints/microsoft/article14a/article14a.html" mce_href="http://mediaproducts.gartner.com/reprints/microsoft/article14a/article14a.html"&gt;recognized by independent analysts&lt;/A&gt; as leading the industry drive toward defining and implementing open protocol standards such as XML, and WS-*.&amp;nbsp; It is also an attempt to revise history as Microsoft and IBM partnered on Web Services Standards in 1999 which led to the original specifications. Mr. Mills himself stood up with Bill Gates to talk about the two companies' collaboration on these standards.&amp;nbsp; Moreover, Microsoft and IBM have continuously defined additional Web service specifications and publicly tested interoperability. Examples include WSDL, WS-Security, WS-ReliableMessaging, etc.&lt;SPAN style="FONT-FAMILY: Times New Roman"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;But let's talk specifics.&amp;nbsp; Take one example: XML Serialization.&amp;nbsp; XML Serialization has been part of the .NET Framework since v1.0.&amp;nbsp; XML Serialization allows a developer to map between instances of objects in a program, and instances of XML documents, very simply.&amp;nbsp; This is a key interop-enabling capability; it means, in part, that a .NET application running on Windows can very simply emit an XML instance document that can then be consumed by any other XML-capable application, running on any other platform.&amp;nbsp;Or vice versa. And it's a foundation for other, higher-level interop capabilities: start with XML Serialization and add in message transport and tools, and you then can get Web services. &lt;SPAN style="FONT-FAMILY: Times New Roman"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;This XML support has continued through the versions of .NET across the years, and has been expanded significantly.&amp;nbsp; WCF, shipped in .NET 3.0 in December 2006, added some new capabilities and more mature models – dealing with XML in .NET apps is now both easier and more flexible.&amp;nbsp; The list of open standard protocols supported in WCF includes:&amp;nbsp; HTTP1.1, XML, SOAP1.1, SOAP1.2, WS-Addressing,&amp;nbsp; XOP, MTOM, WS-Security (including x.509, Kerberos, and SAML 1.1 token profiles), WS-Policy, WS-Trust, WS-Coordination, WS-AtomicTransaction, WS-SecureConversation, WSDL 1.1, WS-MetadataExchange, WS-Transfer.&amp;nbsp; Looking forward, in the .NET Framework v3.5 (currently at &lt;A href="http://www.microsoft.com/downloads/details.aspx?FamilyId=D2F74873-C796-4E60-91C8-F0EF809B09EE&amp;amp;displaylang=en" mce_href="http://www.microsoft.com/downloads/details.aspx?FamilyId=D2F74873-C796-4E60-91C8-F0EF809B09EE&amp;amp;displaylang=en"&gt;beta 2&lt;/A&gt;), we've included support for REST-style web services, as well as internet syndication protocols like ATOM and RSS, and other protocols like JSON.&amp;nbsp; &lt;SPAN style="FONT-FAMILY: Times New Roman"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;Microsoft does support optimized protocols and formats in WCF for Windows-to-Windows communication. IBM provides similar optimizations for their products, as do all SOA platforms.&lt;SPAN style="FONT-FAMILY: Times New Roman"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;&lt;STRONG&gt;Claim:&lt;/STRONG&gt; &lt;A title="Microsoft Office Open XML gets US knockback" href="http://news.zdnet.co.uk/itmanagement/0,1000000308,39288082,00.htm" mce_href="http://news.zdnet.co.uk/itmanagement/0,1000000308,39288082,00.htm"&gt;Microsoft and IBM have tussled over XML standards&lt;/A&gt;. &lt;SPAN style="FONT-FAMILY: Times New Roman"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;&lt;STRONG&gt;Microsoft Fact Check:&lt;/STRONG&gt;&amp;nbsp; &lt;STRONG&gt;TRUE. &lt;/STRONG&gt;But, like the observation that Windows&amp;nbsp;is the OS that underlies Microsoft SOA infrastructure, this is not an interesting part of the story. The picture that is painted by the article would lead one to suspect that a tussle over standards is exclusionary or at least stalling productivity.&amp;nbsp; Coexistence of multiple standards and encouraging market participation in standards evolution is paramount.&amp;nbsp; The OOXML / ODF point in the article is like saying you won't be able to send digital pictures to your mom because there isn't a single standard for graphic presentation.&amp;nbsp; Clearly there are multiple standards for digital images, gif, jpeg, png and so on - which has arguably helped drive utilization.&amp;nbsp; The far more important point is implementation of multiple standards which Microsoft technology does. &lt;SPAN style="FONT-FAMILY: Times New Roman"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;OOXML and ODF are about &lt;EM&gt;documents.&amp;nbsp; &lt;/EM&gt;Discussion of documents needs to include &lt;EM&gt;all&lt;/EM&gt; standards, many of which Microsoft supports and has lead. Examples include HTML, CSS, etc.&lt;SPAN style="FONT-FAMILY: Times New Roman"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;&lt;STRONG&gt;Claim:&lt;/STRONG&gt; "The [Microsoft] MSDN mechanism is a lightweight messaging infrastructure in a message-based environment, whereas IBM delivers a fully functioning infrastructure," [Mr. Mills] said.&lt;SPAN style="FONT-FAMILY: Times New Roman"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;&lt;STRONG&gt;Microsoft Fact Check:&lt;/STRONG&gt;&amp;nbsp; &lt;STRONG&gt;FALSE,&lt;/STRONG&gt; judging from the wide variety of customer case studies that describe how customers utilize .NET and the rest of the Microsoft platform to broadly exploit the benefits of SOA. Microsoft customers use the Microsoft SOA infrastructure to run the core information systems that power their businesses.&amp;nbsp;&amp;nbsp; IBM's Web sites discusses the "entry points" to SOA. Microsoft has equivalent products in Microsoft Office Sharepoint, IIS/ASP.NET, BizTalk Server, WCF, Visual Studio and adaptors for existing applications.&lt;SPAN style="FONT-FAMILY: Times New Roman"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;As a side note, &lt;A href="http://msdn.microsoft.com/" mce_href="http://msdn.microsoft.com/"&gt;MSDN&lt;/A&gt; is a developer-outreach program, including a website, a software subscription and licensing offering, a magazine, and more.&amp;nbsp; It's not directly related to SOA infrastructure.&amp;nbsp; IBM has &lt;A href="http://www.ibm.com/developerworks" mce_href="http://www.ibm.com/developerworks"&gt;developerWorks&lt;/A&gt;, which is similar in intent.&amp;nbsp; &lt;SPAN style="FONT-FAMILY: Times New Roman"&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;SPAN style="FONT-SIZE: 13pt; COLOR: #4f81bd; FONT-FAMILY: Cambria"&gt;In Closing&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 18pt; FONT-FAMILY: Arial"&gt; &lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;Do you want to know just how serious we are about Interop and Performance? Take a look at our &lt;A href="http://www.msdn.com/stocktrader" mce_href="http://www.msdn.com/stocktrader"&gt;.NET Stock Trader application&lt;/A&gt; which we modeled after IBM's Trade 6.1 performance application.&amp;nbsp; We've demonstrated our ability to interoperate with applications that run on other platforms including IBM WebSphere applications running on Windows, Linux, or Unix™ .&amp;nbsp;&amp;nbsp; Don't miss this part: the .NET application duplicates the function of the Websphere app, but with &lt;A href="http://go.microsoft.com/?linkid=6895275" mce_href="http://go.microsoft.com/?linkid=6895275"&gt;far better performance&lt;/A&gt;.&lt;SPAN style="FONT-FAMILY: Times New Roman"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 12pt"&gt;&lt;EM&gt;[This article was drafted by Dino Chiesa and &lt;A class="" href="http://blogs.msdn.com/stevemar/" mce_href="http://blogs.msdn.com/stevemar/"&gt;Steven Martin&lt;/A&gt;.&amp;nbsp; It is being posted on both of our respective blogs.]&lt;/EM&gt;&lt;SPAN style="FONT-FAMILY: Times New Roman"&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=4315768" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/Interop/default.aspx">Interop</category><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/XSD/default.aspx">XSD</category><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/XML/default.aspx">XML</category><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/RSS/default.aspx">RSS</category><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/Websphere/default.aspx">Websphere</category><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/IBM/default.aspx">IBM</category><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/WCF/default.aspx">WCF</category><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/Java/default.aspx">Java</category></item><item><title>Interop between ASMX and WCF Services</title><link>http://blogs.msdn.com/dotnetinterop/archive/2007/07/19/interop-between-asmx-and-wcf-services.aspx</link><pubDate>Fri, 20 Jul 2007 04:08:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3965100</guid><dc:creator>DotNetInterop</dc:creator><slash:comments>9</slash:comments><comments>http://blogs.msdn.com/dotnetinterop/comments/3965100.aspx</comments><wfw:commentRss>http://blogs.msdn.com/dotnetinterop/commentrss.aspx?PostID=3965100</wfw:commentRss><description>&lt;P&gt;My esteemed colleague, &lt;A class="" href="http://www.casadehambone.com/" mce_href="http://www.casadehambone.com"&gt;Kevin&lt;/A&gt;, is working on a project where the customer has a bunch of ASP.NET (ASMX) web services, and they are looking at migrating to WCF. The customer's goal is simplicity: in stage 1, they'd like to keep their ASMX files, keep the IIS hosting, but add a .svc file to &lt;EM&gt;also&lt;/EM&gt; host the service also in WCF. In stage 2, they'd like to turn off the ASMX endpoint and use &lt;EM&gt;only&lt;/EM&gt; the WCF (.svc) endpoint. All this while keeping the existing client code unchanged: no new code, no re-compile, nothing. A .NET app with a web service stub generated from wsdl.exe should be able to talk to the new service hosted in WCF. &lt;/P&gt;
&lt;P&gt;This ought to be pretty simple, right? Kevin found an MSDN article on this topic, &lt;A href="http://msdn2.microsoft.com/en-us/library/aa738697.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/aa738697.aspx"&gt;How to: Migrate a ASP.NET Web Service Code to the Windows Communication Foundation&lt;/A&gt;&lt;SPAN style="COLOR: #1f497d"&gt;. &lt;/SPAN&gt;This article seems to work, though it doesn't address the specific requirements for Kevin's customer, which included &lt;EM&gt;simplicity&lt;/EM&gt;.&amp;nbsp; Following this article, which by the way is the "right" way to migrate from ASP.NET to WCF, you essentially re-implement everything in WCF.&amp;nbsp; Isn't there a simpler way?&lt;/P&gt;
&lt;P&gt;What Kevin did was pretty straightforward and sensible, and he thought it should work. He had a simple .ASMX file, which looked like this: &lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;SPAN style="BACKGROUND-COLOR: yellow"&gt;&amp;lt;%&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;@&lt;/SPAN&gt; &lt;SPAN style="COLOR: #a31515"&gt;WebService&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;Language&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="C#"&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;CodeBehind&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="~/App_Code/CommunicationService.cs"&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;Class&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="CommunicationService"&lt;/SPAN&gt; &lt;SPAN style="BACKGROUND-COLOR: yellow"&gt;%&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;/P&gt;
&lt;P&gt;The code-behind file contained the implementation of the service. It looked like this: &lt;/P&gt;
&lt;DIV style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 2pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 2pt; FONT-SIZE: 9pt; BACKGROUND: white; PADDING-BOTTOM: 2pt; BORDER-LEFT: windowtext 1pt solid; COLOR: black; LINE-HEIGHT: 98%; PADDING-TOP: 2pt; BORDER-BOTTOM: windowtext 1pt solid; FONT-FAMILY: Consolas, Courier New"&gt;
&lt;P&gt;[&lt;SPAN style="COLOR: #2b91af"&gt;WebService&lt;/SPAN&gt;(Namespace = &lt;SPAN style="COLOR: #a31515"&gt;"urn:namespace1"&lt;/SPAN&gt;)] &lt;BR&gt;[&lt;SPAN style="COLOR: #2b91af"&gt;WebServiceBinding&lt;/SPAN&gt;(ConformsTo = &lt;SPAN style="COLOR: #2b91af"&gt;WsiProfiles&lt;/SPAN&gt;.BasicProfile1_1)] &lt;BR&gt;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;class&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;CommunicationService&lt;/SPAN&gt; : System.Web.Services.&lt;SPAN style="COLOR: #2b91af"&gt;WebService &lt;/SPAN&gt;&lt;BR&gt;{ &lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; CommunicationService() { } &lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;[&lt;SPAN style="COLOR: #2b91af"&gt;WebMethod&lt;/SPAN&gt;] &lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;ComplexType &lt;/SPAN&gt;SendCommunication(&lt;SPAN style="COLOR: #2b91af"&gt;CommunicationEntity&lt;/SPAN&gt; Request) {...}&lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;... &lt;/P&gt;&lt;/DIV&gt;
&lt;P&gt;Kevin created a new .svc file for the WCF stuff: &lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;SPAN style="BACKGROUND-COLOR: yellow"&gt;&amp;lt;%&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;@&lt;/SPAN&gt; &lt;SPAN style="COLOR: #a31515"&gt;ServiceHost&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;Language&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="C#"&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;CodeBehind&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="~/App_Code/CommunicationService.cs"&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;Service&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="CommunicationService"&lt;/SPAN&gt; &lt;SPAN style="BACKGROUND-COLOR: yellow"&gt;%&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;/P&gt;
&lt;P&gt;And then he decorated the existing web service implementation class with the appropriate WCF attributes, something like this: &lt;/P&gt;
&lt;DIV style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 2pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 2pt; FONT-SIZE: 9pt; BACKGROUND: white; PADDING-BOTTOM: 2pt; BORDER-LEFT: windowtext 1pt solid; COLOR: black; LINE-HEIGHT: 98%; PADDING-TOP: 2pt; BORDER-BOTTOM: windowtext 1pt solid; FONT-FAMILY: Consolas, Courier New"&gt;
&lt;P&gt;[&lt;SPAN style="COLOR: #2b91af"&gt;WebService&lt;/SPAN&gt;(Namespace = &lt;SPAN style="COLOR: #a31515"&gt;"urn:namespace1"&lt;/SPAN&gt;)] &lt;BR&gt;[&lt;SPAN style="COLOR: #2b91af"&gt;WebServiceBinding&lt;/SPAN&gt;(ConformsTo = &lt;SPAN style="COLOR: #2b91af"&gt;WsiProfiles&lt;/SPAN&gt;.BasicProfile1_1)] &lt;BR&gt;[&lt;SPAN style="COLOR: #2b91af"&gt;ServiceContract&lt;/SPAN&gt;(Namespace= &lt;SPAN style="COLOR: #a31515"&gt;"urn:namespace1"&lt;/SPAN&gt;)] &lt;BR&gt;[&lt;SPAN style="COLOR: #2b91af"&gt;XmlSerializerFormat&lt;/SPAN&gt;] &lt;BR&gt;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;class&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;CommunicationService&lt;/SPAN&gt; : System.Web.Services.&lt;SPAN style="COLOR: #2b91af"&gt;WebService &lt;/SPAN&gt;&lt;BR&gt;{&lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; CommunicationService() { } &lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;[&lt;SPAN style="COLOR: #2b91af"&gt;WebMethod&lt;/SPAN&gt;] &lt;BR&gt;&amp;nbsp;&amp;nbsp;[&lt;SPAN style="COLOR: #2b91af"&gt;OperationContract&lt;/SPAN&gt;(Action= &lt;SPAN style="COLOR: #a31515"&gt;"SoapAction1Here"&lt;/SPAN&gt;)] &lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;ComplexType &lt;/SPAN&gt;SendCommunication(&lt;SPAN style="COLOR: #2b91af"&gt;CommunicationEntity&lt;/SPAN&gt; Request) {...} &lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;...&lt;BR&gt;&lt;BR&gt;&lt;/P&gt;&lt;/DIV&gt;
&lt;P&gt;The &lt;A href="http://msdn2.microsoft.com/en-us/library/system.servicemodel.operationcontractattribute.aspx"&gt;OperationContract&lt;/A&gt; attribute decorates the service method, like &lt;A href="http://msdn2.microsoft.com/en-us/library/28a537td.aspx"&gt;WebMethod&lt;/A&gt; does for ASP.NET. The &lt;A href="http://msdn2.microsoft.com/en-us/library/ms586952.aspx"&gt;XmlSerializerFormat&lt;/A&gt; attribute on the service class tells WCF to not use the default DataContract serialization behavior, but instead to use the XmlSerializer. This, ostensibly, to maintain consistency and compatibility with data types that have been decorated with the XmlSerializer attributes, like &lt;A href="http://msdn2.microsoft.com/en-us/library/system.xml.serialization.xmlelementattribute.aspx"&gt;XmlElement&lt;/A&gt;, &lt;A href="http://msdn2.microsoft.com/en-us/library/system.xml.serialization.xmlignoreattribute.aspx"&gt;XmlIgnore&lt;/A&gt;, &lt;A href="http://msdn2.microsoft.com/en-us/library/system.xml.serialization.xmltypeattribute.aspx"&gt;XmlType&lt;/A&gt;, and so on. &lt;/P&gt;
&lt;P&gt;This all sounds pretty easy right? The problem is that the actual XML messages expected by WCF for this service, were different than the XML messages expected and accepted by ASP.NET. Now it's XML, so, we don't need an exact string match. We need equivalence of the &lt;A href="http://www.w3.org/TR/xml-infoset/"&gt;Xml Infoset&lt;/A&gt;. That means, element names must be the same, XML namespaces must be the same, but prefixes attached to the namespaces can be different. But we did not have infoset equivalence! The first puzzle was, WHY? &lt;/P&gt;
&lt;P&gt;As in many scenarios involving interop between different web services libraries, it's the XML namespaces that cause lots of insidious problems. In this case, the ASP.NET-hosted web service was serializing and de-serializing the CommunicationEntity, using an XML namespace derived from the &lt;A href="http://msdn2.microsoft.com/en-us/library/system.xml.serialization.xmltypeattribute.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/system.xml.serialization.xmltypeattribute.aspx"&gt;XmlTypeAttribute&lt;/A&gt; attached to that type definition. On the other hand, WCF was serializing the same object using the XML namespace associated to the &lt;A href="http://msdn2.microsoft.com/en-us/library/system.servicemodel.servicecontractattribute.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/system.servicemodel.servicecontractattribute.aspx"&gt;ServiceContract&lt;/A&gt;. If those two xml namespaces are the same, no problem. But in general, they are different, and in this specific case, they were different. The result was that ASMX clients (and by this I mean .NET apps compiled with webservice stubs generated from wsdl.exe in .NET 2.0) would send a serialized XML stream to the WCF service, which was &lt;EM&gt;ever so close&lt;/EM&gt; to the format WCF wanted. But close doesn't cut it, and so WCF would not de-serialize the request, and the app received a null instance for CommunicationEntity. &lt;/P&gt;
&lt;P&gt;This stinks. &lt;/P&gt;
&lt;P&gt;You would think it would be automatic, but it sure isn't. &lt;/P&gt;
&lt;P&gt;The next puzzle was, how to fix this? If you are familiar with the ASP.NET and XmlSerializer model, there are lots of attributes you can apply to types to specify the namespaces to use, the element names to use, and so on. It's very flexible, so flexible that some people find it unfathomable. The WCF serializer is much simpler, which is nice, but&amp;nbsp;on the downside, there is no special attribute that WCF uses to specify the namespace here. &lt;/P&gt;
&lt;P&gt;After a little spelunking, I found what I think is a useful hack to work around this problem. It is a custom &lt;A href="http://msdn2.microsoft.com/en-us/library/system.servicemodel.servicehost.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/system.servicemodel.servicehost.aspx"&gt;ServiceHost&lt;/A&gt;, which, in the OnOpening() event, changes the MessageParts where the part namespace disagrees with the namespace specified in the &lt;A href="http://msdn2.microsoft.com/en-us/library/system.xml.serialization.xmltypeattribute.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/system.xml.serialization.xmltypeattribute.aspx"&gt;XmlTypeAttribute&lt;/A&gt; associated to the CLR type for that message part. Huh? &lt;/P&gt;
&lt;P&gt;What this means is, now the WCF endpoint and the ASP.NET endpoint serialize and de-serialize the same way, for complex message types. Even better, when you query the WCF service for metadata, you get the "correct" WSDL – with the updated xml namespace. &lt;/P&gt;
&lt;P&gt;The ServiceHost uses reflection to inspect the message parts and decide on whether to change the XML namespace or not. Reflection is expensive at runtime, but this happens only once, when the service is opened. So it should have essentially no impact, after startup of the service. &lt;/P&gt;
&lt;P&gt;Here's the code: &lt;/P&gt;
&lt;DIV style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 2pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 2pt; FONT-SIZE: 9pt; BACKGROUND: white; PADDING-BOTTOM: 2pt; BORDER-LEFT: windowtext 1pt solid; COLOR: black; LINE-HEIGHT: 98%; PADDING-TOP: 2pt; BORDER-BOTTOM: windowtext 1pt solid; FONT-FAMILY: Consolas, Courier New"&gt;
&lt;P&gt;&lt;SPAN style="COLOR: blue"&gt;using&lt;/SPAN&gt; System; &lt;BR&gt;&lt;SPAN style="COLOR: blue"&gt;using&lt;/SPAN&gt; System.ServiceModel; &lt;BR&gt;&lt;SPAN style="COLOR: blue"&gt;using&lt;/SPAN&gt; System.ServiceModel.Description; &lt;BR&gt;&lt;BR&gt;&lt;SPAN style="COLOR: green"&gt;// if your original .svc file was: &lt;BR&gt;// &amp;lt;%@ ServiceHost Language="C#" Debug="true" Service="CommunicationService" CodeBehind="~/App_Code/CommunicationService.cs" %&amp;gt; &lt;BR&gt;// &lt;BR&gt;// then use this, to get the custom service host: &lt;BR&gt;// &amp;lt;%@ ServiceHost Language="C#" Debug="true" Factory="dinoch.wcf.fixup.EnforceXmlTypeServiceHostFactory" &lt;BR&gt;// &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Service="CommunicationService" CodeBehind="~/App_Code/CommunicationService.cs" %&amp;gt; &lt;BR&gt;// &lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;namespace&lt;/SPAN&gt; dinoch.wcf.fixup &lt;BR&gt;{ &lt;BR&gt;&lt;SPAN style="COLOR: green"&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: gray"&gt;/// &amp;lt;summary&amp;gt; &lt;BR&gt;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt; This custom ServiceHost modifies the ServiceDescription to use the "preferred" &lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt; namespaces on message parts. The ServiceDescription is used by the WCF service &lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt; in generating metadata (eg WSDL) and also in driving the serialization behavior. &lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt; We do this because the default behavior in WCF when using the XmlSerializer format &lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt; (via the XmlSerializerFormat attribute) is to NOT use the namespace specified in the &lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt; XmlTypeAttribute, if such an attribute is attached to the data type. This means that &lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt; WCF services will not accept the same input messages as ASMX Services, and will not &lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt; generate the same response messages as ASMX services - they will differ by XML namespace. &lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt; The way this works - on opening the service, which happens before WSDL is generated and &lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt; before any messages and dispatched to methods, this ServiceHost modifies the ServiceDescription &lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt; of the service. It examines message parts, looks for XmlTypeAttributes attached to the &lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt; types associated to those message parts, and then compares the xml namespace used in the message &lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt; part to the xml namespace specified in the XmlTypeAttribute. If they namespaces differ, then &lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt; this ServiceHost overrides the default namespace, and uses the namespace from the XmlTypeAttribute &lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt; in its stead. &lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt; Because this ServiceHost modifies the ServiceDescription before starting up the service, at runtime, &lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt; this technique has the same effect as applying an (imaginary) attribute &lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt; to the service implementation code; the metadata (WSDL) generated from this service &lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt; will indicate the desired namespace for the message parts. &lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt; This ServiceHost has no effect on service operations that do not use the XmlSerializer. &lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt; There is one catch: running svcutil.exe over the assembly &lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt; (as opposed to the service itself, hosted and running within IIS) will not &lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt; detect the proper namespaces. &lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt; To use this service host, use something like this in your .svc file: &lt;BR&gt;&lt;SPAN style="COLOR: gray"&gt;&amp;nbsp;&amp;nbsp;/// &amp;lt;%@ ServiceHost &lt;BR&gt;&amp;nbsp;&amp;nbsp;/// &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Language="C#" &lt;BR&gt;&amp;nbsp;&amp;nbsp;/// &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Debug="true" &lt;BR&gt;&amp;nbsp;&amp;nbsp;/// &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Factory="dinoch.wcf.fixup.EnforceXmlTypeServiceHostFactory" &lt;BR&gt;&amp;nbsp;&amp;nbsp;/// &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Service="CommunicationService" &lt;BR&gt;&amp;nbsp;&amp;nbsp;/// &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;CodeBehind="~/App_Code/CommunicationService.cs" &lt;BR&gt;&amp;nbsp;&amp;nbsp;/// %&amp;gt; &lt;BR&gt;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: gray"&gt;///&lt;/SPAN&gt; For some additional background, see http://msdn2.microsoft.com/en-us/library/Aa395224.aspx &lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: gray"&gt;/// &lt;/SPAN&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: gray"&gt;/// &amp;lt;/summary&amp;gt; &lt;/SPAN&gt;&lt;BR&gt;&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;class&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;EnforceXmlTypeServiceHost&lt;/SPAN&gt; : &lt;SPAN style="COLOR: #2b91af"&gt;ServiceHost &lt;/SPAN&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;{ &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; EnforceXmlTypeServiceHost(&lt;SPAN style="COLOR: #2b91af"&gt;Type&lt;/SPAN&gt; t, &lt;SPAN style="COLOR: blue"&gt;params&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;Uri&lt;/SPAN&gt;[] baseAddresses) : &lt;SPAN style="COLOR: blue"&gt;base&lt;/SPAN&gt;(t, baseAddresses) { } &lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; EnforceXmlTypeServiceHost(&lt;SPAN style="COLOR: blue"&gt;object&lt;/SPAN&gt; singletonInstance, &lt;SPAN style="COLOR: blue"&gt;params&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;Uri&lt;/SPAN&gt;[] baseAddresses) &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;: &lt;SPAN style="COLOR: blue"&gt;base&lt;/SPAN&gt;(singletonInstance, baseAddresses) { } &lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; EnforceXmlTypeServiceHost() : &lt;SPAN style="COLOR: blue"&gt;base&lt;/SPAN&gt;() { } &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;protected&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;override&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;void&lt;/SPAN&gt; OnOpening() &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{ &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #2b91af"&gt;ServiceEndpointCollection&lt;/SPAN&gt; sec = &lt;SPAN style="COLOR: blue"&gt;this&lt;/SPAN&gt;.Description.Endpoints; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;foreach&lt;/SPAN&gt; (&lt;SPAN style="COLOR: #2b91af"&gt;ServiceEndpoint&lt;/SPAN&gt; se &lt;SPAN style="COLOR: blue"&gt;in&lt;/SPAN&gt; sec) &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{ &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt; (se.Address.ToString().EndsWith(&lt;SPAN style="COLOR: #a31515"&gt;".svc"&lt;/SPAN&gt;)) &lt;SPAN style="COLOR: green"&gt;// eliminate mex endpoints&lt;/SPAN&gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{ &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;foreach&lt;/SPAN&gt; (&lt;SPAN style="COLOR: #2b91af"&gt;OperationDescription&lt;/SPAN&gt; opDesc &lt;SPAN style="COLOR: blue"&gt;in&lt;/SPAN&gt; se.Contract.Operations) &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{ &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: green"&gt;// Are we using XmlSerializer? &lt;/SPAN&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt; (opDesc.Behaviors.Find&amp;lt;&lt;SPAN style="COLOR: #2b91af"&gt;XmlSerializerOperationBehavior&lt;/SPAN&gt;&amp;gt;() != &lt;SPAN style="COLOR: blue"&gt;null&lt;/SPAN&gt;) &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{ &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;foreach&lt;/SPAN&gt; (&lt;SPAN style="COLOR: #2b91af"&gt;MessageDescription&lt;/SPAN&gt; messDesc &lt;SPAN style="COLOR: blue"&gt;in&lt;/SPAN&gt; opDesc.Messages) &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{ &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;for&lt;/SPAN&gt; (&lt;SPAN style="COLOR: blue"&gt;int&lt;/SPAN&gt; i = 0; i &amp;lt; messDesc.Body.Parts.Count; i++) &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{ &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #2b91af"&gt;MessagePartDescription&lt;/SPAN&gt; part = messDesc.Body.Parts[i]; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;System.Reflection.&lt;SPAN style="COLOR: #2b91af"&gt;MemberInfo&lt;/SPAN&gt; info = (System.Reflection.&lt;SPAN style="COLOR: #2b91af"&gt;MemberInfo&lt;/SPAN&gt;)part.Type; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;System.Xml.Serialization.&lt;SPAN style="COLOR: #2b91af"&gt;XmlTypeAttribute&lt;/SPAN&gt;[] attributes = &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(System.Xml.Serialization.&lt;SPAN style="COLOR: #2b91af"&gt;XmlTypeAttribute&lt;/SPAN&gt;[])&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;info.GetCustomAttributes(&lt;SPAN style="COLOR: blue"&gt;typeof&lt;/SPAN&gt;(System.Xml.Serialization.&lt;SPAN style="COLOR: #2b91af"&gt;XmlTypeAttribute&lt;/SPAN&gt;), &lt;SPAN style="COLOR: blue"&gt;true&lt;/SPAN&gt;); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt; ((attributes!= &lt;SPAN style="COLOR: blue"&gt;null&lt;/SPAN&gt;) &amp;amp;&amp;amp; (attributes.Length &amp;gt; 0)) &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: green"&gt;// check to see if the xml namespace specified to the XmlSerializer via &lt;/SPAN&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: green"&gt;// the XmlTypeAttribute attribute, disagrees with the xml namespace used &lt;/SPAN&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: green"&gt;// in the WCF message description. &lt;/SPAN&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt; (attributes[0].Namespace != part.Namespace) &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{ &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: green"&gt;// the namespaces do not agree. we need to swap them. &lt;/SPAN&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: green"&gt;// this won't work, the property is readonly &lt;/SPAN&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: green"&gt;// messDesc.Body.Parts[i].Namespace = attributes[0].Namespace; &lt;/SPAN&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: green"&gt;// Duplicate the old part description, except for the XML namespace &lt;/SPAN&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: #2b91af"&gt;MessagePartDescription&lt;/SPAN&gt; newPart = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;MessagePartDescription&lt;/SPAN&gt;(part.Name, attributes[0].Namespace); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;newPart.Index = part.Index; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;newPart.MemberInfo = part.MemberInfo; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;newPart.Multiple = part.Multiple; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;newPart.ProtectionLevel = part.ProtectionLevel; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;newPart.Type = part.Type; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: green"&gt;// Replace the old part with the new one &lt;/SPAN&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;messDesc.Body.Parts[i] = newPart; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} &lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;base&lt;/SPAN&gt;.OnOpening(); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} &lt;BR&gt;&amp;nbsp;&amp;nbsp;} &lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;public&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;class&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;EnforceXmlTypeServiceHostFactory&lt;/SPAN&gt; : System.ServiceModel.Activation.&lt;SPAN style="COLOR: #2b91af"&gt;ServiceHostFactory &lt;/SPAN&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;{ &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;protected&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;override&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;ServiceHost&lt;/SPAN&gt; CreateServiceHost(&lt;SPAN style="COLOR: #2b91af"&gt;Type&lt;/SPAN&gt; serviceType, &lt;SPAN style="COLOR: #2b91af"&gt;Uri&lt;/SPAN&gt;[] baseAddresses) &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{ &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: blue"&gt;return&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: #2b91af"&gt;EnforceXmlTypeServiceHost&lt;/SPAN&gt;(serviceType, baseAddresses); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} &lt;BR&gt;&amp;nbsp;&amp;nbsp;} &lt;BR&gt;}&lt;BR&gt;&lt;BR&gt;&lt;/P&gt;&lt;/DIV&gt;
&lt;P&gt;And here's how you specify the custom ServiceHost in the .svc file: &lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Courier New"&gt;&lt;SPAN style="BACKGROUND-COLOR: yellow"&gt;&amp;lt;%&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;@&lt;/SPAN&gt; &lt;SPAN style="COLOR: #a31515"&gt;ServiceHost&lt;/SPAN&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: red"&gt;Language&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="C#"&lt;/SPAN&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: red"&gt;Factory&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="dinoch.wcf.fixup.EnforceXmlTypeServiceHostFactory"&lt;/SPAN&gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: red"&gt;CodeBehind&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="~/App_Code/CommunicationService.cs"&lt;/SPAN&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;SPAN style="COLOR: red"&gt;Service&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="CommunicationService"&lt;/SPAN&gt; &lt;SPAN style="BACKGROUND-COLOR: yellow"&gt;%&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;/P&gt;
&lt;P&gt;I hope this is useful! The same principle would apply, of course, when migrating from ASMX to WCF on the server side, if you are using a Java-based client, or a web service client on any other platform. So this&amp;nbsp;definitely falls in the arena of interop. If any of you have other requests on interop topics relating to WCF, let me hear 'em! &lt;/P&gt;
&lt;P&gt;Cheers, &lt;/P&gt;
&lt;P&gt;-Dino &lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3965100" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/dotnetinterop/attachment/3965100.ashx" length="8648" type="text/plain" /><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/Interop/default.aspx">Interop</category><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/XML/default.aspx">XML</category><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/WCF/default.aspx">WCF</category><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/Java/default.aspx">Java</category><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/WSDL/default.aspx">WSDL</category></item><item><title>Using Java to program openXML documents</title><link>http://blogs.msdn.com/dotnetinterop/archive/2007/03/23/using-java-to-program-openxml-documents.aspx</link><pubDate>Sat, 24 Mar 2007 00:34:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1939378</guid><dc:creator>DotNetInterop</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/dotnetinterop/comments/1939378.aspx</comments><wfw:commentRss>http://blogs.msdn.com/dotnetinterop/commentrss.aspx?PostID=1939378</wfw:commentRss><description>&lt;P&gt;I've blogged about this before.&amp;nbsp; Now I See there is a sourceforge project supporting the use of Java to access openXML docs.&amp;nbsp; Brian Jones has the scoop:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://blogs.msdn.com/brian_jones/archive/2007/03/20/programming-against-the-openxml-formats-with-java.aspx" mce_href="http://blogs.msdn.com/brian_jones/archive/2007/03/20/programming-against-the-openxml-formats-with-java.aspx"&gt;http://blogs.msdn.com/brian_jones/archive/2007/03/20/programming-against-the-openxml-formats-with-java.aspx&lt;/A&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1939378" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/Interop/default.aspx">Interop</category><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/OpenXML/default.aspx">OpenXML</category><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/XML/default.aspx">XML</category><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/Java/default.aspx">Java</category></item><item><title>Open XML Workshop in Redmond, March 13-15</title><link>http://blogs.msdn.com/dotnetinterop/archive/2007/02/16/open-xml-workshop-in-redmond-march-13-15.aspx</link><pubDate>Fri, 16 Feb 2007 21:13:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1690402</guid><dc:creator>DotNetInterop</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/dotnetinterop/comments/1690402.aspx</comments><wfw:commentRss>http://blogs.msdn.com/dotnetinterop/commentrss.aspx?PostID=1690402</wfw:commentRss><description>&lt;P&gt;Want to learn about Open XML from the source?&amp;nbsp;&amp;nbsp; There's an opportunity coming up March 13-15 on the Microsoft campus in Redmond, Washington.&amp;nbsp; It's called the Open XML Deep Dive developer workshop .&amp;nbsp; If you’re adopting Open XML, and need deep technical training on the details of the format, including the actual markup, architecture, and developer topics, this is your chance to get up to speed fast.&amp;nbsp; There will be other workshops for IT pros and other non-developers, coming soon.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Targeted toward Microsoft's training partners and ISVs, the workshop will cover Open XML architecture, the Open Packaging Convention, the three main schemas (WordprocessingML, SpreadsheetML, and PresentationML), DrawingML, custom XML support, and XSLT applications for Open XML.&amp;nbsp; We’ll have presentations of 60-90 minutes alternating with hands-on lab time, and all attendees will have a workstation with the labs, Office 2007, Windows Vista, and Visual Studio 2005 installed.&lt;/P&gt;
&lt;P mce_keep="true"&gt;There will be C++, Java and C# samples used in the hands-on labs.&lt;/P&gt;
&lt;P mce_keep="true"&gt;Basic understanding of XML and related topics is a prerequisite.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;To register for the workshop, contact Wendy Fotre (&lt;A href="mailto:a-wendyf@microsoft.com" mce_href="mailto:a-wendyf@microsoft.com"&gt;a-wendyf@microsoft.com&lt;/A&gt;).&amp;nbsp; Registration is on a first-come/first-served basis; get your registration in early.&amp;nbsp; There is no cost for the workshop, but&amp;nbsp;attendees are responsible for their own travel arrangements and lodging. &lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1690402" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/Interop/default.aspx">Interop</category><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/OpenXML/default.aspx">OpenXML</category><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/XML/default.aspx">XML</category><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/Java/default.aspx">Java</category></item><item><title>Lessons learned using RSS with .NET 2.0:  Simplicity and Speed</title><link>http://blogs.msdn.com/dotnetinterop/archive/2007/01/08/lessons-learned-using-rss-with-net-2-0-simplicity-and-speed.aspx</link><pubDate>Tue, 09 Jan 2007 01:52:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1436104</guid><dc:creator>DotNetInterop</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/dotnetinterop/comments/1436104.aspx</comments><wfw:commentRss>http://blogs.msdn.com/dotnetinterop/commentrss.aspx?PostID=1436104</wfw:commentRss><description>&lt;H3&gt;RSS, .NET 2.0, and Interop&lt;/H3&gt;&lt;FONT face=Tahoma size=2&gt;&lt;!-- ------------------------------------------------------- --&gt;
&lt;P&gt;For many people,&amp;nbsp;when they think of Interop with respect to .NET development, they think, first and foremost, Web Services.&amp;nbsp; This is good as far as it goes but...Web services is neither necessary nor sufficient for interop in many cases. RSS is a great example of an XML document protocol that is very useful for interop&amp;nbsp; - in practice, interop between RSS Readers, RSS producers, aggregators, and so on.&amp;nbsp; The document format is RSS, the protocol over which that document is exchanged is often HTTP - the web protocol - but of course it could be *anything*.&amp;nbsp; Any protocol.&amp;nbsp; How does .NET 2.0 support RSS for Interop? &lt;/P&gt;
&lt;H4&gt;A Digression - IE7 and RSS&lt;/H4&gt;
&lt;P&gt;I installed IE7 a while back, and I am pretty happy about the RSS support built-in to it. Navigate to an RSS feed and you get a reasonable user-friendly display of the feed. It's not a feed reader or rss manager, but it's nice to not see the angle brackets in the browser, when I just want to browse an RSS doc. &lt;/P&gt;
&lt;CENTER&gt;&lt;IMG alt="RSS Example" src="http://cheeso.members.winisp.net/images/IE7-RSS-Example.jpg" mce_src="http://cheeso.members.winisp.net/images/IE7-RSS-Example.jpg"&gt; &lt;/CENTER&gt;
&lt;P&gt;Separately, I wanted an app that could dynamically create a digest of a website - this is a sort of tactical app I needed for something at work. Obviously, it's gotta be RSS or ATOM. I wanted build the app in .NET, and it will run as a web app. This means ASP.NET. &lt;/P&gt;
&lt;P&gt;How can I create an RSS doc from within .NET? I know about the &lt;A href="http://www.rssdotnet.com/" mce_href="http://www.rssdotnet.com/"&gt;RSS.NET project&lt;/A&gt; on sourceforge, and I have actually used that DLL in some other projects - RSS.NET was integrated into the &lt;A href="http://www.asp.net/downloads/starterkits/default.aspx?tabid=62#club" mce_href="http://www.asp.net/downloads/starterkits/default.aspx?tabid=62#club"&gt;Club Web Starter Kit&lt;/A&gt; that was created as a usable example of what you could do with ASP.NET 2.0. It was good for what it did, but I had a few problems (this was a while ago) with particular variants of RSS. I made some changes but never bothered to raise a bug on the sourceforce project, basically it was more effort than I was signed up for. In any case it worked, but I was a bit shy of the license, and so on. &lt;/P&gt;
&lt;P&gt;Now I Was doing some more RSS stuff, and with my &lt;EM&gt;bad developer habits&lt;/EM&gt; , I &lt;A href="http://en.wikipedia.org/wiki/Not_Invented_Here" mce_href="http://en.wikipedia.org/wiki/Not_Invented_Here"&gt;ignored what already existed&lt;/A&gt; and set off to build my own RSS library. After much effort, many errors, and... oh, wait. &lt;STRONG&gt;Hold on a second.&lt;/STRONG&gt; It wasn't much effort after all, and there were no errors and backtracking. Basically it took me 10 minutes to build an RSS library in .NET, and it was very straightforward. Here's the resulting class diagram from Visual Studio 2005:&lt;/P&gt;
&lt;CENTER&gt;&lt;IMG alt="RSSModel Class Diagram" src="http://cheeso.members.winisp.net/images/RSS-Class-Diagram.jpg" mce_src="http://cheeso.members.winisp.net/images/RSS-Class-Diagram.jpg"&gt; &lt;/CENTER&gt;
&lt;P&gt;The process was pretty simple and the same approach should work with any XML dialect. How did I do it? &lt;/P&gt;&lt;/FONT&gt;&lt;!-- ------------------------------------------------------- --&gt;
&lt;H4&gt;The tools in the .NET SDK make this simple&lt;/H4&gt;&lt;FONT face=Tahoma size=2&gt;
&lt;P&gt;The first thing I did was grab a &lt;A href="http://articles.moneycentral.msn.com/Feeds/RSS/latestrss.aspx" mce_href="http://articles.moneycentral.msn.com/Feeds/RSS/latestrss.aspx"&gt;sample RSS document&lt;/A&gt;. Then I ran it through the &lt;A href="http://msdn2.microsoft.com/en-us/x6c1kb0s(vs.80).aspx" mce_href="http://msdn2.microsoft.com/en-us/x6c1kb0s(vs.80).aspx"&gt;xsd.exe tool&lt;/A&gt;, which is part of the &lt;A href="http://msdn2.microsoft.com/en-us/library/aa139635.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/aa139635.aspx"&gt;.NET 2.0 SDK&lt;/A&gt;. The result of that was an XSD document, describing the schema for RSS. Then I ran &lt;EM&gt;that&lt;/EM&gt; through xsd.exe , and the output of that was a .cs source file, modelling the RSS document. &lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Aside: Lots of developers have this idea that the output of a tool, any tool, is sacrosanct, and cannot be changed. As if the tool knows better than you, what you need. I don't subscribe to that philosophy. The output of one tool is just the input to the next tool, in my opinion. &lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;I took the .cs source file that was kindly generated for me by xsd.exe, and doctored it up, added a few helper methods to the generated classes, tweaked the names of the classes and so on, and I had myself a simple RSS library, perfectly suited to my purposes.&amp;nbsp; (Note: the diagram above is from Visual Studio.&amp;nbsp; It essentially is a graphcial model of the generated class.&amp;nbsp;&amp;nbsp;I didn't actually use any premium feature in Visual Studio to generate the class.&amp;nbsp; I used only the .NET SDK Tools.&amp;nbsp; VS just generated the pretty picture.)&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Honestly**&lt;/EM&gt;, the entire effort on this was about 10 minutes. As I prototyped the app, I saw what I needed and what was missing from the RSS object model, and I tweaked it a little as I went along. A few iterations and the project was done. Boom. I didn't need to examine the license for a third-party tool, I didn't need to understand the model for the third party code. It was small and simple (&lt;EM&gt;Really Simple&lt;/EM&gt;, you might say!). If you want to see the source, see the link below. &lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;[**Honestly, don't you hate when people say, "Honestly,..."&amp;nbsp; As if most of the time they're not being honest, but this time &lt;EM&gt;they really are&lt;/EM&gt;....]&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;STRONG&gt;That's what I love about .NET development:&lt;/STRONG&gt; Things are surprisingly easy to accomplish. This approach should work with any XML dialect. I am sure there are billions and billions out there, and most of them, if they are simple enough, should be workable with this approach. &lt;/P&gt;
&lt;P&gt;What&amp;nbsp; I did here was generate a library that allows any .NET application to produce an RSS document from any content type it can access.&amp;nbsp; I could also have extended this so that it could consume RSS streams, but that was out of scope for my project, so I didn't do it.&amp;nbsp; You should be able to do something similar for any XML Schema, including internal-only schema that you use only for exchanging documents inside the walls of your corporation or organization. &lt;/P&gt;
&lt;P&gt;Happy angle brackets to you!&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;&lt;/FONT&gt;&lt;!-- ------------------------------------------------------- --&gt;&lt;/STRONG&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1436104" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/dotnetinterop/attachment/1436104.ashx" length="7258" type="text/plain" /><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/Interop/default.aspx">Interop</category><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/XML/default.aspx">XML</category><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/RSS/default.aspx">RSS</category></item><item><title>Use Office 2003 XML Schema, no worries</title><link>http://blogs.msdn.com/dotnetinterop/archive/2006/10/31/use-office-2003-xml-schema-no-worries.aspx</link><pubDate>Tue, 31 Oct 2006 17:49:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:904160</guid><dc:creator>DotNetInterop</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/dotnetinterop/comments/904160.aspx</comments><wfw:commentRss>http://blogs.msdn.com/dotnetinterop/commentrss.aspx?PostID=904160</wfw:commentRss><description>&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'"&gt;In the past I've posted some articles [&lt;A class="" href="http://blogs.msdn.com/dotnetinterop/archive/2005/03/29/403331.aspx" mce_href="http://blogs.msdn.com/dotnetinterop/archive/2005/03/29/403331.aspx"&gt;1&lt;/A&gt;, &lt;A class="" href="http://blogs.msdn.com/dotnetinterop/archive/2005/03/04/385184.aspx" mce_href="http://blogs.msdn.com/dotnetinterop/archive/2005/03/04/385184.aspx"&gt;2&lt;/A&gt;] about generating Office 2003 documents from a server-side Java application.&amp;nbsp;I also posted some &lt;A class="" href="http://dinoch.dyndns.org:7070/WordML" mce_href="http://dinoch.dyndns.org:7070/WordML"&gt;example code&lt;/A&gt;. &amp;nbsp;Of note, the &lt;A class="" href="http://www.microsoft.com/office/xml/default.mspx" mce_href="http://www.microsoft.com/office/xml/default.mspx"&gt;Office 2003 XML Reference Schemas&lt;/A&gt; are now also available under the &lt;A class="" href="http://www.microsoft.com/interop/osp/default.mspx" mce_href="http://www.microsoft.com/interop/osp/default.mspx"&gt;Open Specification Promise&lt;/A&gt;.&amp;nbsp; &amp;nbsp;Basically, with the OSP, &lt;EM&gt;Microsoft irrevocably promises not to assert any Microsoft Necessary Claims against you for making, using, selling, offering for sale, importing or distributing any implementation to the extent it conforms to a Covered Specification&lt;/EM&gt;.&amp;nbsp; In other words, Microsoft promises not to bother you if you use the specs covered under OSP.&amp;nbsp; This promise is subject to some conditions, check the OSP website for full details.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: black; FONT-FAMILY: 'Arial','sans-serif'"&gt;-Dino&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=904160" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/Interop/default.aspx">Interop</category><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/XML/default.aspx">XML</category><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/OSP/default.aspx">OSP</category><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/Java/default.aspx">Java</category></item><item><title>Peter Galli of eWeek on Microsoft and its work on Interop</title><link>http://blogs.msdn.com/dotnetinterop/archive/2006/10/30/peter-galli-of-eweek-on-microsoft-and-its-work-on-interop.aspx</link><pubDate>Mon, 30 Oct 2006 21:33:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:904094</guid><dc:creator>DotNetInterop</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.msdn.com/dotnetinterop/comments/904094.aspx</comments><wfw:commentRss>http://blogs.msdn.com/dotnetinterop/commentrss.aspx?PostID=904094</wfw:commentRss><description>&lt;P class=MsoNormal style="MARGIN: 0in"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma', 'Arial','sans-serif'"&gt;Editorial excerpt of the Week.&amp;nbsp; From an article mostly about &lt;A class="" href="http://www.microsoft.com/mscorp/safety/technologies/senderid/default.mspx"&gt;Sender ID&lt;/A&gt;, a specification for e-mail authentication, Peter Galli commented on Microsoft's recent work on interop: &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0.25in"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;“Over the past four months Microsoft has announced a number of key interoperability activities focused on business and technical activities, including the establishment of an Interoperability Customer Executive Council, the Open XML Translator Project, and the strategic relationship with XenSource for the development of technology to provide interoperability between Xen-enabled Linux and Windows Server virtualization.” &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 6pt 23.05pt 0pt 0.25in"&gt;&lt;I&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;(Peter Galli, reporter from eWEEK. “&lt;A class="" href="http://www.eweek.com/article2/0,1895,2035999,00.asp" mce_href="http://www.eweek.com/article2/0,1895,2035999,00.asp"&gt; &lt;FONT color=#0000ff&gt;Microsoft Opens Access to Its Sender ID Spec&lt;/FONT&gt; &lt;/A&gt;”)&lt;/SPAN&gt; &lt;/I&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','Arial','sans-serif'"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','Arial','sans-serif'"&gt;I don't know that the past four months have seen a significant increase in interop activity from Microsoft. Maybe an increase in marketing of the activity, but it seems to me that Microsoft has been doing lots of basic interop work for a long time. WS-* efforts, interop plugfests, the original SOAP specification in 2000, even XML standards in 1997. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','Arial','sans-serif'"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Tahoma','Arial','sans-serif'"&gt;On a side note, I am looking into a Java/JSP server-side implementation of the &lt;A class="" href="http://en.wikipedia.org/wiki/Windows_CardSpace" mce_href="http://en.wikipedia.org/wiki/Windows_CardSpace"&gt;Cardspace&lt;/A&gt; protocol. This would allow a Windows Vista client browser using Cardspace to authenticate to any Java-based website. Any interest in that? Drop me a line. For more on Cardspace, see &lt;A class="" href="http://www.identityblog.com/" mce_href="http://www.identityblog.com/"&gt;Kim Cameron's identity blog&lt;/A&gt;. &lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=904094" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/Interop/default.aspx">Interop</category><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/XML/default.aspx">XML</category><category domain="http://blogs.msdn.com/dotnetinterop/archive/tags/Java/default.aspx">Java</category></item></channel></rss>