webservices basic introduction

18
Web Services

Upload: shahid-shaik

Post on 21-Jan-2018

172 views

Category:

Technology


0 download

TRANSCRIPT

Web Services

Introduction to Web Services

Today, companies rely on thousands of different software

applications each with their own role to play in running a business.

These different software applications run on a wide range of different

platforms and operating systems, and they are implemented in

different programming languages. As a result, it is very difficult for

different applications to communicate with one another and share

their resources in a coordinated way.

2

Web Service Architecture3

What are Web Services?

Web services are application components

Web services communicate using open protocols

Web services are self-contained and self-describing

Web services can be used by other applications

XML is the basis for Web services

4

Why Web Services?

Interoperability has highest priority. When all major platforms could access the Web using Web browsers, different platforms

could interact. For these platforms to work together, Web applications were developed.

Web applications are simple applications run on the web. These are built around theWeb browser standards and can mostly be used by any browser on any platform.

Web services take Web applications to the next level. Using Web services your application can publish its function or message to the rest of

the world.

Web services uses XML to code and decode your data and SOAP to transport it usingopen protocols.

Web services have two types of uses.

Reusable application components. Ideally, there will only be one type of each application component, and anyone can use it in their application.

Connect existing software

Web services help solve the interoperability problem by giving different applications away to link their data.

Using Web services you can exchange data between different applications and different platforms.

5

The base of WS

◦ The basic Web services platform is XML + HTTP.

◦ The HTTP protocol is the most used Internet protocol.

◦ XML provides a language which can be used between different platforms and programming languages and still express complex messages and functions.

Web services platform elements

SOAP (Simple Object Access Protocol)

WSDL (Web Services Description Language)

6

What is SOAP?

The basic Web services platform is XML plus HTTP.

SOAP stands for Simple Object Access Protocol

SOAP is a communication protocol

SOAP is for communication between applications

SOAP is a format for sending messages

SOAP is designed to communicate via Internet

SOAP is platform independent

SOAP is language independent

SOAP is based on XML

SOAP is simple and extensible

SOAP allows you to get around firewalls

SOAP will be developed as a W3C standard 7

What is WSDL?WSDL is an XML-based language for describing Web services and

how to access them.

WSDL stands for Web Services Description Language

WSDL is written in XML

WSDL is an XML document

WSDL is used to describe Web services

WSDL is also used to locate Web services

WSDL is not yet a W3C standard

8

How to test a web service?

As a web service is something that has no user interface, we

can’t interact with it without a special tool. That tool should allow

composing XML requests via its own user interface. Commonly

such user interfaces are text editors where you write your XML

requests and controls for posting requests to the server.

9

How to test a web service?

Project structure. As in every well-established testing activity, I’ve

started with test specification. The main part of a test specification is

test cases divided into test areas. Visual Studio allows structuring

your test project into test suites (the same as test areas in my test

specification) that contain test cases, which can contain test steps,

you can add, modify, delete and change order of every item in the

structure.

Test cases. Visual Sdudio provides enough convenient tools to

manage and run your test cases, and view result in test requests.

Load Testing. You can perform Load Testing.

10

How to test a web service?

Automation. But what if your web service contains too many

methods with too many input and output parameters? It may take

several days for each complete test of your web service if your tool

does not provide functionality to automate your testing. You can

automate validation of your web service’s response against you

input. You can automate the output of validation results into a file

(which could be just a text file of HTML depending on your choice).

11

Example: ESRB Rating System Search Widget. Project Description

ESRB requires functionality to query their database to generate search results for a third party web widget.

Netsoft shall be responsible for the developing a web service to generate result sets in response to queries from the Clear Spring widget. The widget shall make requests for rated games by specifying a keyword. The work performed by Netsoft USA shall encompass the following items:

• Define the interface for the calls to be made by the widget

• Define the result set format (XML) to be provided in response to widget calls

• Provide a mechanism by which the number of results returned can be attenuated (limit the number of rows)

12

Scope

URL (subject to change) http://esrb.org/SearchWidget/services/Search?wsdl (no https requested)

Parameters

◦ searchKeyword

Text to search

◦ maxResultCount

Maximum number of records to return (e.g. 50 records)

◦ user (subject to change)

“ESRB_test”

◦ pass (subject to change)

“ESRB_test”

13

Scope

Return fields

◦ Certificate

Game certificate number (5 digits)

◦ Title

Game title (like ‘%[search text]%’ search condition against the game title and sorted by Rating Release Date)

◦ Rating

Game rating (short text format), e.g. “E,” “E10+,” “T,” etc.

◦ Platforms

Comma delimited list of platforms, e.g. “Xbox, Xbox 360, Playstation 3”

◦ Descriptors

Comma delimited list of content descriptors, e.g. “Blood and Gore, Strong Language, Violence”

14

Create webtest -ESRB_WS.webtest

15

Test Cases

16

Result after run

17

Altova XML, Data Management, and Web service tools

18

The Altova MissionKit is an integrated suite of XML, database toolsdesigned to meet the diverse development and data managementneeds of today’s software architects and XML developers.XMLSpy® 2009 is the industry's best selling XML developmentenvironment. It offers the top XML editor, schema designer, codegenerator, file converters, debuggers, profilers, support for XSLT,XQuery, Office 2007/OOXML, XBRL, WSDL, SOAP, Visual Studio,Eclipse, & more.Link of a Flash demo of the SOAP client and SOAP debugger. http://www.altova.com/videos.asp?type=1&video=soap