Interoperability and Integration using Web Services

Download Report

Transcript Interoperability and Integration using Web Services

Interoperability and Integration
using Web Services
Malek Kemmou
Technology Architect, Application Platform
Microsoft Middle East & Africa
[email protected]
Agenda
•
•
•
•
•
•
What is Interoperability
Services, Objects and Messages
Common Interoperability Problems
WS-I Basic Profile 1.0
The Contract First Approach
Wrapping existing Code with Web
Services
What is Interoperability
• Disparate systems working meaningfully
together
– Multiple Vendors / Platforms
– Communication
• Transport Protocol
• Data Format
• Common Interface
– Meaning
• Objects (RPC)
• Messages (Services)
• Documents (EDI …)
Web Services
• Multiple Vender / platform
– Vender support
– Open Standards
• Communication
– Standard Web Protocols for transport (http, smtp
…)
– Standard "format" for Data Exchange (XML/SOAP)
– Standard Language for interface description
(WSDL)
• Meaning ?
RPC vs. Message Approach
Client
Service
Transport
Obj
Obj
BothSerialize
source and destination must understand
Deserializethe object
Client
Service
Transport
Create Message
Interpret Message
Source and destination may see message differently
RPC vs. Message Approach
Application A
Application B
Programming
Language
DBMS
OS
Object
Model
App Server
Transport
Protocols
Messages
Programming
Language
DBMS
Object
Model
OS
App Server
Message Approach
• Advantages
– Loose coupling
– Contract Based (WSDL)
• Total independence of implementation
• Total independence of object model
• Total independence of development platform
– Only message format is important
A first approach to services
• Create the service
• Auto-Generate its contract
• Service consumers use the contract to
create a client
First look at WS
An Interop test
• Hello World : Works great
• Nested Array :
–
string[][] myArray
• Very simple Nested struct
–
public struct Contact {
public string lastName;
public string firstName;
public string telephone;
public Address address;}
public struct Address {
public string street;
public string city;
public string country;}
– Datetime
– Untyped DataSet (.NET)
– Typed DataSet (.NET)
Test Results
• HelloWorld works
• Nested struct Works
• NestedArray : some issues
– Schema interpretation
• DateTime :
– .NET doesn’t accept null DateTime (struct)
•
Untyped DataSet
– No notion of dynamic schema in java
• Typed DataSet
– XML received correctly
– No Type generation on java side (unless proprietary APIs
are used)
Example
• Java Service
public java.util.Date GetDate(){
//may return null
}
• .Net Client
public DateTime GetDate(){
//error when return value is null
}
Common Interop Problems
• Dynamic format
– Example : untyped Datasets
• Interpretation
– Examples :
• DTD in the SOAP message
• ArrayType attributes
• Types
– Example : Nillable types
• Non conformant WSDL or SOAP
WS-I Basic Profile 1.0a
• Industry effort to deliver on Interop
• WS-I (Web Services Interoperability
Organization)
– Specification for SOAP
– Specifications for WSDL
– Specification for UDDI
– Conformity Test tools
Multi-Version interop ?
• Create Service v1
– Auto generate WSDL
– Use WSDL to create proxy on client
• Modify Service (v2)
– Example : add field to data
– Auto Generate WSDL
– Use WSDL v2 to create proxy on client v2
– What happens to clients still on v1 ?
The contract First Approach
• Design the contract First
– WSDL that conforms to WS-I Basic Profile
• Eventually with evolved version support
– Use test tool to test for conformity
– Be aware of Arrays and nillable types
• On the Server
– Generate the interface from the WSDL
– Implement the Web Service
• On the Client
– Generate the proxy from the WSDL
Advantages
• "Guaranteed" interoperability
– If both client and service Conform to WS-I
Basic Profile 1.0a
• More granular control over contract
– Take full advantage of XSD constructs
• Additional information (ex : facets)
• Possible non object representations
• Use of wildcards to allow evolution
– Conformity Claims
Designing the WSDL
Service
Port
Binding
Operation
Message
Part
Part
Message
Part
Part
Port Type
Generate the Server Interface
• WSDL.exe /server & WSDL.exe /classes
& WSDL.EXE /si (.Net Framework 2)
– Generates the server interfaces
– Generates all declared types
Implement the Interface
• Public class myService : WebService,
ServerInterface
• Implement the WebMethods
Generate the Client Proxy
• WSDL.exe (or Add WebReference)
– Generates the proxy class
– Generates all declared types
Tips & Tricks
• For better reuse
– Splitting the WSDL (wsdl:import)
– Using XSD files (xsd:import)
• For flexibility
– Make use of wildcards
– With WSE (or custom implementation),
make use of Policy to allow multiple
scenarios
Going Forward
• Advanced architectures
– Conversation models
• Two Way (request/Response)
• One Way
• Duplex
– Service Contract includes policy
• To define possible scenarios
Going Forward
• Contract First on advanced Web Services
(WSE 2)
– Contract involves both WSDL and Policy
– The same approach applies
• Need to implement Policy manually
• Visual Studio 2005
–
–
–
–
Visual tools to generate interfaces from contract
Support for Nillable types
Basic Profile conformance through attributes
Intellisense on XML (easier to create WSDL)
Interoperability Recommendations
• How about WS-Security?
– IBM WebSphere 5.1.2
• Claim: conformance to OASIS WSS 1.0
• Reality: X509 sign limited, X509 enc WSE->WLS Limited
• Good Luck hacking deployment files
– BEA WebLogic 8.1.3
• Claim: conformance to OASIS WSS 1.0
• Reality: X509 sign OK, X509 enc WSE->WLS OK
– Sun JWSDP 1.4
• Claim: conformance to OASIS WSS 1.0
• Reality: X509 sign OK, X509 enc OK
• Happy XML hacking! <g>
Interoperability Recommendations
• More WS-Security Findings
• No WS-SecureConversation yet from
competitors
• No WS-Policy yet from competitors
– Moving in the right direction with .xml config files
• Username/Token Support is sketchy
– Digests appear to be difficult to digest
– No support for timestamps from competitors
• Kerberos Support
– No mainstream support
– Wedgetail 3rd party solution
Integration of Web Services
• How do I enable Web Services for my existing
applications?
‘This is great, but what about
my existing applications that
don’t support Web Services
today?’
Integration of Web Services
• How do I enable Web Services for my
existing applications?
‘Yeah, these tend to be Host
Systems (mainframes),
Client/Server applications (VB
and PowerBuilder) and other
channels’
Integration of Web Services
• How do I enable Web Services for my
existing applications?
‘…oh, and bear in mind that all
of these systems are in
production. I run my business
on these!’
Enabling Web Services
on existing applications
• COM
– COM+1.5 components : checkBox enables SOAP
on the COM+ components
– COM : use COM Interop (managed wrappers) to
access and wrap functionality into WS
• Java
– Java beans, EJB,…etc :
• Object brokers and write ASMX WS that wrapp the beans
• Write WS in Java
• Message and integration Brokers (exemple : Biztalk)
Host Integration
• 4 x Primary Integration Options
– Direct Data Access
• “Give me my 10,000 customers”
– BLI: Business Logic Interface
• Application Integration
– SLI: Screen Logic Interface
• Screen Scraping
– Asynchronous Access
• “Batch job completed”
• All of the above can be abstracted with Web
Services
Host Integration
• Microsoft Host Integration Server (HIS) 2004
• Transaction Integrator
– Wrap business rules with COM or .NET wrapper
•
•
•
•
Import COBOL, parse declarations, create interface
Publish type library to Component Services application
VS.NET and MMC Experience
Once in .NET, expose through Web Services Façade