Web Services
Web Services
Back in 2004 Microsoft encouraged distributed developers to base their work on ASP.NET Web Services (ASMX) architecture rather than .NET Remoting. From that moment I knew that .NET Remoting was moribund and should not be pursued for new development.
Some folks however preferred Remoting because it did not have the IIS overhead that ASMX did. I would say that unless not having IIS was a requirement, they were mistaken.
Clemens Vasters summarizes a Microsoft whitepaper that compares performance between the different MS technologies. The results? WCF is
- %25 - %50 faster than ASMX
- %25 faster than .NET Remoting
- %100 faster - %25 slower than .NET Enterprise Services (DCOM)
Those are impressive numbers. Unfortunately for the Remoting folks, there is an easy upgrade from ASMX but no upgrade from .NET Remoting.
Go WCF my friend!
Tim Ewald shares his solution for XML Schema versioning problems. Instead of using xs:any, which causes lots of problems, have the schema validator simply ignore nodes it doesn't recognise and validate those it does recognise. Tim says schema validators will allow you to ignore validation errors, and says he will have an example soon. The contract is:
- A service can evolve it's contract in a controlled way without breaking clients
- Clients must assume that the contract they get is a snapshot in time and the service is free to evolve it's contract in a controlled way
- An application producing an XML instance should make sure it matches the schema that application is using
- An application consuming an XML instance should assume it matches the schema that application is using plus additional elements
- If an application consuming an XML instance wants to schema validate it, it should be forgiving in how it deals with unknown elements in the stream and should not simply throw exceptions
He has his code and several more entries:
Sean Cicoria has a reasonably well written intro on the Duplex Messaging feature in WCF. He lays out the key configuration requirement to enable duplex messaging: one and only one port must be configured through the client firewall for all WCF applications that want to use it.
I believe the clear guidance, then, is:
- Use client/server duplex messaging in
- corporate situations (not internet)
- where you "own the desktop"
- the desktop will be XP SP2 or better
- you need duplex messaging (notifications, long running job interface, etc.).
- If you "own the desktop," part of your migration to WinFX is to determine the WCF receive port and enable it on all the clients (with appropriate security settings, of course).
- Roll out WinFX to servers with duplex messaging port enabled.
- Use server/server duplex messaging freely.
WS-ReliableMessaging, part of the WS-* family of specifications developed and adopted by IBM, Microsoft and their partners, has been submitted to OASIS for ratification. It may be fast tracked as WS-Security was to became OASIS WSS. However, it is probable that it may be merged with WS-Reliability which was already ratified by OASIS in 2004.
Update: OASIS blurb here.
Christian Weyer's company thinktecture is offering the WSCF toolkit to make practical XSD-driven contract first web service programming.
Benjamin Mitchell has a great description of the tool. More here by Simon Guest.
Mention is also given here by Arron Skonnard.
The object generation portion of WSCF competes with the xsd.exe and XSDObjectGen tools.
In WS-Addressing, End Point References include the concept of Reference Properties and Reference Parameters. If I read Omri Gazitt's explanation of the difference between the two it seems to make sense. However, I then read Clemens Vasters post and get thoroughly confused. Can anyone decipher?
Dave Orchard has more explanations.
Omri Gazitt shares that the WSA attachment epic is finally drawing to a close. MTOM/XOP have moved to proposed recommendation status. Bonus is that Microsoft is already working on the implementations (presumably in WSE3 and Indigo). It can't come soon enough.
Steve Maine, as usual, has as very thoughtful summary of the core specifications of the Web Services Architecture as presented by Don Box in his talk, WS-Why?, at the XML Developer's Conference. What, according to Don Box, are the core specifications?
- XML: Common data model and way of looking at the word
- SOAP: Orthogonal content and extensibility
- WS-Addressing: Transport-agnostic view of a message's destination and source
- WS-MetadataExchange: Self-Description
- XSD/WSDL: Contract description languages
If any of these specifications are not already well-known to you be sure to peruse Microsoft's introduction to the Web Services Architecture witepaper.
If you look in the nooks and crannies where I work you can plenty of Web Portal servers lurking. WebSphere Portal is a standard for many groups. However a group working on an Oracle platform would naturally gravitate to the Oracle Application Server Portal, for example. Certainly groups that are targeting the .NET platform are gravitating to SharePoint Portal Server 2003. Moreover since SharePoint Services is “free”, it has the tendency to grow like a weed. Not your application portfolio manager's greatest friend.
But wait a minute! OASIS has solved the problem for us! They've defined the Web Services for Remote Portlets standard and all the major portal server vendors have vowed support (see WSRP link). Here is Microsoft's press release promising support. Now all the portal servers' Portlets and WebParts can seamlessly talk to each other. Problem solved! Or is it?...
That Microsoft's current WSRP Consumer and Provider are GotDotNet workspaces, does not exactly engender the greatest confidence in their commitment to the spec. Moreover, this Usenet thread comment by Dino “Gimmesomathat” Chiesa, the MSFT PM for developer tools, makes me doubt that WSRP will ever rise to the level of “Product”, at Microsoft. His message? Use Web Services.
Does anyone think WSRP will actually work?
Simon Fell, implementor of PocketSOAP, wonders why if we are building so much complexity into the WSA stack, don't we just go back to CORBA, which already has a complete stack?
Obviously, as a plumber, the complexity of the WSA stack is Simon's personal pain. Even more so as he focuses on a mobile platform. While I feel for him, as a user from a “big company” rather than an implementer, I'm happy to stay with the implementations of MS or IBM.
We all are very anxious about the finalization of WSA; however, WSA will be, in fact, contract based whereas CORBA forces an implementation and object-orientation rather than a service/message orientation.
Tim Ewald has an excellent thread including Don Box (Mr COM) and Michi Henning (Mr CORBA) on the failures of CORBA and other stacks.
And while we all wish the WSA stack was finished already, here one opiner that thinks it's going too quickly.
Tim Bray of Sun, co-inventor of XML, is complaining about the complexity of the emerging WSA standards. The two quick comment I have to this are:
- Are the W3C specs better? No they're much less cohesive and verbose. Thank goodness for Microsoft, IBM, et al., for their foresight.
- Since he's complaining about complexity, what “simpler” specs does he have to offer to provide uniform reliability, third-party authentication, security policy negotiation, etc.? If they're not needed, then at least give a scenario using REST or any other protocol that handles these use cases. Bet you can't!
More seriously, however, the simple fact is Tim is just voicing sour-grapes on a completely moot point. You don't want to use WSA. Fine, don't use it. However the major tools vendors will use it to great effect and 89% of the developers will just use what given to them rather than roll their own. Admittedly, WSE2 is not necessarily friendly. However, Indigo and IBM's future offerings will provide so much power relative to their tool and training costs that the ROI is obvious. As Dare Obasanjo points out, tools vendors have to standardize one way or another if they want to interoperate. We could build any tool we want with a simple NAND gate too, we just don't live at that level. Similarly, most developers want to do XML shredding. As Don Box says, “Leave it to the plumbers.”
On a more humorous note...