Movatterモバイル変換


[0]ホーム

URL:


PDF, PPTX9,923 views

Web service introduction

This document introduces web services and their key components. Web services allow different systems to communicate over the web through open standards like SOAP, WSDL and XML. SOAP defines how to structure service requests and responses as XML messages. WSDL provides an interface definition for web services by describing operations, messages and protocols. Together, SOAP and WSDL enable web services to expose functionality to clients in a standardized way.

Related topics:

Embed presentation

Download as PDF, PPTX
Introduction to Web ServiceSagara Gunathunga( Apache web Service and Axis committer )
CONTENTS
Why you needWeb 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?                                       WS -A                                                Bank-A                                        WS -B                                                Bank-B                                    WS -C                                                Bank-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 SpecificationThere are three basic specifications, forming the basisfor 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 HTTPHTTP Headers<soap:Envelope>           SOAP Envelope    <soap:Header>                              Header          XML…    </soap:Header>    <soap:Body>               Body          XML payload…   Message Pay Load     </soap:Body></soap:Envelope>
Example - SOAP RequestPOST /InStock HTTP/1.1Host: www.stock.orgContent-Type: application/soap+xml; charset=utf-8 Content-Length: 150<?xml version="1.0"?><soap:Envelopexmlns:soap="http://www.w3.org/2001/12/soap-envelope"soap:encodingStyle=http://www.w3.org/2001/12/soap-encoding”>   <soap:Body xmlns:m="http://www.stock.org/stock">           <m:GetStockPrice>             <m:StockName>IBM</m:StockName>             </m:GetStockPrice>   </soap:Body></soap:Envelope>
SOAP Response HTTP/1.1 200 OK Content-Type: application/soap; charset=utf-8 Content-Length: 126 <?xml version="1.0"?> <soap:Envelope xmlns:soap="http://www.w3.org/2001/12/soap- envelope" soap:encodingStyle="http://www.w3.org/2001/12/soap- encoding">     <soap:Body xmlns:m="http://www.stock.org/stock">          <m:GetStockPriceResponse>                  <m:Price>34.5</m:Price>          </m:GetStockPriceResponse>     </soap:Body> </soap:Envelope>
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)                                                         Service » Multiple bindings per   portType:    • How to access it                    Port                      Port                                    (e.g. http://host/svc)    • SOAP, JMS, direct call                                       Binding                     Binding                                        (e.g. SOAP) » Ports    • Where to access it                                                       portType                                                     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 DataDefinition<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:messagename="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 importantmeta data about the service such as service class , service interface , messagereceivers 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) Ltd1 9 7 , S ta n le y T h ila k a r a tn a M w , N u g e g o d a 1 0 2 5 0 , S r i                                     Lanka          Phone: + 9 4 1 1 5 5 1 8 1 7 7 | Email:               in fo @ a e tu r n u m .c o m

Recommended

PPTX
Web Service
PPTX
PPT
Java web services
PDF
SOAP-based Web Services
PDF
Introduction to SOAP/WSDL Web Services and RESTful Web Services
PPTX
Soap and restful webservice
PDF
Web Services Tutorial
PPTX
Soap web service
PPT
Intro to web services
PDF
Web Services (SOAP, WSDL, UDDI)
PDF
Java Web Services [1/5]: Introduction to Web Services
PPTX
Web services soap and rest by mandakini for TechGig
PPT
Soap and Rest
PPT
WebServices SOAP WSDL and UDDI
PPTX
SOAP--Simple Object Access Protocol
ODP
Web service Introduction
PPT
WebService-Java
 
PPTX
Overview of java web services
PDF
Java web services using JAX-WS
PPTX
Web Services - A brief overview
PPT
Wsdl
PDF
Web Services
PPTX
Web Services - WSDL
PPT
Wsdl
PPTX
Simple Object Access Protocol (SOAP)
PDF
Java Web Services [3/5]: WSDL, WADL and UDDI
PPTX
Soap vs rest
PPTX
Web services - A Practical Approach
PPT
Web Service Presentation
PPTX
Web Services - Architecture and SOAP (part 1)

More Related Content

PPTX
Web Service
PPTX
PPT
Java web services
PDF
SOAP-based Web Services
PDF
Introduction to SOAP/WSDL Web Services and RESTful Web Services
PPTX
Soap and restful webservice
PDF
Web Services Tutorial
PPTX
Soap web service
Web Service
Java web services
SOAP-based Web Services
Introduction to SOAP/WSDL Web Services and RESTful Web Services
Soap and restful webservice
Web Services Tutorial
Soap web service

What's hot

PPT
Intro to web services
PDF
Web Services (SOAP, WSDL, UDDI)
PDF
Java Web Services [1/5]: Introduction to Web Services
PPTX
Web services soap and rest by mandakini for TechGig
PPT
Soap and Rest
PPT
WebServices SOAP WSDL and UDDI
PPTX
SOAP--Simple Object Access Protocol
ODP
Web service Introduction
PPT
WebService-Java
 
PPTX
Overview of java web services
PDF
Java web services using JAX-WS
PPTX
Web Services - A brief overview
PPT
Wsdl
PDF
Web Services
PPTX
Web Services - WSDL
PPT
Wsdl
PPTX
Simple Object Access Protocol (SOAP)
PDF
Java Web Services [3/5]: WSDL, WADL and UDDI
PPTX
Soap vs rest
PPTX
Web services - A Practical Approach
Intro to web services
Web Services (SOAP, WSDL, UDDI)
Java Web Services [1/5]: Introduction to Web Services
Web services soap and rest by mandakini for TechGig
Soap and Rest
WebServices SOAP WSDL and UDDI
SOAP--Simple Object Access Protocol
Web service Introduction
WebService-Java
 
Overview of java web services
Java web services using JAX-WS
Web Services - A brief overview
Wsdl
Web Services
Web Services - WSDL
Wsdl
Simple Object Access Protocol (SOAP)
Java Web Services [3/5]: WSDL, WADL and UDDI
Soap vs rest
Web services - A Practical Approach

Viewers also liked

PPT
Web Service Presentation
PPTX
Web Services - Architecture and SOAP (part 1)
PPTX
Introduction to Web Service
PPTX
Webservices Overview : XML RPC, SOAP and REST
PDF
RESTful Web Services
PDF
Web services
PDF
Web services
PPT
Webservices
PDF
Introduction to Web Services
PPTX
Web Services in the Real World
PDF
Introduction to Service Oriented Architectures, SOAP/WSDL Web Services and RE...
PPTX
Web service introduction 2
PDF
Web Services
PPT
Json-based Service Oriented Architecture for the web
PDF
Services web RESTful
PDF
SOAP vs REST
PDF
Introduction to SNMP
PPT
SOA Unit I
PPTX
REST & RESTful Web Services
Web Service Presentation
Web Services - Architecture and SOAP (part 1)
Introduction to Web Service
Webservices Overview : XML RPC, SOAP and REST
RESTful Web Services
Web services
Web services
Webservices
Introduction to Web Services
Web Services in the Real World
Introduction to Service Oriented Architectures, SOAP/WSDL Web Services and RE...
Web service introduction 2
Web Services
Json-based Service Oriented Architecture for the web
Services web RESTful
SOAP vs REST
Introduction to SNMP
SOA Unit I
REST & RESTful Web Services

Similar to Web service introduction

PDF
Steps india technologies
PDF
Steps india technologies .com
PPTX
Web service- Guest Lecture at National Wokshop
PPTX
Web Services
PPTX
extinsible markup language module 2 and all
PPT
java-webservices introduction ppt for beginners
PPS
SOA web services concepts
PPTX
Lecture 16 - Web Services
PPTX
Web services
PPTX
Service Oriented Architecture
PPTX
Cloud computing 20 service modelling
DOCX
Soazczxczxzxczxzxvvxvvzvefxcsczxczxcsxczxczxcxzc
DOCX
Web services Concepts
PPT
webservicearchitecture-150614164814-lva1-app6892.ppt
PPT
Web Services
PPT
Web Services
PPT
Web services Tutorial /Websoles Strategic Digital Solutions
Steps india technologies
Steps india technologies .com
Web service- Guest Lecture at National Wokshop
Web Services
extinsible markup language module 2 and all
java-webservices introduction ppt for beginners
SOA web services concepts
Lecture 16 - Web Services
Web services
Service Oriented Architecture
Cloud computing 20 service modelling
Soazczxczxzxczxzxvvxvvzvefxcsczxczxcsxczxczxcxzc
Web services Concepts
webservicearchitecture-150614164814-lva1-app6892.ppt
Web Services
Web Services
Web services Tutorial /Websoles Strategic Digital Solutions

More from Sagara Gunathunga

PPTX
Microservices Security landscape
PPTX
Privacy by Design as a system design strategy - EIC 2019
PPTX
Consumer Identity World EU - Five pillars of consumer IAM
PPTX
kicking your enterprise security up a notch with adaptive authentication sa...
PPTX
Synergies across APIs and IAM
PPTX
GDPR impact on Consumer Identity and Access Management (CIAM)
PPTX
Introduction to the All New WSO2 Governance Centre
PPTX
Building Services with WSO2 Application Server and WSO2 Microservices Framewo...
PPTX
An Introduction to WSO2 Microservices Framework for Java
PPTX
Understanding Microservice Architecture WSO2Con Asia 2016
PDF
Introduction to the all new wso2 governance centre asia 16
PDF
Building Your Own Store with WSO2 Enterprise Store: The WSO2 Store Case Study
PDF
Introduction to the All New WSO2 Governance Centre
PDF
Java colombo-deep-dive-into-jax-rs
PDF
JavaEE and RESTful development - WSO2 Colombo Meetup
POTX
Application Monitoring with WSO2 App Server
PDF
WSO2 Application Server
PDF
Creating APIs with the WSO2 Platform
PDF
WSO2 AppDev platform
PDF
Apache contribution-bar camp-colombo
Microservices Security landscape
Privacy by Design as a system design strategy - EIC 2019
Consumer Identity World EU - Five pillars of consumer IAM
kicking your enterprise security up a notch with adaptive authentication sa...
Synergies across APIs and IAM
GDPR impact on Consumer Identity and Access Management (CIAM)
Introduction to the All New WSO2 Governance Centre
Building Services with WSO2 Application Server and WSO2 Microservices Framewo...
An Introduction to WSO2 Microservices Framework for Java
Understanding Microservice Architecture WSO2Con Asia 2016
Introduction to the all new wso2 governance centre asia 16
Building Your Own Store with WSO2 Enterprise Store: The WSO2 Store Case Study
Introduction to the All New WSO2 Governance Centre
Java colombo-deep-dive-into-jax-rs
JavaEE and RESTful development - WSO2 Colombo Meetup
Application Monitoring with WSO2 App Server
WSO2 Application Server
Creating APIs with the WSO2 Platform
WSO2 AppDev platform
Apache contribution-bar camp-colombo

Web service introduction

  • 1.
    Introduction to WebServiceSagara Gunathunga( Apache web Service and Axis committer )
  • 2.
  • 3.
    Why you needWebServices ?
  • 4.
    How do youinteract with on-line financial service? 
  • 5.
  • 6.
    How do youinteract with on-line financial service?  Bank-A Bank-B Bank-C
  • 7.
    How do youinteract with on-line financial service?  WS -A Bank-A WS -B Bank-B WS -C Bank-C
  • 8.
  • 9.
    What are Webservices?• 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)
  • 10.
  • 11.
  • 12.
  • 13.
    Web Services SpecificationThereare three basic specifications, forming the basisfor state-of-the-art Web-Service technology
  • 14.
    Simple Object AccessProtocol (SOAP)
  • 15.
  • 16.
    SOAP ..• SOAPoriginally 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 SOAPmessage 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 HTTPHTTPHeaders<soap:Envelope> SOAP Envelope <soap:Header> Header XML… </soap:Header> <soap:Body> Body XML payload… Message Pay Load </soap:Body></soap:Envelope>
  • 19.
    Example - SOAPRequestPOST /InStock HTTP/1.1Host: www.stock.orgContent-Type: application/soap+xml; charset=utf-8 Content-Length: 150<?xml version="1.0"?><soap:Envelopexmlns:soap="http://www.w3.org/2001/12/soap-envelope"soap:encodingStyle=http://www.w3.org/2001/12/soap-encoding”> <soap:Body xmlns:m="http://www.stock.org/stock">     <m:GetStockPrice> <m:StockName>IBM</m:StockName>      </m:GetStockPrice> </soap:Body></soap:Envelope>
  • 20.
    SOAP Response HTTP/1.1200 OK Content-Type: application/soap; charset=utf-8 Content-Length: 126 <?xml version="1.0"?> <soap:Envelope xmlns:soap="http://www.w3.org/2001/12/soap- envelope" soap:encodingStyle="http://www.w3.org/2001/12/soap- encoding"> <soap:Body xmlns:m="http://www.stock.org/stock"> <m:GetStockPriceResponse> <m:Price>34.5</m:Price> </m:GetStockPriceResponse> </soap:Body> </soap:Envelope>
  • 21.
    Web Services DescriptionLanguage (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) Service » Multiple bindings per portType: • How to access it Port Port (e.g. http://host/svc) • SOAP, JMS, direct call Binding Binding (e.g. SOAP) » Ports • Where to access it portType operation(s) inMesage outMessage Abstract interface
  • 23.
    The WSDL DocumentStructure» 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 typesfor Custom DataDefinition<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:messagename="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 PortDefinitions» 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» portTypesare 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>
  • 33.
  • 34.
    Contract first WSdevelopment 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 WSdevelopment 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 WSdevelopment 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 WSdevelopment 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 importantmeta data about the service such as service class , service interface , messagereceivers etc.
  • 38.
    WS client developmentwith 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 • Thisslide 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) Ltd1 9 7 , S ta n le y T h ila k a r a tn a M w , N u g e g o d a 1 0 2 5 0 , S r i Lanka Phone: + 9 4 1 1 5 5 1 8 1 7 7 | Email: in fo @ a e tu r n u m .c o m

[8]ページ先頭

©2009-2025 Movatter.jp