web services soap notes

8
Web Services BOA West Region Cloud – Data Resources Web Apps Cloud Apps BOA East Region Web Services are based on XML. From UI we cannot understand the difference between web application and web services. Orbit 2 WSDL1 Travelocity WSDL 2 Web Service Provider 2 | _ _ _ _ _ _ _ _ _ _ _ _ _ _ | | | | | | | Broker | Publish ed WSDL 1 Publish ed WSDL 2 UDDI UDDI – Registry having who provides what ticket. | | Request and Response (Two way communication) | | | Web Service Provide r 1

Upload: sunil-kumar-gunasekaran

Post on 15-Jan-2015

409 views

Category:

Education


0 download

DESCRIPTION

Web Services SOAP Notes. Important key words and architecture

TRANSCRIPT

Page 1: Web services SOAP Notes

Web Services

BOA West Region

Cloud – Data Resources Web Apps Cloud Apps

BOA East Region

Web Services are based on XML.From UI we cannot understand the difference between web application and web services.

Orbit 2 WSDL1

Travelocity WSDL 2 Web Service Provider 2

| _ _ _ _ _ _ _ _ _ _ _ _ _ _ || || || |Broker |Published WSDL 1

Published WSDL 2

UDDIUDDI – Registry having who provides what ticket.||Request and Response (Two way communication)|||Web Services Consumer / Client App

www.kayak.com

SOAP – Simple Object access protocol

UDDI – Universal Description Discovery Integration It’s a company.

Web Service Provider 1

Page 2: Web services SOAP Notes

Orbits and Travelocity developers create WSDL and publish to UDDI. I.e. giving the access rights for taking the service

Request and Response done using protocol known as SOAP XML based request and SOAP XML based response.

WSDL – Web Services Definition Language; WSDL constructed using XML and Java by developer.

Difference between HTTP and SOAP

Special wrappers for transferring web services data (XML) over the internet.

SOAP messages are not easily blocked by the firewall.

The whole architecture is called as Service Oriented Architecture

Components of SOAWSDL Web Service Provider Web Service Consumer UDDISOAP Protocol

Example of Web Services Technology – Web ServicesArchitecture – SOA Google Docs DropBox

XML vs HTML HTML is presentation language – Static For transferring data into to web – DynamicXML – allows dynamic content to be transferred.XML allows custom tags but HTML has only pre-defined tags.

WSDL is a xml file with extension .wsdl

Page 3: Web services SOAP Notes

WSDL containsMessages (operations)Bindings Service end points –Where actual services are deployed; Server is deployed Port E.g.1 MathService – Add and Subtract. E.g.2 Airline reservation system – operations are getTicketInfo getAirlineDetails etc.E.g.3 TransferMoney – RegisterTransMoneyServ, TransferWithinBank, TransferOutisdeBank

Questions on Web Services messagesCheck the websites of the projects and find the custom messages.Test cases – 300100 to 110 for each messageE.g. of BOA transfer money service;

SOAP message structure looks like –

EnvelopeHeader

BodyMessage

Request <envelope> <header> </header> <body> <message> </message> </body></envelope>

Fault

Page 4: Web services SOAP Notes

Response<envelope> <header> </header> <body> <fault> </fault> </body></envelope>Framework used – Spring

Types of Web Services 1) SOAP based web services. More popular.2) RESTful Web Services. – Using HTTP protocol. 3) JMS Web Services.

HTTP – Messages – POST GET DELETE and PUTRepresentational State Transfer

XML Doc Well Formed XML Doc - Tags are missing.Valid XML Doc

XML Schema XML Schema Doc – Tells the structure of XML document. Every XML document should confirm to a schema document.Extension of Schema - .xsd

NOTE - First validate the WSDL document using a Schema – Check whether Vaild or not. You will be provided a schema file provided. Manually or using tools.

XML Namespace Attribute – Property of element or tag. <price fontcolor=”Blue”>

BOA <xmlns: TransFunds =”https:\BOA\finServ\TransMoney”><CustomerInfo><CustID> </CustID><fromAcct> </fromAcct></CustomerInfo>

Page 5: Web services SOAP Notes

Chase <xmlns: TransFunds =”https:\Chase\trans\Service”><CustomerInfo><CustNbr> </CustNbr><fromAcct> </fromAcct></CustomerInfo>

Xmlns – Meaning of the tags are defined and the XML engine looks to the xmlns so that

Things asked in the interviewWhat is XML message? <?xml version=”1.0” encoding=”UTF-8”?>>Contains elements, nodes and tagsElements nested inside each other. Root node and child nodes.

What did you do in SOAP? Application was following SOAP Architecture Request and response message – Created lot of test cases based on different scenarios. Then I created a test suite based on these test cases. Finally I ran this test suite.

Java – How can I d osome coding – Java Collection API – List – ArrayList, LinkedList and VectorSets – TreeSet and HashsetWhat is JUnit?Test unit framework for performing unit tests and automation tests based on the test casesIt has annotations and methods like assert and verify.

What is XML? Xml has tags and data. It gives structure to the data. It has a container and nodes inside it. The element contains the corresponding data.

What are the three major role players?Service provider, Registry, Consumer are three major role players

What are three major operations? Publish, find and bind are major operations. Why web services? Web services are language independent. Interconnecting systems is easy.

Page 6: Web services SOAP Notes

Why XML in Web Service? Advantage of being independent of data position; Due to presence of tags; Positions of nodes can change within the container.Where is web service deployed? Web service is deployed in the web server. What is SOA? Service oriented architecture. Eg. Shopping Portal = get product catalog, get price for product, add to cart, payment gateway; Create a platform and make the operations/functions independent so that third party vendors can build their application on top of the base. Social Websites and Salesforce platform is extensible due to SOA;

What is in the messages? XML contains tags and data SOAP contains an envelop, header and body.WSDL contains data types, messages and service ports. UDDI = Yellow pages, public information = Common information. Universal business registries.

What is need of Service Oriented Architecture?If you make interfaces generic. Then third party can add services in the interface – Eg. Shopping cart. E.g. Secured Paypal gateway, Secured Credit Card gateway;

Testing a web service is as simple as testing a form.

What did you do in Web Services Testing in previous project? In my previous project where I was handling web services like money transfer between banks; In this web services, I created test cases for the SOAP Requests and responses by inserting assertions and then testing them and created test suites and ran them. Request consists of envelope header body inside message and response consist of header body fault and message. Included various requests in a test suite and inserted assertions and then ran them and verified. Payment gateway.Other concepts o Web Services are = WSDL Service Provider like Paypal and service consumers lie the client applications and UDDI where the service provider publishes and provides the rights to access. The communication is done through SOAP protocol.I used SoapUI Pro 4.5.1

Page 7: Web services SOAP Notes