• No results found

CST6445: Web Services Development with Java and XML Lesson 1 Introduction To Web Services Skilltop Technology Limited. All rights reserved.

N/A
N/A
Protected

Academic year: 2021

Share "CST6445: Web Services Development with Java and XML Lesson 1 Introduction To Web Services Skilltop Technology Limited. All rights reserved."

Copied!
47
0
0

Loading.... (view fulltext now)

Full text

(1)

CST6445: Web Services 

Development with Java and XML  Lesson 1 ­ Introduction To Web  Services

(2)

Opening Night 

§

Course Overview 

§

Perspective 

§

Business Case 

§

Technology 

§

Development 

§

Summary 

§

References

(3)

Session 1  Introduction To Web Services  Session 2  Processing XML (Part 1)  Session 3  Processing XML (Part 2)  Session 4  Web Service Interaction (Part 1)  Session 5  Web Service Interaction (Part 2)  Session 6  Web Services Workshop  Session 7  Standards  Lecture 1  Architecture  XML  JWSDP  Lab 1  Web Service Deployment  Lecture 2  XML DTD  JAXP ­ SAX  Lab 2  Parsing XML ­ SAX  Lecture 3  XML Schema  JAXP ­ DOM  Lab 3  Parsing XML ­DOM  Lecture 4  XSLT  SOAP  SAAJ API  Lab 4  SAAJ  Lecture 5  UDDI  WSDL  JAXR  JAX­RPC  Lab 5  JAX­RPC Services  Lecture 6  Workshop Goals Lab 6  Develop/Deploy Web Service  Lecture 7  Web Service Standards  Course Summary  Lab 7  Workshop Evaluation  Required Text :J2EE Platform Web Services  Ray Lai Prentice Hall  Recommended Text Building Web Services with Java:  Making Sense of XML, SOAP, WSDL, and UDDI (2nd Edition)  Labs – 50%  Final – 50%  Final Exam 

CST6445 Course Overview

(4)

What is a Web Service? 

§ 

Used primarily as a means for businesses to  communicate with each other and with  clients, Web services allow organizations to  communicate data without intimate  knowledge of each other's IT systems  behind the firewall. 

§ 

Web services do not provide the user with a  GUI Web services instead share business  logic, data and processes through a  programmatic interface across a network.

(5)

What is a Web Service? 

§ 

Web services describes a standardized way  of integrating applications (or some  functionality of an app) using open  standards such as XML, SOAP, WSDL and  UDDI over an Internet Protocol backbone. 

§ 

Communicating data in standardized way.  Web  Service  Consumer  Web  Service  Producer

(6)

What is a Web Service? 

§

The W3C defines a Web service as a 

software system designed to support  interoperable machine­to­machine 

(7)

Perspective: Overview 

§

Good deal of hype and promise to  solve the needs of business with a  single all encompassing solution. 

§

In reality, we know this to be a  natural occurrence while things are  evolving. 

§

However, there are technologies and  practices we can use today that  mitigate risk and solve both short and  long term business goals.

(8)

Perspective: Business Relevance 

§

Primary goals of any business are to  solve information delivery problems  to achieve a high degree of customer  satisfaction and improve crucial  business processes. 

§

There is a definite trend away from  proprietary point to point and rich  client interfaces. 

§

Web Services are becoming the de  facto approach to implementing B2C  and B2Bi.

(9)

Perspective: Industry Trends 

§

“White label” services 

§

Post bubble economics 

§

Broadband availability 

§

Destructive client technology 

§

Mobile clients 

§

Customer Expectations 

§

Standards for interoperability 

§

Platforms and frameworks

(10)

Perspective: Why Web Services? 

§ 

Internet and pervasiveness of the WWW. 

§ 

Customer experience. 

§ 

Interoperability standards. 

§ 

Patterns and tools for accessing legacy  information systems. 

§ 

IT and development costs. 

§ 

Quality of service “ilities”. (e.g. scalabilty, availabilty) 

§ 

Language and platform independence.

(11)

Perspective: Why Web Services? 

§

Technology enabler for legacy  systems integration and cross­  platform interoperability. 

§

Proliferation of XML, Java technology  and B2B 

§

Business drivers  • Cost reduction  • B2B integration  • Time to market  • Legacy systems and mainframe integration

(12)

Perspective: Why Web Services? 

§

Technology drivers  • Single, common framework for many business  services and business partners  • Loose coupling with stable interfaces and  common code base  • Industry wide support in application servers  and middleware vendors: Sun, IBM, Microsoft  and BEA.  • Addresses data silos and restrictive ERP  architectures  • Mitigates risk from obsolete technology

(13)

Business Case: Analysis 

§

Web Services implementation should  consider the need to aggregate  business information from existing  monolithic business services. 

§

Is there a requirement for a business  process engine to perform this  aggregation into meaningful business  information and customer services? 

§

What are the characteristics?

(14)

Business Case: Characteristics 

§

Trading Partners  • More than one?  • Need to interoperate with back­end legacy  systems and heterogeneous platforms? 

§

Reusability  • No reuse? Don’t bother. 

§

Branding  • Integrating two different services may need to  accommodate different constraints.

(15)

Business Case: Characteristics 

(cont’d) 

§

Technology Constraints  • Back­end business services will “never” be re­  engineered.  • Need to coexist and leverage existing services. 

§

Limited Delivery Time Window  • Must be easy and quick to deploy.  • Must support different protocols and message  formats.  • Support for a variety of industry standards  and platforms.

(16)

Business Case: Benefits 

§

Interoperability  • Low cost tool to meet time to market.  • Cross­platform and legacy systems  integration. 

§

Reusability and Maintainability  • Business services exposed as Web Services.  • Service calls and interface easy to maintain. 

§

ROI  • Deployable within weeks or months.  • Lower costs of integration and maintenance.

(17)

Technology: Definition 

§

Web services are units of business  services, applications, or system  functionality that can be accessible  over an IP network. 

§

Web Services can enable legacy  system functionality to be exposed as  a reusable business service without  rewriting it. 

§

Web services technology can be used  as a cross­system or cross­enterprise  integration.

(18)

Technology: Components 

§

Web services are units of business  services, applications, or system  functionality that can be accessible  over an IP network. 

§

XML is the enabling technology on  which these are built. 

§

SOAP and HTTP provide transport. 

§

WSDL provides service description. 

§

UDDI provides service registration. 

§

J2EE provides the APIs.

(19)

Technology: Components 

§ 

Web services describes a standardized way  of integrating applications (or some  functionality of an app) using open  standards such as XML, SOAP, WSDL and  UDDI over an Internet Protocol backbone. 

§ 

Communicating data in standardized way.  Web  Service  Consumer  Web  Service  Producer

(20)

Technology: Actors 

§

Service Provider  • Runs business services  • Defines, registers and publishes 

§

Service Broker  • Defines, register and publishes on behalf of  Service Providers 

§

Service Consumer  • Locates business services  • Retrieves and binds

(21)

Service Oriented Architecture 

§

With the trio of  • Service Provider  • Service Broker  • Service Consumer  we have the foundation for a Service Oriented  Architecture.  By the end of the course you will have a better  understanding of Web Services and will be  able to understand SOA.

(22)
(23)

Technology: XML 

§ 

Markup language ­ like HTML 

§ 

Like SGML – used to define new grammars. 

§ 

Semantics VS Presentation of data ­ unlike  HTML 

§ 

A language for describing Web application  languages/protocols 

§ 

Describes data and/or process 

§ 

Fundamental for Web service interactions 

§ 

Global namespace support facilitates  standard service protocols (e.g. SOAP)

(24)

Technology: XML Document 

§

Representing Data  <customer>  <name>John Smith</name>  <address type=“billing”>  123 Anonymous St.  Someplace, Somewhere  </address>  <credit>  <type>VISA</type>  <number>99999999999</number>  <expiry>31/12/2003</expiry>  </credit>  </customer>

(25)

Technology: XML Document 

§

Representing Process  <method>  <name>GetCustomer</name>  <arg>  <name>CustomerName</name>  <value>John Smith</value>  </arg>  <arg>  <name>GetCreditInfo</name>  <value>true</value>  </arg>  </method>

(26)

Technology: XML Document 

§ 

Elements  •  Encapsulate data or child elements  •  Well formed: must have a matching end element or  element denoting no content (empty element):  • <start­tag> some content </end­tag>  • < self­closing­tag /> 

§ 

Attributes  •  Additional information specific to an element  •  Attribute data must be contained in quotes  • < start­tag attribute=“attribute data”>…</ start­tag  >

(27)

Technology: XML Document 

§

Processing Instructions  • XML processor directives  • <?target instructions?>  • Can be used to include code fragments  • <?xml … ?> reserved for XML standards 

§

Character data  • Data between tags and in attributes  • Special notation can be used to pass data  through unprocessed. 

§

<!­­ This is a comment ­­>

(28)

Technology: XML Document 

§

Plain text method for describing and  identifying data 

§

Can be styled according to application  defined rules 

§

Document inclusion, reuse and  standardization 

§

Easily processed  • Well formedness rules  • Hierarchical representation

(29)

Technology: XML Document 

§

XML document consists of:  • Declarations and definitions  • Elements and attributes  • Processing instructions  • Character data and comments 

§

Definitions section identifies element  and attribute names and declares  constants 

§

Element and attribute names are  defined by application requirements

(30)

Technology: XML ­ DTD 

§

Declarations and Definitions – DTD  • Document Type Definition 

§

DTD is used for document validation 

§

ELEMENT, ATTRIBUTE and ENTITY  declarations 

§

Defines element relationships  • Parent­child, multiple occurrences 

§

Entities are like constants  • &amp; is an entity declaration in the DTD for  XML

(31)

Technology: XML ­ XSD 

§

XML Schema Definition (XSD) 

§

Used for document validation 

§

XML document 

§

More concise description of document  structure 

§

Strong typing and constraint  definition 

§

Reuse and “object” definitions

(32)

Technology: Some Terminology 

§

URI  • Uniform Resource Identifier 

§

URL  • Uniform Resource Locater  • defines how to locate a resource 

§

URN  • Uniform Resource Name  • Tells something about a resource – the name 

§

A URI is defined to be a locater, a  name or both. It is the more general  term.

(33)

Technology: XML Namespaces 

§ 

Namespaces 

§ 

Differentiates elements with the same name 

§ 

Addresses conflicting name issues when  exchanging documents with partners 

§ 

xmlns=“URI” sets the default namespace  for elements and attributes 

§ 

xmlns:PFI=“URI” sets the namespace for  elements prefixed with PID  •  <PFI:name>...</PFI:name>

(34)

Technology: XML Parsers 

§

Parsers 

§

SAX  • Simple API for XML processing  • event driven 

§

DOM  • Document Object Model  • Hierarchy of elements

(35)

Technology: XML 

§

Many standards:  • SAX, DOM, OO models (JDOM, dom4j)  • DTD, XML Schema  • Namespaces  • XSL (XSLT, XPath, XSL­FO), Xlink  • XHTML  • RDF, ebXML, WSDL, UDDI, SOAP 

§

Many more to come …  • Thanks to an open and flexible specification

(36)

Technology: J2EE APIs 

§

JAXP  • Processing XML documents 

§

JAXM  • Messaging with XML documents (SOAP) 

§

JAXRPC  • Remote Procedure Calls with XML (SOAP) 

§

JAXR  • Accessing Web service registries with XML

(37)

Development: Programming 

Details 

§

Factory Design Pattern 

§

Tree Structures 

§

Attribute­Value pairs 

§

Event driven programs

(38)

Development: Factory Design 

Pattern 

§

A helper class (factory) that  instantiates (produces) objects on  behalf of another object 

§

Hides or abstracts implementation  details 

§

Typically produces Interface types 

§

Underlying concrete class can be  associated with the factory through a  java system property 

§

This is the case for the XML  processors

(39)

Development: Factory Design 

Pattern 

§

Typically a program must first get an  instance of a factory using a static  factory method  • FactoryClass.newInstance()  • FactoryClass.getInstance() 

§

Factory classes are usually abstract  • FactoryClass.newInstance() returns a concrete  implementation of the abstract class 

§

javax.xml.parsers.SAXParserFactory

(40)

Development: Tree Structures 

§

XML documents can be modeled using  a hierarchical (tree) data structure 

§

Each node in the tree (regardless of  type) has a parent node and zero or  more child nodes  • The root node has no parent  • A node with no children is a leaf node 

§

Access methods are provided to move  around in the tree structure

(41)

Development: Tree Structures 

§

Any node in the tree presents a  uniform view no matter what data is  contained or represented by the node 

§

An interface or abstract class is used  to define the node contract  public interface TreeNode  TreeNode getParent();  void setParent(TreeNode);  TreeNode [] getChildren();  void addChild(TreeNode childNode);  void setNodeData(Object nodeData);  Object getNodeData();  }

(42)

Development: Tree Structures 

§

Recursion is often used to evaluate  trees  int countChildNodes(TreeNode startNode) {  int count = 0;  if ( startNode != null ) {  TreeNode children[] = startNode.getChildren();  count = children.length;  for(int i= 0; i < children.length; i++ ) {  count += countChildNodes(children[i]);  return count; 

§

org.w3c.dom.Node

(43)

Development: Attribute­Value 

Pairs 

§ 

Names associated with values  •  type="ordered"  •  font="Arial"  •  name="value" 

§ 

Maps are data structures used to associate  one object with another object  •  Hashtable, HashMap in java.util 

§ 

String => String models attribute­value  pairs  •  org.w3c.dom.NamedNodeMap

(44)

Development: Event Driven 

Programs 

§

Event listener objects  • events classes and listener interfaces are  defined by an API  • java.awt.event.ActionEvent  • java.awt.event.ActionListener 

§

Listener interface implementations  define the callback methods used by  the API to notify 

§

Events are stream oriented 

§

org.xml.sax.ContentHandler

(45)

Summary 

§

Web services are units of business  services, applications, or system  functionality that can be accessible  over the Web. 

§

Web services technology provides  interoperability and integration  solutions while mitigating risk.

(46)

Summary 

§

XML is the technology enabler. 

§

SOAP and HTTP provide transport  services. 

§

WSDL provides service binding. 

§

UDDI provides discovery and  retrieval. 

§

J2EE provides the APIs.

(47)

References 

§

W3C – World Wide Web Consortium  • XML standards  •  http://www.w3.org/ 

§

Sun Microsystems  • J2EE 1.4 Tutorial  •  http://java.sun.com/j2ee/1.4/docs/tutorial/doc/index.ht  ml 

§

J2EE Platform Web Services  •  Ray Lai, Sun Microsystems Press, ISBN 0­13­101402­1 

§

Wikipedia 

References

Related documents

Green Building Council's LEED® green building program is the preeminent program for the design, construction, maintenance and operations of high-performance green buildings. Learn

Tema pod nazivom „Trendovi u proizvodnji i vanjsko-trgovinskoj razmjeni jabuka“ je imala za cilj istražiti proizvodnju, prinose, površine te svojstva i učinke vanjsko-trgovinske

Met Accounting System Process Control System Historian and Downtime Events Plant Data Lab Data Mining Data Weighbridge and Loadrite Data Web Reports Warehouse. Data

Whilst this particular submission relates to the application of Smart ICT to improve the design and planning of Infrastructure, Bentley Systems does not believe that the

While it is true that libraries who apply for e-rate discounts on internet access or internal connections must filter, libraries that apply for e-rate discounts on

Shenzhen pilot focuses on UAS segregated operation below AGL 120 meters, and the Hainan pilot project is extended to the non-segregated operation with manned flight for

555, 558, 574 (2001) (arguing that there are political and cultural factors that hamper effective enforcement of intellectual property laws in the Middle East and that there is

This paper propose a credit card fraud detection technique using Neural Networks and Simulated Annealing algorithm to adjust the weight of the neural network, Neural Network is