SlideShare una empresa de Scribd logo
1 de 40
Descargar para leer sin conexión
Introduction to Web Service 
Sagara Gunathunga 
( Apache web Service and Axis committer )
CONTENTS
Why you need 
Web Services 
?
How do you interact with on-line financial service?
Conclusion
How do you interact with on-line financial service? 
Bank-A 
Bank-B 
Bank-C
How do you interact with on-line financial service? 
Bank-A 
Bank-B 
Bank-C 
WS -A 
WS -B 
WS -C
Conclusion
What are Web services? 
• loosely coupled: - they can be changed independently 
• platform independent 
• contracted: in and output are publicly available 
• components: interface encapsulates the code 
• XML-based interfaces: - human readable 
• firewall friendly 
•self-describing (allows for discovery of their functionality)
Web Service Characteristics
Web Services Stack
Web Services Stack
Web Services Specification 
There are three basic specifications, forming the basis 
for state-of-the-art Web-Service technology
Simple Object Access Protocol (SOAP)
SOAP message structure
SOAP .. 
• SOAP originally stood for "Simple Object Access 
Protocol" . 
• Web Services expose useful functionality to Web users 
through a standard Web protocol called SOAP. 
• Soap is an XML vocabulary standard to enable programs 
on separate computers to interact across any network. 
SOAP is a simple markup language for describing 
messages between applications. 
• 
• Soap uses mainly HTTP as a transport protocol. That is, 
HTTP message contains a SOAP message as its 
payload section.
SOAP .. 
A SOAP message is an ordinary XML document 
containing the following elements: 
• A required Envelope element that identifies the XML 
document as a SOAP message. 
• An optional Header element that contains header 
information. 
• A required Body element that contains call and 
response information. 
• An optional Fault element that provides information 
about errors that occurred while processing the 
message.
SOAP over HTTP 
HTTP Headers 
<soap:Envelope> 
<soap:Header> 
XML… 
</soap:Header> 
<soap:Body> 
XML payload… 
</soap:Body> 
</soap:Envelope> 
SOAP Envelope 
Header 
Body 
Message Pay Load
Example - SOAP Request 
PPOOSSTT //IInnSSttoocckk HHTTTTPP//11..11 
HHoosstt:: wwwwww..ssttoocckk..oorrgg 
CCoonntteenntt--TTyyppee:: aapppplliiccaattiioonn//ssooaapp++xxmmll;; cchhaarrsseett==uuttff--88 CCoonntteenntt--LLeennggtthh:: 115500 
<<??xxmmll vveerrssiioonn==""11.00""??>> 
<<soap:Envelope 
xxmmllnnss::ssooaapp==""hhttttpp::////wwwwww.ww33.oorrgg//22000011//1122//ssooaapp--eennvveellooppee"" 
ssooaapp::eennccooddiinnggSSttyyllee==hhttttpp::////wwwwww.ww33.oorrgg//22000011//1122//ssooaapp--eennccooddiinngg””>> 
<<ssooaapp::BBooddyy xxmmllnnss::mm==""hhttttpp::////wwwwww.ssttoocckk.oorrgg//ssttoocckk"">> 
<<mm::GGeettSSttoocckkPPrriiccee>> 
<<mm::SSttoocckkNNaammee>>IIBBMM<<//mm::SSttoocckkNNaammee>> 
<<//mm::GGeettSSttoocckkPPrriiccee>> 
<<//ssooaapp::BBooddyy>> 
<<//ssooaapp::EEnnvveellooppee>>
SOAP Response 
HHTTTTPP//11..11 220000 OOKK 
CCoonntteenntt--TTyyppee:: aapppplliiccaattiioonn//ssooaapp;; cchhaarrsseett==uuttff--88 
CCoonntteenntt--LLeennggtthh:: 112266 
<<??xxmmll vveerrssiioonn==""11.00""??>> 
<<ssooaapp::EEnnvveellooppee xxmmllnnss::ssooaapp==""hhttttpp::////wwwwww.ww33.oorrgg//22000011//1122//ssooaapp-- 
eennvveellooppee"" ssooaapp::eennccooddiinnggSSttyyllee==""hhttttpp::////wwwwww.ww33.oorrgg//22000011//1122//ssooaapp-- 
eennccooddiinngg"">> 
<<ssooaapp::BBooddyy xxmmllnnss::mm==""hhttttpp::////wwwwww.ssttoocckk.oorrgg//ssttoocckk"">> 
<<mm::GGeettSSttoocckkPPrriicceeRReessppoonnssee>> 
<<mm::PPrriiccee>>3344..55<<//mm::PPrriiccee>> 
<<//mm::GGeettSSttoocckkPPrriicceeRReessppoonnssee>> 
<<//ssooaapp::BBooddyy>> 
<<//ssooaapp::EEnnvveellooppee>>
Web Services Description Language (WSDL) 
» WSDL stands for Web Services Description Language. 
» WSDL is an XML vocabulary for describing Web 
» services. It allows developers to describe Web Services and 
their capabilities, in a standard manner. 
» WSDL specifies what a request message must contain and 
what the response message will look like in unambiguous 
notation. In other words, it is a contract between the XML Web 
service and the client who wishes to use this service. 
» In addition to describing message contents, WSDL defines 
where the service is available and what communications 
protocol is used to talk to the service.
WSDL Structure 
» portType 
• Abstract definition of a 
service (set of operations) 
» Multiple bindings per 
portType: 
• How to access it 
• SOAP, JMS, direct call 
» Ports 
• Where to access it 
Service 
Port 
(e.g. http://host/svc) 
Binding 
(e.g. SOAP) 
portType 
Port 
Binding 
operation(s) 
inMesage outMessage 
Abstract interface
The WSDL Document Structure 
» A WSDL document is just a simple XML document. 
» It defines a web service using these major elements: 
• port type - The operations performed by the web service. 
• message - The messages used by the web service. 
• types - The data types used by the web service. 
• binding - The communication protocols used by the web 
service.
Example WSDL 
<?xml version="1.0" encoding="UTF-8"?> 
<wsdl:definitions> 
<wsdl:message name="execLocalCommandResponse"> 
<wsdl:message name="execLocalCommandRequest"> 
<wsdl:portType name="SJwsImp"> 
<wsdl:operation name="execLocalCommand" parameterOrder="in0"> 
<wsdl:input message="impl:execLocalCommandRequest" 
name="execLocalCommandRequest"/> 
<wsdl:output message="impl:execLocalCommandResponse" 
name="execLocalCommandResponse"/> 
</wsdl:operation> 
</wsdl:portType> 
<wsdl:binding name="SubmitjobSoapBinding" type="impl:SJwsImp"> 
<wsdlsoap:binding style="rpc" 
transport="http://schemas.xmlsoap.org/soap/http"/> 
<wsdl:operation name="execLocalCommand"> 
<wsdlsoap:operation soapAction=""/> 
<wsdl:input name="execLocalCommandRequest"> 
<wsdl:output name="execLocalCommandResponse"> 
</wsdl:operation> 
</wsdl:binding> 
<wsdl:service name="SJwsImpService"> 
<wsdl:port binding="impl:SubmitjobSoapBinding" name="Submitjob"> 
</wsdl:service> 
</wsdl:definitions>
Example: WSDL types for Custom Data 
Definition 
<wsdl:types> 
<schema targetNamespace="http://.../GCWS/services/Submitjob" 
xmlns:impl="http://.../GCWS/services/Submitjob" 
xmlns="http://www.w3.org/2001/XMLSchema"> 
<import namespace="http://schemas.xmlsoap.org/soap/encoding/" /> 
<complexType name="ArrayOf_xsd_string"> 
<complexContent> 
<restriction base="soapenc:Array"> 
<attribute ref="soapenc:arrayType" 
wsdl:arrayType="xsd:string[]" /> 
</restriction> 
</complexContent> 
</complexType> 
<element name="ArrayOf_xsd_string" nillable="true" 
type="impl:ArrayOf_xsd_string" /> 
</schema> 
</wsdl:types>
Example - message 
<wsdl:message 
name="execLocalCommandResponse"> 
<wsdl:part 
name="execLocalCommandReturn" 
type="impl:ArrayOf_xsd_string" /> 
</wsdl:message> 
<wsdl:message name="execLocalCommandRequest"> 
<wsdl:part name="in0" type="xsd:string" /> 
</wsdl:message>
WSDL - portTypes 
» portType elements map messages to 
operations. 
» You can think of portType==class, 
operation==class methods. 
» Operations can contain input, output, and/or fault 
bindings for messages. 
» An operation may support of the following 
message styles: 
• One-way: request only 
• Two-way: request/response 
• Solicit-response: server “push” and client response 
• Notification: one-way server push
<wsdl:portType name="SJwsImp"> 
<wsdl:operation name="execLocalCommand" 
parameterOrder="in0"> 
<wsdl:input 
message="impl:execLocalCommandRequest" 
name="execLocalCommandRequest" /> 
<wsdl:output 
message="impl:execLocalCommandResponse" 
name="execLocalCommandResponse" /> 
</wsdl:operation> 
</wsdl:portType>
Service and Port Definitions 
» So far, we have defined the class method interfaces 
(portTypes) and the rules for binding to a particular 
protocol. 
» Port elements define how the bindings (and thus the 
portTypes) are associated with a particular server. 
» The service element collects ports.
<wsdl:service name="SJwsImpService"> 
<wsdl:port 
binding="impl:SubmitjobSoapBinding" 
name="Submitjob"> 
<wsdlsoap:address 
location="http://.../GCWS/services/Submitjob" /> 
</wsdl:port> 
</wsdl:service>
PortType Bindings 
» portTypes are abstract interface definitions. 
• Don’t say anything about how to invoke a remote 
method. 
» Remote invocations are defined in binding 
elements. 
» Binding elements are really just place holders 
that are extended for specific protocols 
• WSDL spec provides SOAP, HTTP GET/POST, and 
MIME extension schema examples.
<wsdl:binding 
name="SubmitjobSoapBinding" type="impl:SJwsImp"> 
<wsdlsoap:binding style="rpc" 
transport="http://schemas.xmlsoap.org/soap/http" /> 
<wsdl:operation name="execLocalCommand“> 
<wsdlsoap:operation soapAction="" /> 
<wsdl:input name="execLocalCommandRequest"> 
<wsdlsoap:body 
encodingStyle=http://schemas.xmlsoap.org/soap/encoding/ 
namespace="http://.../GCWS/services/Submitjob" 
use="encoded" /> 
</wsdl:input> 
<wsdl:output name="execLocalCommandResponse"> 
<wsdlsoap:body 
encodingStyle=http://schemas.xmlsoap.org/soap/encoding/ 
namespace=http://.../GCWS/services/Submitjob 
use="encoded" /> 
</wsdl:output> 
</wsdl:operation> 
</wsdl:binding>
Web Service frameworks (Java)
Contract first WS development 
1. Start with existing WSDL document or writing a new WSDL 
document, all of the web service frameworks support for contact first 
web service development. 
2. Both Apache Axis2 and CXF provide ‘WSDL2Java” tool , that 
capable to generate source codes from WSDL contract. Spring -WS 
doesn't provide any code generation tool but supports for Contact first 
approach .
Contract first WS development with Axis2 
1. Use existing WSDL or write a simple WSDL using 
a XML editor or Eclipse WSDL editor. 
2. Generate java skeleton using “WSDL2JAVA” tool. 
3. Complete server side methods . 
4. Package as .AAR ( with the generated service.xml ) 
5. Deploy in to “services” directory of Axis2 
installation.
Code first WS development 
1. Start with existing codes , most of the time people use this approach 
when they want to expose existing business features as a web 
service. 
2. Most of the Web service framework supports for automatic WSDL 
generation from services. ( Axis2 , CXF) 
3. Users can utilize this automatic code generation feature or they can 
disable this feature to assign existing WSDL file.
Code first WS development with Axis2 
Optionally you can write a interface too, specially with 
Spring, Hibernate and AOP related services. 
Service .xml - is a Axis2 specific service description file that contains important 
meta data about the service such as service class , service interface , message 
receivers etc.
WS client development with Axis2 
Once you have a service description for a service you can generate WS 
client code using a tools like “WSDL2JAVA” , the generated code contain 
the required logic to serialize messages, service location , QoS attributes 
etc.
References 
• This slide and source codes for samples. 
•http://people.apache.org/~sagara/ws/intro10 
•http://ws.apache.org/axis2/ 
•http://wso2.org/library/95 
•http://www.developer.com/services/article.php/3613896/Writing-an-• http://wso2.org/library/2873
Thank You 
Aeturnum Lanka (Pvt) Ltd 
1 9 7 , S t a n le y T h ila k a r a t n a M w , N u g e g o d a 1 0 2 5 0 , S r i 
L a n k a 
Phone: + 9 4 1 1 5 5 1 8 1 7 7 | Email: 
in f o @ a e t u r n u m .c o m 
Web: w w w .a e t u r n u m .c o m | w w w .a t h iv a .c o m

Más contenido relacionado

La actualidad más candente

SOAP--Simple Object Access Protocol
SOAP--Simple Object Access ProtocolSOAP--Simple Object Access Protocol
SOAP--Simple Object Access ProtocolMasud Rahman
 
Web services - A Practical Approach
Web services - A Practical ApproachWeb services - A Practical Approach
Web services - A Practical ApproachMadhaiyan Muthu
 
Using Java to implement SOAP Web Services: JAX-WS
Using Java to implement SOAP Web Services: JAX-WS�Using Java to implement SOAP Web Services: JAX-WS�
Using Java to implement SOAP Web Services: JAX-WSKatrien Verbert
 
Spring Web Services: SOAP vs. REST
Spring Web Services: SOAP vs. RESTSpring Web Services: SOAP vs. REST
Spring Web Services: SOAP vs. RESTSam Brannen
 
Writing & Using Web Services
Writing & Using Web ServicesWriting & Using Web Services
Writing & Using Web ServicesRajarshi Guha
 
RESTful Web Services with Spring MVC
RESTful Web Services with Spring MVCRESTful Web Services with Spring MVC
RESTful Web Services with Spring MVCdigitalsonic
 
Java Web Services [1/5]: Introduction to Web Services
Java Web Services [1/5]: Introduction to Web ServicesJava Web Services [1/5]: Introduction to Web Services
Java Web Services [1/5]: Introduction to Web ServicesIMC Institute
 
WebServices Basic Introduction
WebServices Basic IntroductionWebServices Basic Introduction
WebServices Basic IntroductionShahid Shaik
 
Java Web Services [3/5]: WSDL, WADL and UDDI
Java Web Services [3/5]: WSDL, WADL and UDDIJava Web Services [3/5]: WSDL, WADL and UDDI
Java Web Services [3/5]: WSDL, WADL and UDDIIMC Institute
 
Spring Web Services
Spring Web ServicesSpring Web Services
Spring Web ServicesEmprovise
 
Synapseindia dot net development web applications with ajax
Synapseindia dot net development  web applications with ajaxSynapseindia dot net development  web applications with ajax
Synapseindia dot net development web applications with ajaxSynapseindiappsdevelopment
 
Json-based Service Oriented Architecture for the web
Json-based Service Oriented Architecture for the webJson-based Service Oriented Architecture for the web
Json-based Service Oriented Architecture for the webkriszyp
 
Java Web Services [2/5]: Introduction to SOAP
Java Web Services [2/5]: Introduction to SOAPJava Web Services [2/5]: Introduction to SOAP
Java Web Services [2/5]: Introduction to SOAPIMC Institute
 
WebCamp: Developer Day: Архитектура Web-приложений: обзор современных решений...
WebCamp: Developer Day: Архитектура Web-приложений: обзор современных решений...WebCamp: Developer Day: Архитектура Web-приложений: обзор современных решений...
WebCamp: Developer Day: Архитектура Web-приложений: обзор современных решений...GeeksLab Odessa
 
Web service testing_final.pptx
Web service testing_final.pptxWeb service testing_final.pptx
Web service testing_final.pptxvodqancr
 
Creating And Consuming Web Services In Php 5
Creating And Consuming Web Services In Php 5Creating And Consuming Web Services In Php 5
Creating And Consuming Web Services In Php 5Michael Girouard
 

La actualidad más candente (20)

SOAP--Simple Object Access Protocol
SOAP--Simple Object Access ProtocolSOAP--Simple Object Access Protocol
SOAP--Simple Object Access Protocol
 
Web services - A Practical Approach
Web services - A Practical ApproachWeb services - A Practical Approach
Web services - A Practical Approach
 
Using Java to implement SOAP Web Services: JAX-WS
Using Java to implement SOAP Web Services: JAX-WS�Using Java to implement SOAP Web Services: JAX-WS�
Using Java to implement SOAP Web Services: JAX-WS
 
Spring Web Services: SOAP vs. REST
Spring Web Services: SOAP vs. RESTSpring Web Services: SOAP vs. REST
Spring Web Services: SOAP vs. REST
 
Writing & Using Web Services
Writing & Using Web ServicesWriting & Using Web Services
Writing & Using Web Services
 
Web services
Web servicesWeb services
Web services
 
Webservice Testing
Webservice TestingWebservice Testing
Webservice Testing
 
RESTful Web Services with Spring MVC
RESTful Web Services with Spring MVCRESTful Web Services with Spring MVC
RESTful Web Services with Spring MVC
 
Java Web Services [1/5]: Introduction to Web Services
Java Web Services [1/5]: Introduction to Web ServicesJava Web Services [1/5]: Introduction to Web Services
Java Web Services [1/5]: Introduction to Web Services
 
WebServices Basic Introduction
WebServices Basic IntroductionWebServices Basic Introduction
WebServices Basic Introduction
 
Java Web Services [3/5]: WSDL, WADL and UDDI
Java Web Services [3/5]: WSDL, WADL and UDDIJava Web Services [3/5]: WSDL, WADL and UDDI
Java Web Services [3/5]: WSDL, WADL and UDDI
 
Soap and Rest
Soap and RestSoap and Rest
Soap and Rest
 
Spring Web Services
Spring Web ServicesSpring Web Services
Spring Web Services
 
Synapseindia dot net development web applications with ajax
Synapseindia dot net development  web applications with ajaxSynapseindia dot net development  web applications with ajax
Synapseindia dot net development web applications with ajax
 
Json-based Service Oriented Architecture for the web
Json-based Service Oriented Architecture for the webJson-based Service Oriented Architecture for the web
Json-based Service Oriented Architecture for the web
 
Java Web Services [2/5]: Introduction to SOAP
Java Web Services [2/5]: Introduction to SOAPJava Web Services [2/5]: Introduction to SOAP
Java Web Services [2/5]: Introduction to SOAP
 
WebCamp: Developer Day: Архитектура Web-приложений: обзор современных решений...
WebCamp: Developer Day: Архитектура Web-приложений: обзор современных решений...WebCamp: Developer Day: Архитектура Web-приложений: обзор современных решений...
WebCamp: Developer Day: Архитектура Web-приложений: обзор современных решений...
 
Web service testing_final.pptx
Web service testing_final.pptxWeb service testing_final.pptx
Web service testing_final.pptx
 
Creating And Consuming Web Services In Php 5
Creating And Consuming Web Services In Php 5Creating And Consuming Web Services In Php 5
Creating And Consuming Web Services In Php 5
 
AJAX - An introduction
AJAX - An introductionAJAX - An introduction
AJAX - An introduction
 

Similar a Steps india technologies

Similar a Steps india technologies (20)

Web services
Web servicesWeb services
Web services
 
Lecture 16 - Web Services
Lecture 16 - Web ServicesLecture 16 - Web Services
Lecture 16 - Web Services
 
Ntg web services
Ntg   web servicesNtg   web services
Ntg web services
 
Introduction to SOAP
Introduction to SOAPIntroduction to SOAP
Introduction to SOAP
 
WCF 4 Overview
WCF 4 OverviewWCF 4 Overview
WCF 4 Overview
 
SOA and web services
SOA and web servicesSOA and web services
SOA and web services
 
Web-Services!.pptx
Web-Services!.pptxWeb-Services!.pptx
Web-Services!.pptx
 
Wsdl
WsdlWsdl
Wsdl
 
Developmeant and deployment of webservice
Developmeant and deployment of webserviceDevelopmeant and deployment of webservice
Developmeant and deployment of webservice
 
Intro to web services
Intro to web servicesIntro to web services
Intro to web services
 
AK 3 web services using apache axis
AK 3   web services using apache axisAK 3   web services using apache axis
AK 3 web services using apache axis
 
Web Services - A brief overview
Web Services -  A brief overviewWeb Services -  A brief overview
Web Services - A brief overview
 
complete web service1.ppt
complete web service1.pptcomplete web service1.ppt
complete web service1.ppt
 
Xml.ppt
Xml.pptXml.ppt
Xml.ppt
 
Web service architecture
Web service architectureWeb service architecture
Web service architecture
 
Mule soft ppt 2
Mule soft ppt  2Mule soft ppt  2
Mule soft ppt 2
 
WebServices introduction in Mule
WebServices introduction in MuleWebServices introduction in Mule
WebServices introduction in Mule
 
SOAP, WSDL and UDDI
SOAP, WSDL and UDDISOAP, WSDL and UDDI
SOAP, WSDL and UDDI
 
WebServices SOAP WSDL and UDDI
WebServices SOAP WSDL and UDDIWebServices SOAP WSDL and UDDI
WebServices SOAP WSDL and UDDI
 
WSDL
WSDLWSDL
WSDL
 

Último

Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac RoomVip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Roommeghakumariji156
 
一比一原版奥兹学院毕业证如何办理
一比一原版奥兹学院毕业证如何办理一比一原版奥兹学院毕业证如何办理
一比一原版奥兹学院毕业证如何办理F
 
PIC Microcontroller Structure & Assembly Language.ppsx
PIC Microcontroller Structure & Assembly Language.ppsxPIC Microcontroller Structure & Assembly Language.ppsx
PIC Microcontroller Structure & Assembly Language.ppsxjeykeydeveloper
 
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查ydyuyu
 
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdfMatthew Sinclair
 
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime NagercoilNagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoilmeghakumariji156
 
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrStory Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrHenryBriggs2
 
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdfpdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdfJOHNBEBONYAP1
 
Leading-edge AI Image Generators of 2024
Leading-edge AI Image Generators of 2024Leading-edge AI Image Generators of 2024
Leading-edge AI Image Generators of 2024SOFTTECHHUB
 
Trump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts SweatshirtTrump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts Sweatshirtrahman018755
 
20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdf20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdfMatthew Sinclair
 
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...kajalverma014
 
一比一原版犹他大学毕业证如何办理
一比一原版犹他大学毕业证如何办理一比一原版犹他大学毕业证如何办理
一比一原版犹他大学毕业证如何办理F
 
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge GraphsEleniIlkou
 
Best SEO Services Company in Dallas | Best SEO Agency Dallas
Best SEO Services Company in Dallas | Best SEO Agency DallasBest SEO Services Company in Dallas | Best SEO Agency Dallas
Best SEO Services Company in Dallas | Best SEO Agency DallasDigicorns Technologies
 
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...meghakumariji156
 
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制pxcywzqs
 
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查ydyuyu
 
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...APNIC
 

Último (20)

Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac RoomVip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
Vip Firozabad Phone 8250092165 Escorts Service At 6k To 30k Along With Ac Room
 
一比一原版奥兹学院毕业证如何办理
一比一原版奥兹学院毕业证如何办理一比一原版奥兹学院毕业证如何办理
一比一原版奥兹学院毕业证如何办理
 
PIC Microcontroller Structure & Assembly Language.ppsx
PIC Microcontroller Structure & Assembly Language.ppsxPIC Microcontroller Structure & Assembly Language.ppsx
PIC Microcontroller Structure & Assembly Language.ppsx
 
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
原版制作美国爱荷华大学毕业证(iowa毕业证书)学位证网上存档可查
 
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
 
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime NagercoilNagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
Nagercoil Escorts Service Girl ^ 9332606886, WhatsApp Anytime Nagercoil
 
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrStory Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
 
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdfpdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
 
Leading-edge AI Image Generators of 2024
Leading-edge AI Image Generators of 2024Leading-edge AI Image Generators of 2024
Leading-edge AI Image Generators of 2024
 
Trump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts SweatshirtTrump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts Sweatshirt
 
20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdf20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdf
 
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
best call girls in Hyderabad Finest Escorts Service 📞 9352988975 📞 Available ...
 
一比一原版犹他大学毕业证如何办理
一比一原版犹他大学毕业证如何办理一比一原版犹他大学毕业证如何办理
一比一原版犹他大学毕业证如何办理
 
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
 
Best SEO Services Company in Dallas | Best SEO Agency Dallas
Best SEO Services Company in Dallas | Best SEO Agency DallasBest SEO Services Company in Dallas | Best SEO Agency Dallas
Best SEO Services Company in Dallas | Best SEO Agency Dallas
 
call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
call girls in Anand Vihar (delhi) call me [🔝9953056974🔝] escort service 24X7
 
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...
Tadepalligudem Escorts Service Girl ^ 9332606886, WhatsApp Anytime Tadepallig...
 
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
一比一原版(Offer)康考迪亚大学毕业证学位证靠谱定制
 
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查在线制作约克大学毕业证(yu毕业证)在读证明认证可查
在线制作约克大学毕业证(yu毕业证)在读证明认证可查
 
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
APNIC Policy Roundup, presented by Sunny Chendi at the 5th ICANN APAC-TWNIC E...
 

Steps india technologies

  • 1. Introduction to Web Service Sagara Gunathunga ( Apache web Service and Axis committer )
  • 3. Why you need Web Services ?
  • 4. How do you interact with on-line financial service?
  • 6. How do you interact with on-line financial service? Bank-A Bank-B Bank-C
  • 7. How do you interact with on-line financial service? Bank-A Bank-B Bank-C WS -A WS -B WS -C
  • 9. What are Web services? • loosely coupled: - they can be changed independently • platform independent • contracted: in and output are publicly available • components: interface encapsulates the code • XML-based interfaces: - human readable • firewall friendly •self-describing (allows for discovery of their functionality)
  • 13. Web Services Specification There are three basic specifications, forming the basis for state-of-the-art Web-Service technology
  • 14. Simple Object Access Protocol (SOAP)
  • 16. SOAP .. • SOAP originally stood for "Simple Object Access Protocol" . • Web Services expose useful functionality to Web users through a standard Web protocol called SOAP. • Soap is an XML vocabulary standard to enable programs on separate computers to interact across any network. SOAP is a simple markup language for describing messages between applications. • • Soap uses mainly HTTP as a transport protocol. That is, HTTP message contains a SOAP message as its payload section.
  • 17. SOAP .. A SOAP message is an ordinary XML document containing the following elements: • A required Envelope element that identifies the XML document as a SOAP message. • An optional Header element that contains header information. • A required Body element that contains call and response information. • An optional Fault element that provides information about errors that occurred while processing the message.
  • 18. SOAP over HTTP HTTP Headers <soap:Envelope> <soap:Header> XML… </soap:Header> <soap:Body> XML payload… </soap:Body> </soap:Envelope> SOAP Envelope Header Body Message Pay Load
  • 19. Example - SOAP Request PPOOSSTT //IInnSSttoocckk HHTTTTPP//11..11 HHoosstt:: wwwwww..ssttoocckk..oorrgg CCoonntteenntt--TTyyppee:: aapppplliiccaattiioonn//ssooaapp++xxmmll;; cchhaarrsseett==uuttff--88 CCoonntteenntt--LLeennggtthh:: 115500 <<??xxmmll vveerrssiioonn==""11.00""??>> <<soap:Envelope xxmmllnnss::ssooaapp==""hhttttpp::////wwwwww.ww33.oorrgg//22000011//1122//ssooaapp--eennvveellooppee"" ssooaapp::eennccooddiinnggSSttyyllee==hhttttpp::////wwwwww.ww33.oorrgg//22000011//1122//ssooaapp--eennccooddiinngg””>> <<ssooaapp::BBooddyy xxmmllnnss::mm==""hhttttpp::////wwwwww.ssttoocckk.oorrgg//ssttoocckk"">> <<mm::GGeettSSttoocckkPPrriiccee>> <<mm::SSttoocckkNNaammee>>IIBBMM<<//mm::SSttoocckkNNaammee>> <<//mm::GGeettSSttoocckkPPrriiccee>> <<//ssooaapp::BBooddyy>> <<//ssooaapp::EEnnvveellooppee>>
  • 20. SOAP Response HHTTTTPP//11..11 220000 OOKK CCoonntteenntt--TTyyppee:: aapppplliiccaattiioonn//ssooaapp;; cchhaarrsseett==uuttff--88 CCoonntteenntt--LLeennggtthh:: 112266 <<??xxmmll vveerrssiioonn==""11.00""??>> <<ssooaapp::EEnnvveellooppee xxmmllnnss::ssooaapp==""hhttttpp::////wwwwww.ww33.oorrgg//22000011//1122//ssooaapp-- eennvveellooppee"" ssooaapp::eennccooddiinnggSSttyyllee==""hhttttpp::////wwwwww.ww33.oorrgg//22000011//1122//ssooaapp-- eennccooddiinngg"">> <<ssooaapp::BBooddyy xxmmllnnss::mm==""hhttttpp::////wwwwww.ssttoocckk.oorrgg//ssttoocckk"">> <<mm::GGeettSSttoocckkPPrriicceeRReessppoonnssee>> <<mm::PPrriiccee>>3344..55<<//mm::PPrriiccee>> <<//mm::GGeettSSttoocckkPPrriicceeRReessppoonnssee>> <<//ssooaapp::BBooddyy>> <<//ssooaapp::EEnnvveellooppee>>
  • 21. Web Services Description Language (WSDL) » WSDL stands for Web Services Description Language. » WSDL is an XML vocabulary for describing Web » services. It allows developers to describe Web Services and their capabilities, in a standard manner. » WSDL specifies what a request message must contain and what the response message will look like in unambiguous notation. In other words, it is a contract between the XML Web service and the client who wishes to use this service. » In addition to describing message contents, WSDL defines where the service is available and what communications protocol is used to talk to the service.
  • 22. WSDL Structure » portType • Abstract definition of a service (set of operations) » Multiple bindings per portType: • How to access it • SOAP, JMS, direct call » Ports • Where to access it Service Port (e.g. http://host/svc) Binding (e.g. SOAP) portType Port Binding operation(s) inMesage outMessage Abstract interface
  • 23. The WSDL Document Structure » A WSDL document is just a simple XML document. » It defines a web service using these major elements: • port type - The operations performed by the web service. • message - The messages used by the web service. • types - The data types used by the web service. • binding - The communication protocols used by the web service.
  • 24. Example WSDL <?xml version="1.0" encoding="UTF-8"?> <wsdl:definitions> <wsdl:message name="execLocalCommandResponse"> <wsdl:message name="execLocalCommandRequest"> <wsdl:portType name="SJwsImp"> <wsdl:operation name="execLocalCommand" parameterOrder="in0"> <wsdl:input message="impl:execLocalCommandRequest" name="execLocalCommandRequest"/> <wsdl:output message="impl:execLocalCommandResponse" name="execLocalCommandResponse"/> </wsdl:operation> </wsdl:portType> <wsdl:binding name="SubmitjobSoapBinding" type="impl:SJwsImp"> <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> <wsdl:operation name="execLocalCommand"> <wsdlsoap:operation soapAction=""/> <wsdl:input name="execLocalCommandRequest"> <wsdl:output name="execLocalCommandResponse"> </wsdl:operation> </wsdl:binding> <wsdl:service name="SJwsImpService"> <wsdl:port binding="impl:SubmitjobSoapBinding" name="Submitjob"> </wsdl:service> </wsdl:definitions>
  • 25. Example: WSDL types for Custom Data Definition <wsdl:types> <schema targetNamespace="http://.../GCWS/services/Submitjob" xmlns:impl="http://.../GCWS/services/Submitjob" xmlns="http://www.w3.org/2001/XMLSchema"> <import namespace="http://schemas.xmlsoap.org/soap/encoding/" /> <complexType name="ArrayOf_xsd_string"> <complexContent> <restriction base="soapenc:Array"> <attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:string[]" /> </restriction> </complexContent> </complexType> <element name="ArrayOf_xsd_string" nillable="true" type="impl:ArrayOf_xsd_string" /> </schema> </wsdl:types>
  • 26. Example - message <wsdl:message name="execLocalCommandResponse"> <wsdl:part name="execLocalCommandReturn" type="impl:ArrayOf_xsd_string" /> </wsdl:message> <wsdl:message name="execLocalCommandRequest"> <wsdl:part name="in0" type="xsd:string" /> </wsdl:message>
  • 27. WSDL - portTypes » portType elements map messages to operations. » You can think of portType==class, operation==class methods. » Operations can contain input, output, and/or fault bindings for messages. » An operation may support of the following message styles: • One-way: request only • Two-way: request/response • Solicit-response: server “push” and client response • Notification: one-way server push
  • 28. <wsdl:portType name="SJwsImp"> <wsdl:operation name="execLocalCommand" parameterOrder="in0"> <wsdl:input message="impl:execLocalCommandRequest" name="execLocalCommandRequest" /> <wsdl:output message="impl:execLocalCommandResponse" name="execLocalCommandResponse" /> </wsdl:operation> </wsdl:portType>
  • 29. Service and Port Definitions » So far, we have defined the class method interfaces (portTypes) and the rules for binding to a particular protocol. » Port elements define how the bindings (and thus the portTypes) are associated with a particular server. » The service element collects ports.
  • 30. <wsdl:service name="SJwsImpService"> <wsdl:port binding="impl:SubmitjobSoapBinding" name="Submitjob"> <wsdlsoap:address location="http://.../GCWS/services/Submitjob" /> </wsdl:port> </wsdl:service>
  • 31. PortType Bindings » portTypes are abstract interface definitions. • Don’t say anything about how to invoke a remote method. » Remote invocations are defined in binding elements. » Binding elements are really just place holders that are extended for specific protocols • WSDL spec provides SOAP, HTTP GET/POST, and MIME extension schema examples.
  • 32. <wsdl:binding name="SubmitjobSoapBinding" type="impl:SJwsImp"> <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" /> <wsdl:operation name="execLocalCommand“> <wsdlsoap:operation soapAction="" /> <wsdl:input name="execLocalCommandRequest"> <wsdlsoap:body encodingStyle=http://schemas.xmlsoap.org/soap/encoding/ namespace="http://.../GCWS/services/Submitjob" use="encoded" /> </wsdl:input> <wsdl:output name="execLocalCommandResponse"> <wsdlsoap:body encodingStyle=http://schemas.xmlsoap.org/soap/encoding/ namespace=http://.../GCWS/services/Submitjob use="encoded" /> </wsdl:output> </wsdl:operation> </wsdl:binding>
  • 34. Contract first WS development 1. Start with existing WSDL document or writing a new WSDL document, all of the web service frameworks support for contact first web service development. 2. Both Apache Axis2 and CXF provide ‘WSDL2Java” tool , that capable to generate source codes from WSDL contract. Spring -WS doesn't provide any code generation tool but supports for Contact first approach .
  • 35. Contract first WS development with Axis2 1. Use existing WSDL or write a simple WSDL using a XML editor or Eclipse WSDL editor. 2. Generate java skeleton using “WSDL2JAVA” tool. 3. Complete server side methods . 4. Package as .AAR ( with the generated service.xml ) 5. Deploy in to “services” directory of Axis2 installation.
  • 36. Code first WS development 1. Start with existing codes , most of the time people use this approach when they want to expose existing business features as a web service. 2. Most of the Web service framework supports for automatic WSDL generation from services. ( Axis2 , CXF) 3. Users can utilize this automatic code generation feature or they can disable this feature to assign existing WSDL file.
  • 37. Code first WS development with Axis2 Optionally you can write a interface too, specially with Spring, Hibernate and AOP related services. Service .xml - is a Axis2 specific service description file that contains important meta data about the service such as service class , service interface , message receivers etc.
  • 38. WS client development with Axis2 Once you have a service description for a service you can generate WS client code using a tools like “WSDL2JAVA” , the generated code contain the required logic to serialize messages, service location , QoS attributes etc.
  • 39. References • This slide and source codes for samples. •http://people.apache.org/~sagara/ws/intro10 •http://ws.apache.org/axis2/ •http://wso2.org/library/95 •http://www.developer.com/services/article.php/3613896/Writing-an-• http://wso2.org/library/2873
  • 40. Thank You Aeturnum Lanka (Pvt) Ltd 1 9 7 , S t a n le y T h ila k a r a t n a M w , N u g e g o d a 1 0 2 5 0 , S r i L a n k a Phone: + 9 4 1 1 5 5 1 8 1 7 7 | Email: in f o @ a e t u r n u m .c o m Web: w w w .a e t u r n u m .c o m | w w w .a t h iv a .c o m