Introduction to XML and Web Service ISYS 464. HTML vs XML HTML is a language specifically designed for displaying information in browser. It doesn’t carry.

Slides:



Advertisements
Similar presentations
XML-XSL Introduction SHIJU RAJAN SHIJU RAJAN Outline Brief Overview Brief Overview What is XML? What is XML? Well Formed XML Well Formed XML Tag Name.
Advertisements

Intesar G Ali IT DepartmentPalestinian Land Authority Web services Prepared by: Intesar Ali IT Department PLA August 2010.
Web Service Ahmed Gamal Ahmed Nile University Bioinformatics Group
Web Services Nasrullah. Motivation about web service There are number of programms over the internet that need to communicate with other programms over.
ICS-FORTH 1 May 22, 2001 Christos Georgis The extensible markup language: An introduction to XML What is a XML document ? How do we check its validity.
3 November 2008CIS 340 # 1 Topics To define XML as a technology To place XML in the context of system architectures.
CS 898N – Advanced World Wide Web Technologies Lecture 21: XML Chin-Chih Chang
Concurrency Control. R/RR/W W/W User 2 ReadWrite User 1 Read Write R/W: Inconsistent Read problem. W/W: Lost Update problem.
Authenticating Users in an ASP.NET Application. Web Site Administration Tool From VS 2008, click Website/ ASP.Net Configuration to open Web Site Administration.
VB.NET Database Tools ISYS Net Applications OLE DB Provider OLE DB Data Source OLE DB Provider ODBC Data Source SQL Server Data Source SQL Server.Net.
ASP.Net AJAX. AJAX Asynchronous JavaScript and XML: – JavaScript, Document Object Model, Cascade Style Sheet, XML, server-side script such as.Net, etc.
Web Site Security ISYS 512/812. Authentication Authentication is the process that determines the identity of a user. Web.config file – node Options: –Windows:
Web Page Introduction. What is a web page? A hypertext that contains clickable links. A web page is a text file containing Hyper Text MarkUp Language.
VB.NET Database Tools ISYS 573. Microsoft Universal Data Access ODBC: Open Database Connectivity –A driver manager –Used for relational databases OLE.
Introduction to Web Application Development with.Net and Web Service ISYS 350.
Coding ADO.NET Objects: Connection, Command, DataReader.
Introduction to XML ISYS 573. HTML vs XML HTML is a language specifically designed for displaying information in browser. It doesn’t carry information.
DECO 3002 Advanced Technology Integrated Design Computing Studio Tutorial 5 – XML Basic School of Architecture, Design Science and Planning Faculty of.
Tutorial 11 Creating XML Document
Introduction to XML: Yong Choi CSU Bakersfield.
Introduction to Web Service ISYS 512. Web Service XML Web Service Web services are classes that are stored on the web which can instantiate and use in.
ASP and HTML. Anchor Tag testAnchorTag Demo: ASPNet/ASPNETProdListSelf.ASPX.
Web Page Introduction. What is a web page? A web page is a text file containing markup language tags. –A markup language combines text and extra information.
Introduction to XML This material is based heavily on the tutorial by the same name at
Introducing HTML & XHTML:. Goals  Understand hyperlinking  Understand how tags are formed and used.  Understand HTML as a markup language  Understand.
Web Page Introduction. What is a web page? A web page is a text file containing markup language tags. –A markup language combines text and extra information.
ECA 228 Internet/Intranet Design I Intro to XML. ECA 228 Internet/Intranet Design I HTML markup language very loose standards browsers adjust for non-standard.
XP New Perspectives on XML Tutorial 4 1 XML Schema Tutorial – Carey ISBN Working with Namespaces and Schemas.
Chapter 9 Web Services Architecture and XML. Objectives By study in the chapter, you will be able to: Describe what is the goal of the Web services architecture.
Web Page Introduction. What is a web page? A web page is a text file containing markup language tags. –A markup language combines text and extra information.
XML Anisha K J Jerrin Thomas. Outline  Introduction  Structure of an XML Page  Well-formed & Valid XML Documents  DTD – Elements, Attributes, Entities.
Introduction to XML cs3505. References –I got most of this presentation from this site –O’reilly tutorials.
XML: Overview MIS 181.9: Service Oriented Architecture 2 nd Semester,
1 © Netskills Quality Internet Training, University of Newcastle Introducing XML © Netskills, Quality Internet Training University.
Web Page Introduction. What is a web page? A web page is a text file containing markup language tags. –A markup language combines text and extra information.
Dodick Zulaimi Sudirman Lecture 14 Introduction to Web Service Pengantar Teknologi Internet Introduction to Internet Technology.
Web Services (SOAP, WSDL, UDDI) SNU OOPSLA Lab. October 2005.
 XML is designed to describe data and to focus on what data is. HTML is designed to display data and to focus on how data looks.  XML is created to structure,
XML About XML Things to be known Related Technologies XML DOC Structure Exploring XML.
Tutorial 1: XML Creating an XML Document. 2 Introducing XML XML stands for Extensible Markup Language. A markup language specifies the structure and content.
XML TUTORIAL Portions from w3 schools By Dr. John Abraham.
XML Extensible Markup Language
XP Tutorial 9 1 Working with XHTML. XP SGML 2 Standard Generalized Markup Language (SGML) A standard for specifying markup languages. Large, complex standard.
XML – An Introduction Structured Data Mark-up James McCartney CSCE 590, Cluster and Grid Computing.
Softsmith Infotech XML. Softsmith Infotech XML EXtensible Markup Language XML is a markup language much like HTML Designed to carry data, not to display.
XML 2nd EDITION Tutorial 1 Creating An Xml Document.
1 Introduction  Extensible Markup Language (XML) –Uses tags to describe the structure of a document –Simplifies the process of sharing information –Extensible.
Introduction to XML This presentation covers introductory features of XML. What XML is and what it is not? What does it do? Put different related technologies.
XP 1 Creating an XML Document Developing an XML Document for the Jazz Warehouse XML Tutorial.
Introduction to Web Service ISYS 512. Web Service XML Web Service Web services are classes that are stored on the web which can instantiate and use in.
Accessing Data Using XML CHAPTER NINE Matakuliah: T0063 – Pemrograman Visual Tahun: 2009.
ASP.Net and HTML. Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load dim strConn as string ="Provider=Microsoft.Jet.OLEDB.4.0;Data.
1 Credits Prepared by: Rajendra P. Srivastava Ernst & Young Professor University of Kansas Sponsored by: Ernst & Young, LLP (August 2005) XBRL Module Part.
XML Introduction. What is XML? XML stands for eXtensible Markup Language XML stands for eXtensible Markup Language XML is a markup language much like.
XML Design Goals 1.XML must be easily usable over the Internet 2.XML must support a wide variety of applications 3.XML must be compatible with SGML 4.It.
XML Introduction. Markup Language A markup language must specify What markup is allowed What markup is required How markup is to be distinguished from.
Tutorial 13 Validating Documents with Schemas
XML Presented by Kushan Athukorala. 2 Agenda XML Overview Entity References Elements vs. Atributes XML Validation DTD XML Schema Linking XML and CSS XSLT.
Internet & World Wide Web How to Program, 5/e. © by Pearson Education, Inc. All Rights Reserved.2.
Introduction to XML and Web Service ISYS 512/812.
CSS Hadas Kahsay. Overview  What is CSS  Basic syntax of CSS Rules  How to link CSS style to html documents  Browsers and CSS  Advantages of CSS.
Web Page Introduction. What is a web page? A hypertext that contains clickable links. A web page is a text file containing Hyper Text MarkUp Language.
Tutorial 9 Working with XHTML. New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition 2 Objectives Describe the history and theory of XHTML.
CHAPTER NINE Accessing Data Using XML. McGraw Hill/Irwin ©2002 by The McGraw-Hill Companies, Inc. All rights reserved Introduction The eXtensible.
XML BASICS and more…. What is XML? In common:  XML is a standard, simple, self-describing way of encoding both text and data so that content can be processed.
Web Page Introduction.
XML QUESTIONS AND ANSWERS
Web Services Introduction
Coding ADO.NET Objects: Connection, Command, DataReader
Database Handling Class and Service
Presentation transcript:

Introduction to XML and Web Service ISYS 464

HTML vs XML HTML is a language specifically designed for displaying information in browser. It doesn’t carry information about the structure of the content held within its page. XML (Extensible MarkUp Language) is a language used to represent data in a form that does not rely on any particular proprietary technology. It uses user-defined tags to give meaningful names to data elements. With XML, we separate the data content from the data presentation.

HTML My Favorite Book ISBN Authors: John Smith Peter Chen Price: $45.00 Description: This is a grerat book

XML John Smith Peter Chen David Chao $45.00 This is a grerat book Adam Smith $25.00 This is a second great book

XML Document Well-formed documents: –Documents comply with the rules of XML syntax. Valid documents: –Documents that are well-formed and comply with a XML schema or Document Type Definition (DTD is a file containing the rules used to define the document).

Well-Formed Documents There is only one root node. All elements must have a start tag and an end tag (except for an empty element, see example below) Elements must be nested correctly. If an element has an attribute, the attribute value must be quoted. –An empty element with an attribute: Note: XML is case sensitive.

XML Documents The XML declaration: – –Note: xml should be in lower case. Namespaces –Define a namespace:xmlns:”uri” where the Uniform Resource Identifier is a unique identifier and is often a URL. –Use a namespace to make a tag unique: Elements: –Each start-tag/end-tag pair, with the data that lies between them, is an element. –Ex. John Smith –The start and end tag must be in the same case.

Attributes: Elements can have attributes. These are values that are passed to the application, but not constitute part of the content of the element. Attributes are included as part of the element’s start tag, and values must be enclosed in quote marks. – Spinach – Carrot

Tree View of XML Books Book ISBN Authors Price Description Book ISBN Authors Price Description Author

Valid Documents Well-formed documents that conform to an XML schema. XML parsers are programs that are able to validate an XML document against schema.

XML Schema Definition of an XML Document Namespaces: Allow element names to be qualified to avoid name collisions. Complex and simple types: –Elements that contains other elements are complex type. Cardinality: –minOccurs: 0 for optional element. –maxOccurs: specified number or unbounded Compositor: –Sequence: defines an ordered sequence of subelements. –Choice: defines a choice between several possible elements. Constraints: –Uniqueness contraint

Access Support for XML File: –Export –Get External Data

Style Sheets XSL: Extensible Stylesheet Language Tell the browser how to display the XML document. With a style sheet, all of the style rules are kept in one file and the source document simply links to this file. File extension:.CSS

Browser screen structure: –Page Area –Block Flow Object: Taking up the whole line. –In-Line Flow Object: Several in-line objects may be on the same line.

My Favorite Book John Smith Peter Chen $45.00 This is a grerat book My Second Favorite Book Adam Smith $25.00 This is a second great book

btitle{ display:block; font-family: Aerial, Helvetica; font-weight: bold; font-size: 20pt; color: #9370db; text-align: center; } ISBN{ display:block; font-family: Aerial, Helvetica; font-weight: bold; font-size: 12pt; color: #c71585; text-align: left; } Authors{ display:inline; font-family: Aerial, Helvetica; font-style: italic; font-size: 10pt; color: #9370db; text-align: left; }

Price{ display:block; font-family: Aerial, Helvetica; font-size: 12pt; color: #ff1010; text-align: left; } Description { display:block; font-family: Aerial, Helvetica; font-size: 12pt; color: #ff1010; text-align: left; }

Demo ASPNet/FavoriteBook.htm

Web Service XML Web Service Web services are classes that are stored on the web which can instantiate and use in both Windows and Web applications.

To Add a New Web Service: Website/Add New Item/Web Service –Web Service has an extension: ASMX –The CodeBehind File is stored in the App_Code folder. Web Services are defined as Web Method: – _

A Web Service Example Public Class MyWebService Inherits System.Web.Services.WebService Public Function GetCname(ByVal CID As String) As String Dim strConn As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source = c:\salesDB.mdb" Dim objConn As New OleDbConnection(strConn) Dim strSQL As String = "select * from customer where CID = '" & CID & "';" Dim objComm As New OleDbCommand(strSQL, objConn) objConn.Open() Dim objDataReader As OleDbDataReader objDataReader = objComm.ExecuteReader() If objDataReader.Read() Then Return objDataReader("Cname") Else Return ("Not exist") End If End Function End Class

Web Service Description Language (WSDL) A WSDL file is an XML document containing a complete description of the web service. It shows a web service’s name, methods, and parameter types. Help page: After entering web service’s URL, a help page is displayed. You can click the Service Description link to see the WSDL file.

Returning an ArrayList Public Function GetCnameRating(ByVal CID As String) As ArrayList Dim strConn As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source = c:\salesDB.mdb" Dim objConn As New OleDbConnection(strConn) Dim strSQL As String = "select * from customer where CID = '" & CID & "';" Dim objComm As New OleDbCommand(strSQL, objConn) objConn.Open() Dim objDataReader As OleDbDataReader objDataReader = objComm.ExecuteReader() Dim temp As New ArrayList If objDataReader.Read() Then temp.Add(objDataReader("Cname")) temp.Add(objDataReader("Rating")) Else temp.Add("Not exist") End If Return temp End Function

Consuming Web Services from a Windows Application Add a web reference to the web service: –Project/Add Web Reference Local computer Imports the web service Declare a web service class variable. –Dim UseWs As New DBWebService Note: Web Service CodeBehind file location.

Code Example (Windows Project) Imports TestXML.MyWService Public Class Form3 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim MyWs As New MyWebService Try MessageBox.Show(MyWs.GetCname(InputBox("enter cid: "))) Catch except As SystemException MessageBox.Show(except.Message) End Try End Sub End Class

Reference a Web Service on Internet Mortgage calculator

Universal Description, Discovery, and Integration (UDDI) A directory service for web services. – UDDI is an open industry initiative enabling businesses to publish service listings and discover each other and define how the services or software applications interact over the Internet. A UDDI business registration consists of three components: –White Pages — address, contact, and known identifiers; –Yellow Pages — industrial categorizations based on standard taxonomies; and –Green Pages — technical information about services exposed by the business.

Loosely Coupled Software Refers to software routines (modules, programs) that can be called by an application and executed as needed. For example, Web services are loosely coupled software modules that are invoked on demand when required. An approach to designing interfaces across modules to reduce the interdependencies across modules or components – in particular, reducing the risk that changes within one module will create unanticipated changes within other modules.

Service Oriented Architecture SOA expresses a perspective of software architecture that defines the use of loosely coupled software services to support the requirements of the business processes and software users. In an SOA environment, resources on a network are made available as independent services that can be accessed without knowledge of their underlying platform implementation. A service-oriented architecture is not tied to a specific technology. It may be implemented using a wide range of technologies.