introduction of webservices

18
Web Services Introduction and Testing Khasimsaheb

Upload: khasim-saheb

Post on 22-Jan-2018

312 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Introduction of WebServices

Web ServicesIntroduction and Testing

Khasimsaheb

Page 2: Introduction of WebServices

2

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.

Page 3: Introduction of WebServices

3

Web Service Architecture

Page 4: Introduction of WebServices

4

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

Page 5: Introduction of WebServices

5

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 the Web 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 using open 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 a way to link their data.

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

Page 6: Introduction of WebServices

6

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)

Page 7: Introduction of WebServices

7

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

Page 8: Introduction of WebServices

8

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

Page 9: Introduction of WebServices

9

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.

Page 10: Introduction of WebServices

10

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.

Page 11: Introduction of WebServices

11

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).

Page 12: Introduction of WebServices

12

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)

Page 13: Introduction of WebServices

13

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”

Page 14: Introduction of WebServices

14

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”

Page 15: Introduction of WebServices

15

Create webtest - ESRB_WS.webtest

Page 16: Introduction of WebServices

16

Test Cases

Page 17: Introduction of WebServices

17

Result after run

Page 18: Introduction of WebServices

18

Altova XML, Data Management, and Web service tools

The Altova MissionKit is an integrated suite of XML, database tools designed to meet the diverse development and data management needs of today’s software architects and XML developers.XMLSpy® 2009 is the industry's best selling XML development environment. It offers the top XML editor, schema designer, code generator, 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