Contemporary SOA, Part I - PowerPoint PPT Presentation

1 / 22
About This Presentation
Title:

Contemporary SOA, Part I

Description:

windows root directory%Microsoft.NETFramework%version of the .NET Framework ... Name property, names the variable that lets you access UI widgets from code ... – PowerPoint PPT presentation

Number of Views:183
Avg rating:3.0/5.0
Slides: 23
Provided by: Thom315
Category:

less

Transcript and Presenter's Notes

Title: Contemporary SOA, Part I


1
Contemporary SOA, Part I
  • 605.702 Service Oriented ArchitectureJohns-Hopkin
    s University
  • Montgomery County Center, Spring 2008
  • Session 3 February 13, 2008
  • Instructor T. Pole

2
Session 3 Agenda
  • Required Reading for This Week
  • Chap 5, sections 5.22, 5.3 5.4
  • Chap 6 Web Services and Contemporary SOA, part I
  • Todays Presentation
  • Todays Lecture
  • In Class Case Study Sharing the Load (STL)
  • Assignments
  • Review Ex 1
  • Assign Ex 2

3
Lecture from Text
  • Chapter 5 continued
  • 5.3 WSDL
  • 5.4 SOAP Messaging
  • Chapter 6 Contemporary SOA Part I
  • 6.1 Message Exchange Patterns
  • 6.2 Service Activity
  • 6.3 Coordination
  • 6.4 Atomic Transactions
  • 6.5 Business Activities

4
5.2.2 Service Models
  • Models of services different models that
    services can assume
  • Business Service Model
  • Automates, implements or represents business
    tasks or entities
  • Utility Service Model
  • Not a business service or controller service
  • Controller Service Model
  • Controls other services to perform a greater task

5
5.3 Service Descriptions with WSDL
  • Required by Ultimate Receivers
  • Which are always service providers
  • Service endpoints
  • Provides formal definition of the interface
  • Also defines the physical location of the service
  • WSDL Definition
  • Abstract and description components
  • Metadata and service contracts
  • WSDL, XSD and policies
  • Semantic Descriptions
  • Advertising and discovery

6
5.4 Messaging with SOAP
  • Soap Message Envelope contains the header and
    the body
  • Intelligent and self-sufficient
  • Header Blocks
  • Additional custom instruction on how to process
    SOAP messages, basis of WS- extensions
  • Message Styles RPC and Document styles
  • Message Paths - route taken by path

7
6.1 Message Exchange Patterns (MEPs)
  • How services can share and cooperate in
    processing messages
  • Primitive MEPs
  • Request response
  • Fire and forget
  • Single destination, multi-cast or broadcast
  • Complex MEPs
  • Based on Primitive MEPs
  • Example Publish and subscribe
  • WSDL MEPs
  • Request-response, solicit-response, one-way,
    notification

8
6.2 Service Activity
  • Interaction of group of services to complete a
    task
  • Sort of a MEP plus the pattern of messages
    exchanged to perform a specific task
  • One MEP can perform multiple tasks
  • Primitive activity Simple MEP
  • Complex Activity Multiple MEPs or a large
    complex MEP

9
6.3 Coordination
  • Coordination establishes a framework for complex
    activities to be managed and distributed to
    activity participants
  • Can be extended to the concepts of choreography
    and orchestration
  • Usually requires context state (infomration about
    the state of the complex activity) to be
    retained

10
6.4 Atomic Transaction
  • WAKE UP this section is complicated, boring and
    important
  • ACID
  • Atomic - All or nothing, you cant do part of a
    transaction
  • Consistent system data models must remain so
  • Isolated transactions cant interfere with each
    other
  • Durable Changes made by a transaction can
    survive subsequent system failures

11
Review Exercise 1
  • Build an ASP .Net Web Service (service provider)
  • Build a client (proper name is service consumer)
    to your service
  • Setting up IIS Web and SOAP Server
  • IIS and ASP.Net setup tips
  • Requirements for Exercise 1

12
Review Exercise 1 Build an ASP.Net Web
Service 1 of 2
  • Start VS 2005
  • File -gt New -gt Web Site
  • Choose ASP .Net Web Service template
  • Type in a new path for the web service on your
    local machine
  • Location HTTP
  • http//localhost/whatever name you like
  • Language Select C
  • Click OK
  • Click Solution Explorer tab (left side of screen)

13
Review Exercise 1Build an ASP.Net Web Service
2 of 2
  • Select in explorer window
  • http//localhost/whatever
  • App Code
  • Service.cs
  • Locate the web service that implements
    HelloWorld()
  • Change the text output string to something
    interesting
  • Select from menu Build -gt Rebuild Solution
  • At bottom of screen notice the build log entries
  • Should see Build 1 succeeded .
  • Run in debug mode Menu Debug -gt Start Debugging
  • Add a new web.config file option, say yes
  • Click on HelloWorld link
  • Click on Invoke button

14
Review Exercise 1Build a Client 1 of 2
  • Another new project File -gt New -gt Project -gt C
    Projects folder -gt Windows Application
  • Pick a good project name
  • Select in explorer windows, left of screen,
    Client_name\References with mouse right add web
    reference
  • Browse to Web Services in this solution
  • Select the Web Service you build
  • Add something to the Web reference name field
  • Click add reference
  • Explorer browse to Client_name\

15
Review Exercise 1 Build a Client 2 of 2
  • Add a button and a textbox to Form1 by drag and
    dropping them from the Toolbox palette
  • Click on the textbox and change its name to
    something meaningful
  • Double click on the button opens the code to
    the event handler on the button
  • Enter the code
  • localhost_4b.Service Service new
    localhost_4b.Service()
  • string Response
  • Response Service.HelloWorld()
  • ResponseTB.Text Response
  • In solution explorer click right on client
    project and click Set as start up project
  • Menu Build -gt Rebuild Solution
  • Menu Debug -gt Start Debugging

16
Review Exercise 1 Setting Up Windows XP IIS
Server
  • IIS is an optional install on Windows XP Pro
  • Control Panel-gtAdd/Remove programs-gtAdd/Remove
    Windows Components-gtSelect Internet Information
    Services (IIS)-gtNext, Finish
  • Select the Front Page 2000 Extensions option
  • http//localhost

17
Review Exercise 1 IIS and ASP.Net Setup Tips
  • I've installed the .NET Framework, but ASP.NET
    doesn't seem to work. What can I do to fix it?
  • You must have IIS (Internet Information Services)
    installed before you install the .NET Framework.
  • If you install IIS after you install the .NET
    Framework, you must also register the ASP.NET
    extensions with IIS.
  • You can do this by running the aspnet_regiis
    executable from
  • windows root directory\Microsoft.NET\Framework\
    version of the .NET Framework\aspnet_regiis -r
  • where windows root directory is the directory
    Windows is installed to (typically c\windows or
    c\winnt)
  • and version of the .NET Framework is the
    version of the .NET Framework you have installed.
  • The directory for .NET 1.0 is v1.0.3705, for 1.1
    is v1.1.4322, and for 2.0 is v2.0.50727

18
Review Exercise 1Requirements Your First .Net
SOAP Based Web Service
  • Create a Web Site with a Web Service using C and
    VS 2005
  • The Web Site will be names WS_01_your two
    initialsnumber 1..9
  • Your initials, first and last name
  • Number 1 through 9 in case you share the same
    initials with another student in class
  • The operation will be named My_creators_name_is
  • It will return a string with your name in it.
  • Create a desktop C client to invoke the web
    service, and display its results
  • Submit the complete folder contents that contain
    your projects
  • Select the Solution (top item) in solution
    explorer
  • Go to menu Project -gt Properties
  • Will display the location of all your (two)
    projects files location.
  • Copy them to a common root folder if they dont
    already have one, and sip the folder, email it to
    me prof_at_Hisdomain.net

19
Exercise 2 Requirements
  • Create a Web Site with a Web Service using C and
    VS 2005
  • The Web Site will be names WS_02_your two
    initialsnumber 1..9
  • Your initials, first and last name
  • Number 1 through 9 in case you share the same
    initials with another student in class (lets
    check this NOW)
  • The operation will be named CombineParameters
  • It will take two inputs (parameters) and return a
    value
  • Inputs a string named Sentence and an integer
    named Number
  • Returns a string You sent the number insert
    Number here and the sentence insert Sentence
    here.
  • Create a desktop C client to invoke the web
    services operation, and display its results
  • Submit the complete folder contents that contain
    your projects
  • Select the Solution (top item) in solution
    explorer
  • Go to menu Project -gt Properties
  • Will display the location of all your (two)
    projects files location.
  • Copy them to a common root folder if they dont
    already have one, and zip the folder, and email
    it to me prof_at_Hisdomain.net
  • Also print out the two C files, one from each
    project,and hand them in

20
Exercise 2 GUI Creation Tips
  • Use the property window
  • Use the Button, Label, and TextBox UI widgets
  • Name property, names the variable that lets you
    access UI widgets from code
  • Multiline, true or false says whether multiple
    lines of wrapping text can be used in TextBox
  • Text property, is value in the TextBox
  • Double click the button to create and edit event
    handler for that button
  • Converting string to integer
  • int System.Convert.ToInt16( string )

21
Exercise 2 Sample Code Service
  • WebMethod
  • public string CombineParameters(string Sentence,
    int Number)
  • string ReturnValue
  • ReturnValue "You sent the number "
  • Number.ToString()
  • " and the sentence "
  • Sentence
  • ."
  • // note single quotes used as double quotes
  • return ReturnValue

22
Exercise 2 Sample Code Consumer
  • private void button1_Click(object sender,
    EventArgs e)
  • localhost.Service Service new
    Ex2_S08_Service1_Consumer
    .localhost.Service()
  • string ReturnValue ""
  • string Sentence SentenceTB.Text
  • int Number Convert.ToInt16(
    NumberTB.Text )
  • ReturnValue
  • Service.CombineParameters(Sentence
    , Number)
  • ResultsTB.Text ReturnValue
Write a Comment
User Comments (0)
About PowerShow.com