You are on page 1of 25

SOA Concepts

605.702 Service Oriented Architecture Johns-Hopkins University Montgomery County Center, Spring 2009 Session 2: Lecture 2, February 4, 2009 Instructor: T. Pole

Session #2 Todays Agenda

Required Reading (to be read before class)


Erl Chapter 4: The Evolution of SOA Erl Chapter 5: Web Services and Primitive SOA

Todays Presentation Todays Lecture


Review Chapters 1, 2 (and finish 3) Introducing SOA (Ch 3) Evolution of SOA (Ch 4) Web Services and Primitive SOA (Ch 5) Content Management and the CMIS (additional material)

Setting up the environment


Visual Studio 2008 Windows XP preferred (Vista also works. May need specific version, with configuration)

Client Implementation with SOAP and .Net


Building the Client Referencing the Server Running the client

Assignments
Exercise 1 (due 2/11/2009) Building a Web Service Client

Review Last Week

Not a lecture, but an opportunity for you to ask questions Chapter 1: About the Book Chapter 2: About the Case Studies General Discussion

What is a Service? What is a Web Service? What is Service Oriented Architecture?

Ch 3 Introducing SOA

Section 3.1 Fundamental SOA

Services encapsulate logic within a distinct context

Context == business task or business entity or any logical grouping

Varied scales == a process step, set of steps or the entire process Services are related via relationships Services communicate via messages which are independent units of communication Service design promotes: loose coupling, contract driven composability, autonomy, discoverable stateless reusable components To this point we have described primitive SOA

Section 3.2: Defining SOA

Section 3.2 Common Characteristics of Contemporary SOA


See list of primary characteristics, page 40-41 3.2.20 Defining SOA page 54

Section 3.3 SOA Misperceptions

3.3.1 thru 3.3.3: Major Misperception #1: SOA is NOT really something new NOT Some validity, but the combination of Old ideas, as well as some new ideas synthesizes a new approach: th whole is greater then the sum of its parts. 3.3.4: SOA Simplifies: NOT The point is not to simplify the solution to the problem, but to simplify performing individual steps in solving he problems, and in the integration of those resultant steps into the complete solution. 3.3.5 thru 3.3.6: SOA is Web Services, or WS with some extensionsNOT Those are just technologies used to implement SOA 3.3.7 SOA makes everything interoperable NOT If you design and build an SOA system properly, its pieces are interoperable with similar good SOA systems

Section 3.4 SOA Benefits and the start of a Business Case for SOA

3.4.1 thru 3.4.3: Component Based Software Engineering benefits:

Integration of components, reuse of components, streamlined architecting of components into solutions. Business Case is reduction of effort, solving multiple problems with single work products. Retaining and (optionally) controlling the evolutionary replacement of legacy systems Business Case is extending usable life of past investments

3.4.4 Leveraging the Legacy Systems

Section 3.5 Common Pitfalls in Adopting SOA

Designing an SOA as though it were a traditional distributed architecture

Question: What kinds of systems should not be designed as SOA? What problem is it that XML solves? What does SOA change in designing for Performance requirements? What does SOA change in designing for Security requirements?

Not having an XML foundation

Not understanding SOA Performance and Security

Chapter 4: The Evolution of SOA


Section 4.1 An SOA Timeline XML Initially a publishing tool Then a data format tool Now a service oriented version of a remote procedure call protocol Web Services Initially port 80 tunnelling Initially Simple Object Access Protocol Now (with WS-*) much more complex

Security Dependable delivery Orchestration

SOA Forced evolution of XML and Web Services

Section 4.2: Continuing Evolution of SOA

Standards, Specifications, and Extensions Standards Organizations Vendors


Distributed Tool and System Vendors Forward Thinking, Imaginative Vendors

Not a good thing, notice the quotation marks above

Section 4.3: Roots of SOA

A distributed integration/communication protocol Can be synchronous or asynchronous

HTTP basis of most SOAP implementations forces some call and response behavior

Can be used to wrap non Service Oriented components, integrating their functionality in to an SOA

Chapter 5 Web Services and Primitive SOA

Section 5.1 Web Services Framework

Services exposed through a Web Server, usually via SOAP (sometimes other protocols such as REST) that may or may not be service oriented SOAP WSDL UDDI

Primitive SOA (simplistic definition)


Section 5.2 Service Descriptions: Roles and Models

Business Service Model

Encapsulate operations related to this business processes Encapsulates operations related to infrastructure, basic system engineering functions Controls multiple services for a high level, more complex, larger scope task

Utility Service Model

Controller Service Model

Section 5.3 Service Descriptions

WSDL

Describes a service What operations does it publish Programmatic interface specification level of description Supports export of common data types as well

Section 5.4 Messaging with SOAP

Types of Service Nodes

Soap Sender

Initiates a communication between two nodes (services)

Initial Sender in a serial chain of SOAP message exchanges, the first node in the change

Soap Receiver

Received the SOAP envelope

Ultimate Receiver in a serial chain of SOAP message exchanges, the node that only responds, it does not send another message on to another node

SOAP Intermediary

Receives a SOAP message and passes on a SOAP message

Active Intermediary Can change the SOAP message before passing it on

Implementing Web Services

We will have an in class tutorial tonight on developing web services on XP Pro, IIS, and Visual Studio. You can build and test Web Services without IIS. But for other computers to reach those web services, a SOAP enabled Web Server, sometimes (erroneously) called a SOAP Application Server, IIS must be used to deploy them. This will help you get started by getting, VS 2008 and the .Net framework up and running and being able to build a client for a basic Web Service using C#.

How to: Setup Visual Studio 2008 Pro

Register with Microsoft DreamSpark


www.dreamspark.com https://www.dreamspark.com/FAQ/Students.aspx#universit yStudentVerification Download:https://www.dreamspark.com/Products/product.a spx?productid=1

Download Visual Studio 2008

Get Key: at bottom of page

System_Requirements:http://www.microsoft.com/visualstud io/en-us/products/professional/default.mspx Select max install you have disk space for Select .Net 3.5, install MSDN documentation SQL Server and ther tools are optional

Fairly simple installation procedure


Any additional questions, email me.

How to Build a Windows Console Application 1 of 3

Start Visual Studio (VS 2008) File -> New -> Project Choose the Console Application template Type in a path to where you will store the files for this application Be sure the Project Type tab is C# Enter a name in the project Name textbox, and optionally the same or different name in the Solution Name Click OK

How to Build a Windows Console Application 2 of 3

The Solution Explorer Window shows

Files, settings, etc.

There is a file named Program.cs. Which is the source file for this project Select with right mouse button in explorer windows, left of screen

add service reference At bottom of Service References Settings click Add Web Reference

Click Advanced button

Build a Web Service Client 3 of 3

In URL enter http:areopagussoa.net/TP_Sample01_SimpleWebServer/Se rvice.asmx Enter meaningful name in Web Reference Name textbox, e.g. SimpleWebService

This is the namespace for the reference to the web service

Click Add Reference button

20

Code Sample for Client


string FirstName, LastName; Console.Out.WriteLine( "Enter first name:" ); FirstName = Console.In.ReadLine(); Console.Out.WriteLine( "Enter last name:" ); LastName = Console.In.ReadLine(); Console.Out.WriteLine("Creating proxy for web service."); SimpleWebService.Service Server = new testapp_020209.SimpleWebServer.Service(); Console.Out.WriteLine("Invoking opertion"); string Result = Server.SaveMyName(FirstName, LastName); Console.Out.WriteLine("Result is " + Result); Console.Out.WriteLine("Enter to exit"); Console.In.ReadLine();

Build and Debug/Run the Client

Menu: Build -> Rebuild Solution Menu: Debug -> Start Debugging

How To: Setting Up Windows XP IIS Server

IIS is an optional install on Windows XP Pro

Control Panel->Add/Remove programs ->Add/Remove Windows Components-> Select Internet Information Services (IIS) ->Next, Finish Select the Front Page 2000 Extensions option http://localhost

FAQ (.Net Web Service Development)

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

Exercise 1: Build a Client for the Simple Web Service

The Web Service is at: Build a simple client that can invoke the operation: SaveMyName Use the WSDL to read the interface

Areopagus-soa.net/TP_Sample01_SImpleWebServer/Service.asmx

Areopagus-soa.net/TP_Sample01_SImpleWebServer/Service.asmx?wsdl

Also available from the generated C# code after you add a reference to the Web Service Email me the executable and the source file Program.cs

Due next week

In the bin/debug folder