ASMX
ASMX
ASMX
Interoperability:
Standard based, strong multi-vendor support
Loose coupling:
Share schema, not class
Self describing, discovery
Self containing (no state) ?
Service Orientation
RPC vs. Message Approach
Client Service
Transport
Obj Obj
Serialize Deserialize
Both source and destination must understand the
object
Client Service
Transport
Example:
J2EE developer writes method
public java.util.Date getServerDate();
Method exposed by a web service. Return type
converts to :
<s:element name="getServerDateResult” type=“s:dateTime” nillable=“true” />
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
Two approaches to Contract
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
Proxy Generation
Properties
DataBinding
Shared Types
Same Schema leads to reuse of the same type
Same namespace, name and equivalent schema
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
Event Based Asynchronous
calls
MethodNameAsync to make the call
Handle the MethodNameCompleted Event (callback)
Demo