WEB390 Ouch! Common XML Web services headaches (and possible solutions) Christian Weyer Microsoft MSDN Regional Director

Slides:



Advertisements
Similar presentations
Building and Using Web Services with ASP.NET Rob Howard Program Manager.NET Framework Team Microsoft Corp.
Advertisements

DEV351 ADO.NET Performance Pablo Castro Program Manager – ADO.NET Team Microsoft Corporation.
WEB401 Security Practices for Web Services (Part 2) Keith Ballinger Program Manager XML Messaging Microsoft Corporation.
DEV392: Extending SharePoint Products And Technologies Through Web Parts And ASP.NET Clint Covington, Program Manager Data And Developer Services - Office.
XML Web Services in Visual Studio ®.NET NameTitleCompany.
CSE3030Lecture 11 Know Your User The First Slogan.
What’s New for Smart Client Developers in Visual Studio 2005? Mike Pelton Systems Engineer Microsoft Ltd
Project Server “12”: Developing Project Management Solutions Phil Smail OFF311 Program Manager Microsoft Project Business Unit.
Extending Web Applications with Web Services Mike Taulty Developer & Platform Group Microsoft Ltd
What’s New for Smart Client Developers in Visual Studio 2005? Mike Pelton Systems Engineer Microsoft Ltd
9. Web Services. 2 Microsoft Objectives “Web Services are poised to change the future of software development...” WebServices.
Web Services (ASMX 2.0 and WSE 3.0) Mike Taulty Developer & Platform Group Microsoft Ltd
Getting Started with Windows Communication Foundation 4.5 Ed Jones, MCT, MCPD, MCTS Consultant RBA Inc.
DAT304 Leveraging XML and HTTP with Sql Server Irwin Dolobowsky Program Manager Webdata Group.
Nikola Dudar Program Manager Microsoft Corporation Session Code: DTL 311.
DEV317 Integrating Extensible Business Graphics into Enterprise Applications using Visio 2003 Mai-lan Tomsen Bukovec Program Manager.
ESB Guidance 2.0 Kevin Gock
XML Web Services in Visual Studio.NET Peter Ty Developer Evangelist.NET and Developer Group.
DEV334 Creating Application Starting Points & Sharing Best Practices with Enterprise Templates Marc Gusmano Director of Emerging Technologies The Information.
Introduction to .NET Rui Ye.
Visual Studio ®.NET Data with XML Carlotta Eaton ( Associate Professor of IST New River Community College Slides by Microsoft Modified.
DEV290 Building Office Solutions with Visual Studio Eric Carter Lead Developer Developer Platform & Evangelism Microsoft Corporation.
Developing Reporting Solutions with SQL Server
Distributed Communication via ASP.Net Web Services and.Net Remoting By Richard King.
DEV402 Extending the ASP.NET Runtime Jurgen Postelmans Microsoft Regional Director BeLux U2U.
11 Web Services. 22 Objectives You will be able to Say what a web service is. Write and deploy a simple web service. Test a simple web service. Write.
DAT305 Boost Your Data-Driven Application Development Using SQL Server Centric.NET Code Generator Pascal Belaud Microsoft France.
OFC 303 Advanced Word XML: Customer-Defined Schemas Brian Jones Program Manager Authoring Services.
DEV325 Deploying Visual Studio.NET Applications Billy Hollis Author / Consultant.
DEV339 Best Practices for Debugging Visual Studio.NET Applications Keith Pleas Architect, Guided Design
OFC 308 Advanced Word XML: The WordML Schema and Bringing Everything Together Brian Jones Program Manager Authoring Services.
Presentation: SOAP/WS in a distributed object framework, Application Servers & AXIS SOAP.
OFC 307 Office 2003 Solution Case Studies Ray Stephenson Smart Client Technical Evangelist
XML Web Services Architecture Siddharth Ruchandani CS 6362 – SW Architecture & Design Summer /11/05.
Web 310 XML Schema : What You Need to Know and Why Yasser Shohoud Program Manager XML Messaging Microsoft Corporation.
Slide 1.NET Development for Project 2003 Samples from the Project 2003 SDK Jim Corbin Programmer Writer Office Developer Documentation Microsoft Corporation.
Web Services. ASP.NET Web Services  Goals of ASP.NET Web services:  To enable cross-platform, cross- business computing  Great for “service” based.
Developing Web Services Using ASP.NET and WSE That Interoperate with the Windows Communications Foundation ("Indigo") Mark Fussell COM432 Lead Program.
10 – 12 APRIL 2005 Riyadh, Saudi Arabia. Visual Studio 2005 : New Features for the Web Services Developer Malek Kemmou CEO Arrabeta Consulting Microsoft.
.NET Enterprise Services COM+ 1.5 麥超俊 Bobby Mak 架構技術推廣經理開發工具暨平台推廣處台灣微軟股份有限公司.
DEV333 Instrumenting Applications for Manageability with the Enterprise Instrumentation Framework David Keogh Program Manager Visual Studio Enterprise.
OFC291 Microsoft® Office Word XML (part 1 of 3): Introduction Martin Sawicki Lead Program Manager.
MBL401.Net Compact Framework: Data Access Best Practices Paul Foster Mobile solutions architect.
DEV303 ASP.NET: Leveraging Visual Studio.NET For Web Projects Tony Goodhew Product Manager Microsoft Corp.
DAT 332 SQL Server 2000 Data Transformation Services (DTS) Best Practices Euan Garden Product Unit Manager SQL Server Development Microsoft Corporation.
Dev 328.NET & J2EE Strategies for Interoperability David Aiken Lead Enterprise Architect.
Web Services Error Handling and Debugging. Agenda Simple SOAP faults Advanced SOAP faults SOAP headers and faults Error handling From a Service Perspective.
MSG331 Exchange Server 2000/2003 Software Development Kit Susan Hill Lead Programmer Writer Microsoft Corporation.
DAT300 SQL Server Notification Services: Application Development Ken Henderson Technical Lead, SQL Server Support Microsoft Corporation
DEV393.NET Windows Forms Tips and Tricks Ken Getz Senior Consultant MCW Technologies, LLC.
DEV395 No Touch Deployment for Windows Forms Jamie Cool Program Manager.NET Client Microsoft Corporation.
Developing SQL Server 2000 Reporting Services Applications Brian Welcker Group Program Manager SQL Server Reporting Services Microsoft Corporation.
EBIZ302 Jupiter Business Process Automation and Web Services David Fong Program Manager.
DEV332 Programming for the Middle Tier in Visual Basic.NET Billy Hollis Author / Consultant.
DAT200 Microsoft® ADO.NET for ADO Classic Developers: Introducing ADO.NET Jackie Goldstein Renaissance Computer Systems
Christian Weyer thinktecture.
EBIZ312 Connecting Host Systems to Microsoft Technologies Paul Larsen Aaron Grady Microsoft Corporation.
OFC320 Building EPM Solutions with Microsoft Project Server Ted Dinklocker Program Manager Microsoft Corp.
Developing Custom ASP.NET Providers For Membership And Role Manager Stefan Schackow PRS404 Program Manager – Web Platform and Tools Microsoft Corporation.
A service Oriented Architecture & Web Service Technology.
DAT 390 Advanced ADO.NET Programming Techniques Jackie Goldstein Renaissance Computer Systems
Jim Fawcett CSE681 – SW Modeling & Analysis Spring 2005
Introducing the Microsoft® .NET Framework
Chris Menegay Sr. Consultant TECHSYS Business Solutions
Visual Studio Tools for Office 2005
Enterprise Library Overview
The future of distributed systems architecture
Visual Studio 2005 Tools For Office: Creating A Multi-tier Application
Web Services Enhancements 2.0
Windows Forms in Visual Studio 2005: An Overview
Presentation transcript:

WEB390 Ouch! Common XML Web services headaches (and possible solutions) Christian Weyer Microsoft MSDN Regional Director

What to expect XML Web services in practice Not to say: „Real World“ experiences... Five common headaches Best Practices Lessons Learned Customers Feedback Quite a few demos

Web services make me sweat... Hm, what about message s? WS-Trust? WS-Security? WS-What? [WebMethod] rocks, sucks!?

Prepare your Web services Aspirin ® Including existing XML Schemas & validating the message Accessing the raw SOAP message on client and server side Dynamically invoking Web services Using existing types in Web services proxy classes Asynchronous programming: Web services invocation and server-side WebMethods

Headache #1: Leverage existing XML Schemas Several efforts exist for defining industry or domain specific standard XML Schemas E.g. SALT, MathML A lot of companies design data in XSD So no reinvention of the wheel, please [WebMethod] just generates XSD based on the.NET types Can control generation process through attributes But no built-in support to import external Schemas Would be nice to also validate messages against Schema

Leverage existing XML Schemas SoapExtensionReflector is your friend Use.NET attributes in your service code Map existing Schemas to your type classes Map existing Schemas to your method parameters Optionally validate incoming messages against the underlying XSD Use a SoapExtension

Using XML Schemas demo demo

Headache #2: Accessing the SOAP message Web services are actually all about transfering XML messages Do not think „Simple Object Access Protocol“!, better „Service Oriented Architecture Protocol“ Sometimes we want to see and work with the SOAP message from the wire „Look ma: it‘s XML, not objects!“ ASMX does not intrinsically allow us to view and access the SOAP streams

Accessing the SOAP message Client side: Use buckets/slots in proxy class to store streams and establish a context Use SoapExtension to inject functionality in ASMX pipeline Service side: Directly access the stream from HttpContext Pack this into a SoapExtension

SOAP from the wire demo demo

Headache #3: Dynamically call services Ready-set-go approach in.NET for connecting to XML Web services Create native proxy class from WSDL at design time There are situations where you actually do not know the WSDL yet At least in testing scenarios Think grid computing Need for dynamically binding to and invoking a service at runtime only

Dynamically call services Everything needed is in the.NET Framework CodeDom, Reflection, ServiceDescriptionImporter, ICodeCompiler,... Build a.NET assembly and use it simply by calling a few methods on a type Note: degraded performance! Caching may help out Leverage this feature SQL Server 2000 to invoke Web services at runtime Use.NET CLR from within a SPROC Leverage XSP‘s power

Dynamic Web services invocation ( from SQL Server) demo demo

Headache #4: Type Fidelity? Yes, Web services are all about XML messages But we need a programming model to work with.NET exposes types and classes for ease of development Types are modeled in assemblies which should be used in several layers of application Use these same types in several Web services, clients ‚Same‘ regarding XSD ( targetNamespace ) Trying to use existing types rather than proxy-built types Beware: Web services are not about type fidelity .NET Remoting

Type Fidelity? What counts are the XSD types in WSDL Have to be in the same namespace to be the same types Use [XmlType(Namespace=„My namespace“] on your type For VS.NET you have to tweak the generated classes on the client Types in different CLR namespaces Beware of code changes when regenerating Use wsdl.exe on command line Visual Studio.NET Add-In for handling issues would be nice to build Take a look at the proxy class tool of WSE Also good for the data binding problem

Using Types demo demo

Headache/Recommendation #5: Asynchronous programming The truth about today‘s Web services: They are not yet loosely coupled, asynchronous We nearly always use HTTP and the Web is slow, unreliable, bad You should always think to call Web services asynchronously You must do so in a Windows Forms app Decouple Web service call from GUI thread Think about one-way calls There are scenarios where asynchronously executing WebMethods may also help Not for simple services, but lenghty background I/O work

Asynchronous programming Client side: Three conceptual approaches: Polling, WaitHandles, Callbacks Thoroughly think which approach to use when Leverages the BeginXXX and EndXXX methods in proxy class Attention: WinForms & threads, multiple calls, faults Service side: Async. WebMethods to decouple background processing Use carefully, might block threads from thread pool

Asynchronous programming demo demo

Recap – what did we just see? Best practices from customer projects [WebMethod] is appropriate for starting It is not bad – but also not good alone Good interface and schema design wins! Debate: what is loosely coupled, what not? Where is it good, where not? A lot of headaches can be solved already now Use built-in, but unknown features Roll your own extensions And most important: This were just five selected headaches – be sure there are a lot more

There is more … trust me To WSDL or not to WSDL More control over WSDL generation Legend of passing Binary Data Never ending story of the Dataset Unfamous IXmlSerializable mysteries Where ASMX fails and IHttpHandler comes to rescue Databinding against proxy generated types Interoperability … and counting...

- Reminder - So you still like [WebMethod]? OK, it’s great – but always remember...

- Reminder - “ … love is the message and the message is love …” From a song by MSFB

Resources Christian‘s Weblog Expect samples there....NET XML Web services Repertory MSDN XML Web services Development Center MSDN Magazine Yasser Shohoud‘s book Real World XML Web services for VB and VB.NET developers

Ask The Experts Get Your Questions Answered Meet me! Wednesday, a.m. – 2.00 p.m. Thursday, a.m. – 2.00 p.m. Well, when sitting here this has just passed by …

Community Resources Most Valuable Professional (MVP) Newsgroups Converse online with Microsoft Newsgroups, including Worldwide User Groups Meet and learn with your peers

evaluations evaluations

© 2003 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS SUMMARY.