Download presentation
Presentation is loading. Please wait.
Published byMelvin Hicks Modified over 8 years ago
1
10 – 12 APRIL 2005 Riyadh, Saudi Arabia
2
Visual Studio 2005 : New Features for the Web Services Developer Malek Kemmou CEO Arrabeta Consulting Microsoft Regional Director for Middle East & Africa
3
Agenda Why do we use Web Services ? Better Interop Basic Profile 1.1 Nillable Types support Code Driven vs. Contract Driven Visual Studio 2005 new features Interfaces Serialization Event Based Asynchronous Calls Team System Wsdl import Team System EndPoint Design
4
Why do we use Web Services Today ? Interoperability: Standard based, strong multi-vendor support Loose coupling: Share schema, not class Self describing, discovery Self containing (no state) ? Service Orientation
5
Service Service Client RPC vs. Message Approach Both source and destination must understand the object Obj Transport Serialize Deserialize Client Create Message Transport Interpret Message Source and destination may see message differently
6
Interoperability issues today All vendors support Web Services but: RPC vs Document, Encoded vs Literal Developer uses OOP, tools handle serialization Nillable types issues Array serialization takes different forms WSDL or SOAP interpretation differences Usually solved by crafting non ambiguous and interoperable WSDL
7
Basic Profile 1.1 Defined by WS-I (Web Services Interoperability organization) Backed by all vendors Defines a subset of HTTP, SOAP and WSDL that “guarantees” interoperability As long as both sides are conformant Basic Profile conformance = better interop
8
Basic Profile Conformance By Default, Web Services generated by VS2005 are conformant Conformance Claims through attributes Upgrading current Web Services VS2005 will issue warnings if the service is not conformant On the client, VS issues warnings if WSDL is not conformant
9
Demo Building BP conformant Web Services
10
Nillable Types Example: J2EE developer writes method public java.util.Date getServerDate(); Method exposed by a web service. Return type converts to : How do you consume it on a.Net Client ?
11
Nillable Value types Nillable value types through generics Nullable Generates “nillable=true” in Schema Valuable for consuming non.Net Web Services, or conforming to a schema crafted to satisfy specific business requirement
12
Demo Nillable types support
13
Two approaches to Contract Code Driven Develop functionality Decide on operations to expose Let the ASMX engine do the pluming for me Generate Schemas for my types Generate WSDL for my services Contract Driven Design Contract : Design/Write XSDs and WSDL Generate types and Interfaces Implement the Interfaces in classes
14
Two approaches to Contract Both approaches end up with Contract Both Qualify for creating Web Services Require different skills May have different interoperability and loose coupling implications
15
Two approaches to Contract Code Driven Fast development, Building on current Object Oriented Skills Loose coupling requires discipline May lead to Interoperability issues Difficult to have forward compatibility Contract Driven Total Control over Contract Better Loose Coupling Better Interoperability Need for specific skills
16
When to use each approach Code Driven Simple messages Basic types, careful with nillable types, arrays & DateTime Internal development no interop, test based validation of contract Single sided offering (Internet Web Service offerings) Require.Net Or special care for interoperability (difficult task) Contract Driven Two sides agree on contract Complex messages Interoperability is of great concern
17
Interfaces An interface is a class without implementation Defines method and property signatures Isolates exposed functionality from implementation Object Oriented approximation of Contract
18
Web Service Interfaces in VS2005 Attributes in the interface WebServiceBinding, WebMethod, SOAPDocumentMethod …etc Implementing Class inherits the attributes A Class can implement multiple interfaces Generated WSDL document reflects the interfaces Each interface goes into a separate Binding Better control over what goes into WSDL and how
19
Demo Using Web Service Interfaces
20
Custom Serialization In.Net Framework 1.x, undocumented IXMLSerializable Nick named by some : “ISupportDataSet”.Net Framework 2 offers IXMLSerizable Easy to use extensibility hook ReadXML, WriteXML XmlSchemaProviderAttribute and custom method for providing the schema
21
Custom Schema Design Schema Can go beyond building complex types from simple types Define minimum occurrence, maximum occurrence, nillable …etc Use Facets to add other constraints Use attribute XMLSchemaProvider to specify method that returns the schema Implement IXMLSerializable Eventually add schema validation to ReadXML or WriteXML
22
Demo Specifying Custom Schema
23
Proxy Generation Properties DataBinding Shared Types Same Schema leads to reuse of the same type Same namespace, name and equivalent schema Event based Asynchronous model
24
Proxy Generation Extensibility SchemaImporterExtensions New abstract base class that enables custom code generation when importing a schema Extensions inherit from the base class and implement schema matching and add custom code Schema matching options : Namespace, Element, Shape matching
25
Event Based Asynchronous calls MethodNameAsync to make the call Handle the MethodNameCompleted Event (callback)
26
Demo Event Based Asynchronous Web Service Call
27
Application Connection Designer Designing application interactions Applications interact through EndPoints Import an existing WSDL document Imported as a Web Service EndPoint Contract Driven Development Eventually modify some properties Generate implementation skeleton
28
Application Connection Designer Directly specify most of the contract Operations Messages specified through types Can still design schemas and generate types using VS2005 and.Net Framework tools Can use the XMLSchemaProvider to specify schema for the contract Web service definition information Namespace, name Binding Information Location, name, namespace
29
Demo Application Connection Designer
30
Summary Visual Studio 2005 builds on and enhances current Web Services tools Better Code driven development BP conformance More control over what gets generated and how Design the service through the Application Connection Designer Better Contract Driven development Interface support
31
Q&A
32
© 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS SUMMARY.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.