330 likes | 491 Views
Building Connected Systems with Visual Studio 2008. Darryl Burling Developer Evangelist Microsoft. Agenda. The age of connected applications Whats new in VS2008 WCF Background: WS*, .Net 3.0 and WCF ABC’s & improvments Bindings Contracts & Content What about IIS7?
E N D
Building Connected Systems with Visual Studio 2008 Darryl Burling Developer Evangelist Microsoft
Agenda • The age of connected applications • Whats new in VS2008 • WCF • Background: WS*, .Net 3.0 and WCF • ABC’s & improvments • Bindings • Contracts & Content • What about IIS7? • HTTP Programming
User Experience Productivity Collaboration Web
Whats new in VS2008 to help? • Application integration (office, etc)
Whats new in VS2008 to help? • Application integration (office, etc) • Client Application services
Whats new in VS2008 to help? • Client Application services • Application integration (office, etc) • Windows Communication Foundation • Tooling support • New Bindings • WCF for Devices • HTTP Programming models • WCF Profiling
Windows Communication Foundation • WCF is an SDK for building SOA on Windows • Service execution runtime • Released with Windows Vista • Part of Microsoft .NET Framework 3.0 • Requires .NET Framework 2.0 • Available also on • Microsoft Windows XP SP2 • Windows Server 2003 • Windows Server 2008
Addresses • Every service is associated with a unique address • Address is the location of the service • Address provides: • Transport protocol to use • HTTP • TCP • P2P • IPC • MSMQ • Name of target machine, site or network • Communication port, pipe or queue • Specific path or URI
Bindings • A simple way of wrapping multiple aspects of communication • Protocols • Format and encoding • Security • Reliability • Transaction propagation • Interoperability • Extract all of that out of your code • Use a pre-defined template • Can customize • Can write custom bindings from scratch
Out of the box Bindings • BasicHTTPBinding • BasicHTTPContextBinding • MSMQIntegrationBinding • NetMsmqBinding • netNamedPipeBinding • netPeerTCPBinding • netTCPBinding • netTCPContextBinding • webHTTPBinding • ws2007HttpBinding • wsDualHttpBinding • wsFederationHttpBinding • wsHttpBinding • wsHttpContextBinding Or build your own!
Service Contract • OperationContract attribute • Methods only • No properties/indexers/events • Independent of visibility • Opt-in model • Other methods not included
Service Contract [ServiceContract] interface IMyContract { [OperationContract] string MyMethod(string text); } class MyService : IMyContract { public string MyMethod(string text) { return "Hello " + text; } }
Hosting • Separate host process can be provided by: • Microsoft Internet Information Services (IIS) 5.0/6.0 • Windows Activation Service (WAS) (IIS 7) • Your application • Called self-hosted • In-proc must be self-hosted
Hosting in IIS • IIS 5/6 • HTTP/HTTPS only • Self Host other bindings • IIS 7 • Windows Activation Services (WAS) • Host any binding
WAS & Hosting NET.TCP HTTP NET.TCP NET.PIPE NET.MSMQ Self Hosted Process WAS .NET Worker W3SVC Service Host
WCF = Interoperability • Kiwibank • Java • Perl • Jscript • VBScript • Visual Basic 6.0 code • and Universe Pick Basic http://tinyurl.com/335flo
Improvements from VS2008 • Good tooling support in VS2008 • Templates for WCF Services • WCF Configuration Editor • Integrated Unit Testing • Invoke services without building a client • WCF Profiling • Examine performance of services at debug
WCF Tooling Demo
WCF for .NET Compact Framework 3.5 • Consistent programming model for Windows Mobile device and desktop • Shrunk footprint from over 10MB to less than 1MB • Interoperates with desktop • Supported features • Subset of messaging layer • Subset of WS-Security and WS-Addressability • HTTP Messaging • Store and Forward Messaging • Extensible Transports • Not Supported • Service Model and Contracts • Compact SVCUtil
The Web in the real world • Everything (mostly) is URI addressable • HTTP Verbs • GET - Most Prevalent • POST – Overloaded, Used for actions • PUT, DELETE – Largely Ignored • Representation Format – (X)HTML • HTTP Response Codes • Stateless
webHttpBinding • New “web-friendly” WCF Binding in Fx 3.5 • Allows for the development of RESTful services • Works across REST Continuum • HTTP and HTTPS Transports Only • Does not use SOAP envelopes • WebMessageEncoding • JSON • XML
[WebGet] and [WebInvoke] • Indicate the HTTP Method for the operation • WebGet – Don’t make me write it • WebInvoke – All verbs other than GET (Method parameter takes in the name of the Verb) • Other Parameters • BodyStyle – Indicates whether the Request / Response are wrapped or not • RequestFormat – Json or Xml • ResponseFormat – Json or Xml • UriTemplate – Covered in a minute…
HTTP Programming Demo
Summary • Connected Systems: • Distributed Data • Functionality surfacing • Connectivity • Much improved tooling in VS2008 • Easy to use WCF and build connected apps • New HTTP programming support in .Net 3.5
Reminders • http://blogs.msdn.com/darrylburling • Subscribe to our free, online newsletters to stay up to date with Microsoft news, information & events • www.microsoft.co.nz/subscribe • TechEd 2008 registration is now open! • www.microsoft.co.nz/teched • Don’t forget to fill in your Evaluation form! • Hand in at end of day for complimentary software