Web Services Error Handling and Debugging. Agenda Simple SOAP faults Advanced SOAP faults SOAP headers and faults Error handling From a Service Perspective.

Slides:



Advertisements
Similar presentations
Web Service Ahmed Gamal Ahmed Nile University Bioinformatics Group
Advertisements

SOAP.
CIS 375—Web App Dev II SOAP.
Topics Acronyms in Action SOAP 6 November 2008 CIS 340.
SOAP Lee Jong-uk. Introduction What is SOAP? The features of SOAP The structure of SOAP SOAP exchange message model & message Examples of SOAP.
SOAP Quang Vinh Pham Simon De Baets Université Libre de Bruxelles1.
Microsoft VB 2005: Reloaded, Advanced Chapter 5 Input Validation, Error Handling, and Exception Handling.
DEV392: Extending SharePoint Products And Technologies Through Web Parts And ASP.NET Clint Covington, Program Manager Data And Developer Services - Office.
Web Development in Microsoft Visual Studio Slide 2 Lecture Overview Introduce Visual Studio 2013 Create a first ASP.NET application.
What is.NET?. The Clients of.NET a) A new generation of connected application b) Microsoft.NET Framework managed execution c) Allows PCs and other smart.
SOAP CPSC 315 – Programming Studio Spring 2008 Project 3, Lecture 2.
IIS v7.0 Martin Parry Developer & Platform Group Microsoft Limited
Microsoft SharePoint 2013 SharePoint 2013 as a Developer Platform
ASP.NET Programming with C# and SQL Server First Edition Chapter 8 Manipulating SQL Server Databases with ASP.NET.
DEV450 Visual Studio: Best Practices For Debugging Managed Applications Habib Heydarian Scott Nonnenberg Program Managers Microsoft Corporation.
.NET Health Monitoring Jonathan Franco ITD Application Services.
Service Broker Lesson 11. Skills Matrix Service Broker Service Broker, provides a solution to common problems with message delivery and consistency that.
Microsoft ® Official Course Monitoring and Troubleshooting Custom SharePoint Solutions SharePoint Practice Microsoft SharePoint 2013.
IT533 Lectures Configuring, Deploying, Tracing and Error Handling.
Windows.Net Programming Series Preview. Course Schedule CourseDate Microsoft.Net Fundamentals 01/13/2014 Microsoft Windows/Web Fundamentals 01/20/2014.
Introduction to the Enterprise Library. Sounds familiar? Writing a component to encapsulate data access Building a component that allows you to log errors.
XML Web Services in Visual Studio.NET Peter Ty Developer Evangelist.NET and Developer Group.
A Scalable Application Architecture for composing News Portals on the Internet Serpil TOK, Zeki BAYRAM. Eastern MediterraneanUniversity Famagusta Famagusta.

SOAP Tutorial Ching-Long Yeh 葉慶隆 Department of Computer Science and Engineering Tatung University
Developing Workflows with SharePoint Designer David Coe Application Development Consultant Microsoft Corporation.
Conditions and Terms of Use
Microsoft Dynamics AX 2009 Integration and Development with the.NET Framework Introduction to the Course.
Microsoft Visual Studio 2010 Muhammad Zubair MS (FAST-NU) Experience: 5+ Years Contact:- Cell#:
ASP.NET Web Application and Development Digital Media Department Unit Credit Value : 4 Essential Learning time : 120 hours Digital.
James Holladay, Mario Sweeney, Vu Tran. Web Services Presentation Web Services Theory James Holladay Tools – Visual Studio Vu Tran Tools – Net Beans Mario.
Microsoft Visual Studio 2010 Muhammad Zubair MS (FAST-NU) Experience: 5+ Years Contact:- Cell#:
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.
DEV325 Deploying Visual Studio.NET Applications Billy Hollis Author / Consultant.
.Net and Web Services Security CS795. Web Services A web application Does not have a user interface (as a traditional web application); instead, it exposes.
Tracing 1www.tech.findforinfo.com. Contents Why Tracing Why Tracing Tracing in ASP.NET Tracing in ASP.NET Page Level tracing Page Level tracing Application.
Phone: Mega AS Consulting Ltd © 2007  CAT – the problem & the solution  Using the CAT - Administrator  Mega.
Introduction to ASP.NET T.Ahlam Algharasi. The Visual Studio IDE Start page 2.
10 – 12 APRIL 2005 Riyadh, Saudi Arabia. Building multi-lingual ASP.Net application that handle western languages and Arabic with a single code base.
Introduction to Exception Handling and Defensive Programming.
Web Services. ASP.NET Web Services  Goals of ASP.NET Web services:  To enable cross-platform, cross- business computing  Great for “service” based.
10 – 12 APRIL 2005 Riyadh, Saudi Arabia. Visual Studio 2005 : New Features for the Web Services Developer Malek Kemmou CEO Arrabeta Consulting Microsoft.
Slide 1 ASP Authentication There are basically three authentication modes Windows Passport Forms There are others through WCF You choose an authentication.
Reset and Recycle IIS Reset Application Pool Management Error Codes New HTTP Sub-status codes Custom/Detailed Errors Tracing in IIS7 and.
Chapter 10 Intro to SOAP and WSDL. Objectives By study in the chapter, you will be able to: Describe what is SOAP Exam the rules for creating a SOAP document.
DEV333 Instrumenting Applications for Manageability with the Enterprise Instrumentation Framework David Keogh Program Manager Visual Studio Enterprise.
1 Web Services Web and Database Management System.
VITALE, CATURANO & COMPANY LTD Microsoft SharePoint Web Part Development Overview VITALE, CATURANO & COMPANY LTD SharePoint Developer Series – Web Part.
SOAP Kanda Runapongsa Dept. of Computer Engineering Khon Kaen University.
ASP.NET Web Services.  A unit of managed code installed under IIS that can be remotely invoked using HTTP.
Configuring and Troubleshooting Identity and Access Solutions with Windows Server® 2008 Active Directory®
Configuring and Deploying Web Applications Lesson 7.
DEV332 Programming for the Middle Tier in Visual Basic.NET Billy Hollis Author / Consultant.
Building Custom Controls with ASP.NET and the Microsoft ®.NET Framework Rames Gantanant Microsoft Regional Director, Thailand
Beginning 자바 웹 서비스 SOAP 강미란 Cyber-Infrastructure Research Lab Konkuk University.
OE-NIK HP Advanced Programming WCF WCF SOAP service, host, client Exception handling (NOT required)
Introduction to ASP.NET, Second Edition2 Chapter Objectives.
 Cloud Computing technology basics Platform Evolution Advantages  Microsoft Windows Azure technology basics Windows Azure – A Lap around the platform.
17 Copyright © 2006, Oracle. All rights reserved. Information Publisher.
Manohar1 Fault Handling Activities covered: 1.Scope 2.Throw 3.Catch 4.Sensor.
ASP.NET 2.0 Mohammed Abdelhadi Developer.NET Evangelist Microsoft Corporation.
Jim Fawcett CSE681 – SW Modeling & Analysis Spring 2005
ASP.NET Programming with C# and SQL Server First Edition
ITEC 420 Framework Based Internet Applications
Advanced Web-based Systems | Misbhauddin
ASP.NET Web Forms and Web Services
Enterprise Library Overview
Security mechanisms and vulnerabilities in .NET
Serpil TOK, Zeki BAYRAM. Eastern MediterraneanUniversity Famagusta
ITEC 420 Framework Based Internet Applications
Presentation transcript:

Web Services Error Handling and Debugging

Agenda Simple SOAP faults Advanced SOAP faults SOAP headers and faults Error handling From a Service Perspective Debugging Web services

Simple SOAP Faults SOAP Error Handling SOAP 1.1 provides standard for error communication SOAP Fault contains error information   Associated with SOAP response   Contained in SOAP Body Only one fault element per message   Specific error information contained in child elements   faultcode, faultstring, faultactor and detail

Simple SOAP Faults Basic SOAP Error Encoding <soap:Envelope xmlns:soap=" soap:Server Server Error

Simple SOAP Faults Fault Element Content Required child elements   faultcode   faultstring Optional child elements   faultactor   detail Represented in.NET managed classes   SoapException   SoapHeaderException

Simple SOAP Faults Exception Serialization ASP.NET serializes errors into a SOAP Fault Web Method SOAP:Fault Serializes ASP.NET Throws IndexOutofBoundsException

Simple SOAP Faults Exception Deserialization In message receivers,.NET deserializes a SOAP Fault into a SoapException Catch SoapException Web Service Client Deserialize SoapException SOAP:Fault

Simple SOAP Faults SOAP Trace Utility Utility for viewing SOAP messages on the wire   Logs incoming and outgoing messages   Use on client or server Proxy-based HTTP only WSE 2.0 Trace Utility:

Simple SOAP Faults Server Configuration Parameters Default error information is not appropriate for a client Control what is revealed in Web.config Set customErrors mode attribute = “On”   No stack information   No function name   No line numbers <customErrors mode=“On”…

Simple SOAP Faults for Web Services and Clients

Advanced SOAP Faults Server Fault Code Signals an error during internal processing   soap:Server The client is not responsible   Error in an affiliated service or sub-system   The same message may succeed later Report detail in   Keep message generic In SOAP 1.2 renamed “Receiver”

Advanced SOAP Faults Client Fault Code Signals a problem with the message   Violates message contract   Bad input data   Failed validation The client is responsible Use to provide additional information   Well-formed XML or text In SOAP 1.2 renamed “Sender”

Advanced SOAP Faults MustUnderstand and VersionMismatch Fault Codes MustUnderstand   Related to SOAP header “mustUnderstand” attribute   Raised if header was mandatory and not understood VersionMismatch   SOAP Envelope is associated with an unsupported namespace  

Advanced SOAP Faults The.NET SoapException Class Models SOAP Fault structure   System.Web.Services.Protocols   Inherits from System.Exception   Thrown by ASMX Web method or CLR Key properties   Message (faultstring)   Code (faultcode)   Actor (faultactor)   Detail (detail)

Advanced SOAP Faults Handling a SoapException Catch SoapException errors   Use structured error handling Synchronous calls   Catch inline Asynchronous calls   Catch in the call-back method Add structured error handling to any method receiving SOAP messages

Advanced SOAP Faults for Web Services and Clients

SOAP Headers and Faults SOAP Header Errors SOAP headers contain operational data   Separate from functional data Processed prior to body MustUnderstand attribute   Defined by SOAP protocol   If “true”, the Web service must process or return MustUnderstand class error.NET SoapHeader class   Models SOAP headers   MustUnderstand and DidUnderstand properties control error state

SOAP Headers and Faults The.NET SoapHeaderException Class Represents SOAP header errors   Can be raised automatically   Or in code Derives from SoapException   Exposes Message, Code, Actor and Detail   Error handling uses same technique as that for SoapException Indicates other types of SOAP errors   Not limited to MustUndersand   SOAP client faults common

SOAP Headers and Faults Processing a SoapHeaderException Body Header Web service Input Soap Message Throw SoapHeaderException Throw SoapHeaderException Body Fault Header Output Soap Message

Error Handling From a Service Perspective Guidance Application errors   Return status information in the message   Do not return a SOAP fault Operational errors   mustUnderstand, for example   Return a SOAP fault

Error Handling From a Service Perspective Useful Error Information Provide meaningful diagnostic information   Exact location of the exception   Associated server call stack   Incident ID Record errors in a durable, accessible data store   Event logs   Trace logs   Databases

Error Handling From a Service Perspective Machine Logs Application event log   Specify source to separate Web service entries   Have appropriate write permissions Custom event log   Organize entries in separate log   Can be created on a local or remote machine   Have appropriate write permissions

Error Handling From a Service Perspective Application Trace Log Always available to Web service   One per Web site   Use trace.axd to view contents   Primarily used in development, not production Configurable through Web.config   Can be enabled or disabled   Number of entries can be limited <trace enabled=“true” requestLimit=“10”…

Error Handling From a Service Perspective Enterprise Instrumentation Framework (EIF) A comprehensive instrumentation framework   Unified API   Configurable through EnterpriseInstrumentation.config May not be available on the customer computer Freely available from Microsoft  

Error Handling From a Service Perspective EIF Event Sinks Govern information destinations   Standard or custom are available   Are configurable EIF Classes ErrorMessageEvent.Raise AuditMessageEvent.Raise Web service Configuration File Event Sinks Event Log Trace service WMI StandardEvent Sinks

Error Handling From a Service Perspective Exception Management Application Block Easy mechanism for logging errors Writes to Event Log by default Fully configurable Custom publishers   SQL Server   WMI  

Error Handling From a Service Perspective

Debugging Web Services Using Visual Studio.NET 2003 Debugging Visual Studio.NET 2003 supports Web services debugging   All Visual Studio debugging features are available   Seamlessly steps between client and Web service code   Can be used with MSSoapT Web service debugging options   Default is to launch Internet Explorer   “Wait for external processes to connect” debugging property

Debugging Web Services Remote Server Debugging Remote Web services can also be debugged using Visual Studio.NET 2003  .NET remote debugging components must be installed on remote server   Remote server must grant user debugger access   Must be part of the Debugger Users group on the remote machine

Debugging Web Services

Summary What you learned  .NET provides programming model for handling SOAP errors   Variety of options available for logging error data   Visual Studio.NET can be used to step through and debug Web services Next steps   Don’t reveal intellectual property   Don’t use SOAP faults for application communication   Proper error analysis critical to success   Choose right logging and instrumentation solution

© 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS SUMMARY. Content created by 3 Leaf Solutions