Building Service Oriented Architectures - PowerPoint PPT Presentation

About This Presentation
Title:

Building Service Oriented Architectures

Description:

Web Services Stack Evolution. 2002/06. Robi Sen department 13. Buzz Word Stack. 2002/06. Robi Sen department 13. SOAP ... stack of emerging standards. define protocols ... – PowerPoint PPT presentation

Number of Views:36
Avg rating:3.0/5.0
Slides: 46
Provided by: robi57
Category:

less

Transcript and Presenter's Notes

Title: Building Service Oriented Architectures


1
Building Service Oriented Architectures
  • ColdFusion and Web Services

2
Agenda
  • What are Web Services
  • How you can create and consume Web Services in
    ColdFusion
  • What are Service Oriented Architectures
  • Why are they important
  • How to create them

3
What is a Web Service
  • W3C
  • Definition A Web service is a software
    application identified by a URI, whose interfaces
    and binding are capable of being defined,
    described and discovered by XML artifacts and
    supports direct interactions with other software
    applications using XML based messages via
    internet-based protocols

4
My Definition
  • Encapsulated, loosely coupled, contracted
    functions offered via standard protocols

5
Three Major Things
  • Discovery/Description - WSDL
  • Publish - UDDI
  • Bind WSDL and SOAP

6
Why WS/SOAs
  • Frankly its the best application architecture
    approach for large and distributed architectures.
  • More flexibility and more generic
  • Interoperability is predefined and key which
    leads to greater ROI, longer life cycles, greater
    usability
  • Makes more sense to real people ?
  • Creates new opportunities for business, revenue,
    creativity, and over all usefulness

7
Web Services Stack Evolution
8
Buzz Word Stack
9
SOAP
  • lt?xml version"1.0" encoding"UTF-8"
    standalone"no"?gt
  • ltSOAP-ENVEnvelope SOAP-ENVencodingStyle"http//
    schemas.xmlsoap.org/soap/encoding/"
    xmlnsSOAP-ENV"http//schemas.xmlsoap.org/soap/en
    velope/"gt
  • ltSOAP-ENVBodygt
  • ltSOAPSDK1getTemperature xmlnsSOAPSDK1"capeconn
    ectAirportWeathercom.capeclear.weatherstation.St
    ation"gt
  • ltarg0gtKDCAlt/arg0gt
  • lt/SOAPSDK1getTemperaturegt
  • lt/SOAP-ENVBodygt
  • lt/SOAP-ENVEnvelopegt

10
SOAP
  • Defines a unit of communication (header,envelope,
    body)
  • Defines error handling through Soap fault
  • Defines extensibility usually through custom
    headers
  • Defines mechanism for representing abstract data
    including binary data, arrays, and complex data
  • Defines RPC common format for distributed
    computation
  • Defines Document- Centric approach to information
    exchange (i.e. B2B)

11
SOAP- response
  • lt?xml version"1.0"?gt
  • ltSOAP-ENVEnvelope xmlnsSOAP-ENV"http//schemas.
    xmlsoap.org/soap/envelope/" xmlnsxsd"http//www.
    w3.org/2001/XMLSchema" xmlnsxsi"http//www.w3.or
    g/2001/XMLSchema-instance" xmlnsSOAP-ENC"http//
    schemas.xmlsoap.org/soap/encoding/"gt
  • ltSOAP-ENVBody SOAP-ENVencodingStyle"http//sche
    mas.xmlsoap.org/soap/encoding/"gt
  • ltcc1getTemperatureResponse xmlnscc1"capeconnect
    AirportWeathercom.capeclear.weatherstation.Stati
    on"gt
  • ltreturn xsitype"xsdstring"gtThe Temperature at
    null is nulllt/returngtlt/cc1getTemperatureResponsegt
    lt/SOAP-ENVBodygtlt/SOAP-ENVEnvelopegt

12
Introducing Web Service and CF
  • CF through CFINVOKE makes working with Web
    Services as easy as CFQUERY made working with
    Relation Databases

13
WSDL
  • http//www.w3.org/TR/wsdl
  • WSDL is an XML format for describing network
    services as a set of endpoints operating on
    messages containing either document-oriented or
    procedure-oriented information. The operations
    and messages are described abstractly, and then
    bound to a concrete network protocol and message
    format to define an endpoint. Related concrete
    endpoints are combined into abstract endpoints
    (services). WSDL is extensible to allow
    description of endpoints and their messages
    regardless of what message formats or network
    protocols are used to communicate, however, the
    only bindings described in this document describe
    how to use WSDL in conjunction with SOAP 1.1,
    HTTP GET/POST, and MIME.

14
WSDL in layman's speak
  • Defines what a service does methods and
    operations
  • How a service is accessed details of data
    formats and protocols necessary to services
    operations
  • Where a service is located details of the
    protocol-specific network address, such as a
    URI/URL

15
WSDL in Specific
  • portType- abstract interface definition like a
    java interface definition
  • Message- Defines the set of parameters referred
    to by method sigs or operations
  • Types Data type defs
  • Binding contains details on how abstract
    interface is converted to literal representation
    (I.e. SOAP over HTTP)
  • Port specifies actual service node endpoint
    (I.e. your http url)
  • Service bad name. Actual a series or list of
    ports which you can think of as a collection of
    web services that model a complex business process

16
Data Mappings
17
ColdFusion Components (CFC)
  • ltcfcomponentgt
  • ltcffunction name"square" returnType"string"
    access"remote"gt
  • ltcfargument name"num1" type"string"gt
  • ltcfset sum arguments.num1arguments.num1gt
  • ltcfreturn sumgt
  • lt/cffunctiongt
  • lt/cfcomponentgt

18
Invocation
  • ltcfinvoke
  • webservice "URLtoWSDL"
  • method "operationName"
  • inputParam1 "val1"
  • inputParam2 "val2" ...
  • returnVariable "varName" gt

19
WSDL what we care abouthttp//localhost8500/xm
l/webservice/square.cfc?wsdl
  • ltwsdlmessage name"squareResponse"gt
  • ltwsdlpart name"return" type"SOAP-ENCstring"
    /gt
  • lt/wsdlmessagegt
  • ltwsdlmessage name"squareRequest"gt
  • ltwsdlpart name"num1" type"SOAP-ENCstring"
    /gt
  • lt/wsdlmessagegt

20
Calling Square
  • ltcfinvoke webservice"http//localhost8500/xml/we
    bservice/square.cfc?wsdl"
  • method"square"
  • num1"5"
  • returnVariable"var1"gt
  • lt/cfinvokegt
  • ltcfdump var"var1"gt

21
Same thing with CFSCRIPT
  • ltcfscriptgt
  • ws CreateObject("webservice",
  • "http//localhost8500/xml/webservice/square.cfc
    ?wsdl")
  • resultVar ws.getSquare(num15")
  • writeoutput(var1)
  • lt/cfscriptgt

22
Consuming Web Services
  • Read the WSDL file
  • Get Parameters and figure data types
  • Use a invocation method

23
CFC Metadata
24
Show Metadata
25
getProducts
  • ltcfcomponentgt
  • ltcffunction name"getProducts"
    returnType"query" access"remote" output "no"gt
  • ltcfargument name"ProductName" type"string"
    required"true"gt
  • ltcfquery name"prosearch" datasource"icf"
    dbtype"ODBC"gt
  • SELECT Product.ProductID, Product.ProductName,
    Product.ProductPricePerUnit, Product.VendorID
  • FROM Product
  • WHERE Product.ProductName LIKE 'arguments.Product
    Name'
  • lt/cfquerygt
  • ltcfreturn prosearchgt
  • lt/cffunctiongt
  • lt/cfcomponentgt

26
Complex Data
  • http//localhost8500/xml/webservice/productsearch
    .cfc?wsdl
  • CFC does not deal well with Queries and Structs
  • ltwsdlmessage name"getProductsResponse"gt
  • ltwsdlpart name"return" type"tns2QueryBean"
    /gt
  • lt/wsdlmessagegt
  • ltwsdlmessage name"getProductsRequest"gt
  • ltwsdlpart name"ProductName"
    type"SOAP-ENCstring" /gt
  • lt/wsdlmessagegt

27
Dealing with Complex Data
  1. Minimize the use of ColdFusion complex types,
    such as query and struct, in the web services you
    create for publication. These types require
    consumers, especially those consuming the web
    service using a technology other than ColdFusion,
    to create special data structures to handle
    complex types.

28
Complex Data
  • ltcfinvoke Webservice"http//localhost8100/xml/we
    bservice/productsearch.cfc?wsdl"
  • method"getProducts"
  • ProductName"ColdFusion"
  • returnVariable"products"gt
  • lt/cfinvokegt
  • ltcfdump var"products"gt

29
PROs of CFC Web Service
  • Simple to deploy
  • Simple to consume
  • Based on industry standard/accepted AXIS

30
CONS to CFCs Web Service
  • Inability to customize headers
  • Issues with complex data
  • Only supports SOAP encoding style
  • Only Supports HTTP
  • No UDDI

31
Alternatives
  • CFHTTP!!
  • CFOBJECT and MSXML
  • CFOBJECT and AXIS
  • CFX_API and AXIS
  • CFX,CFOBJECT, JSP SERVLET and other third party
    tools!

32
How SOAs relate to Web Services
  • service-oriented architectures are
  • loosely coupled pieces of application
    functionality
  • published
  • consumed
  • and combined with other applications over a
    network.
  • Web Services
  • stack of emerging standards
  • define protocols
  • create a loosely coupled framework for
    programmatic communication among disparate systems

33
SOAs
  • SOAs are not so much a radical and disruptive
    technology paradigm shift like procedural to OO
    but a natural evolution of best practices.

34
SOA
  • Loosely Coupled. Senders and receivers
    (producers and consumers) are abstractly
    decoupled from each other. Senders construct
    self-contained messages (including but not
    restricted to XML documents) and send them using
    a standards-based communication backbone without
    knowing the actual location of the receiver. The
    communication mechanism is responsible for the
    abstraction between the sender and the receiver.
  • Coarse Grained. Traditional object-based
    languages like Java expose their interfaces on a
    fine-grained, method basis. These fine-grained
    interfaces need to be aggregated into larger,
    coarse-grained services that closely resemble
    real business processes. Service technologies are
    designed to support the ability to assemble
    services into larger, more business suitable
    processes.
  • Asynchronous. Asynchronous communication is
    essential for distributed architectures. Senders
    and receivers cannot always depend on the
    availability of each other to do their work.
    Through a system of intermediaries, messages are
    exchanged in real-time with high performance.
    Yet, when receivers are unavailable, the messages
    can be persisted for later

35
SOA
  • STANDARS BASED The connections are based upon
    vendor-independent standards. The development of
    generally open and accepted standards is a key
    strength of the coalitions that have been
    building web services infrastructure. Most
    previous efforts at distributed computing (e.g.,
    CORBA, DCOM, RMI, and others) were very difficult
    to implement, because they were dependent upon a
    particular vendors product offering, highly
    specified, or programmatically complexusually
    all of the above.
  • PROCESS CENTRIC Systems are conceived from a
    process-centric perspective. By intent, services
    are designed with a task-orientation they
    function as discrete steps in a larger workflow
    or business process. A well designed service
    describes its inputs and outputs in a way that
    other software can determine what it does, how to
    invoke its functionality, and what result to
    expect in return.

36
Why SOAs
  • Frankly its the best application architecture
    approach for large and distributed architectures.
  • More flexibility and more generic
  • Interoperability is predefined and key which
    leads to greater ROI, longer life cycles, greater
    usability
  • Makes more sense to real people ?
  • Creates new opportunities for business, revenue,
    creativity, and over all usefulness

37
Distributed Process
38
Break Down of Process
39
SOA with CF
  • Define at a high level of a process and then
    service
  • Create a open interface via CFC to other
    components, templates, tags
  • You can use getMetaData() to create automated
    apps and easily discoverable services

40
Change the way you think!
  • SOAs require you stop thinking about units of
    functionality, components, technology but force
    you to focus on what's important! Figuring out
    what you need to do and how to model it!

41
Implementations Today
  • Re-Use and Syndication. Software re-use has
    always been a key part of component-based
    software models, but it rarely has been practical
    to implement. Web services may be different. Some
    early adopters envision syndicating existing
    software systems (e.g., an investment banks
    derivatives calculator or other complex
    algorithms) to partners and customers. Other
    re-use ideas include leveraging the
    standards-based interoperability to deliver data
    to a variety of formats and devices(e.g., web
    browsers, mobile devices, and interactive
    television).
  • Automation and Productivity. Disparate systems
    still result in a remarkable amount of manual
    integration processes. As a result, web services
    interoperability promise to yield tremendous
    opportunities for productivity improvements
    through automation of business processes and
    employee productivity. Example projects might
    include exposing order status tracking and past
    purchase history to customers. Automation
    initiatives could yield results similar to the
    so-called ATM Effect, which has helped
    significantly simplify the cost structure and
    increase the profitability of retail banking.

42
More Implementations
  • Visibility into Operations. Businesses
    consistently seek to improve the accuracy of
    their inventory and revenue forecasts but are
    constrained by a lack of clear visibility into
    operating data. Web services based digital
    dashboards are one way adopters hope to address
    this challenge. Several specific categories of
    information that are hot-button issues include
    demand forecasting throughout the supply-chain,
    real-time cash flow and operating capital, and
    production and inventory availability.Bottom-line,
    better visibility will yield a dramatic impact
    on a companys cost structure.
  • Exploring New Business Models. Most companies
    evaluating web services today are focused
    squarely on efficiencies and tend to put new web
    services-based revenue opportunities into
    asometime in the future bucket. A few early
    adopters are exploring new subscription or
    pay-peruse business models, however. Further down
    the road, companies may spin off non-strategic
    (but potentially valuable) web service
    competencies, just as many tangible assets were
    unlocked at an increased value as stand-alone
    entities over the past ten years.

43
The Future
  • Support for new protocols
  • Greater interoperability
  • Support for complex data types
  • Support for emerging standards
  • Exposure of the engine
  • Orchestration

44
Summary
  • Super easy to consume and deploy
  • Supports emerging standards
  • Has issues with complex data, different encoding,
    as well as protocols
  • You have lots of options
  • Web Services and SOAs are moving targets and
    paradigms and we will see change and growth in
    this space for several years

45
Resources
  • W3c.org
  • www.macromedia.com
  • Alphaworks.ibm.com
  • www.xml.com
  • www.webservices.org
  • www.xmethods.net
  • Uddi.org
Write a Comment
User Comments (0)
About PowerShow.com