Professional Documents
Culture Documents
Review of Session 1 (1 of 2)
Web Services are self-contained, self-describing, modular applications that can be published, located and invoked across the Web. The service interface in a Web Service helps the Web Service to be called by any other application program or another Web Service. A Web Service should be registered in a service registry to be accessed by other programs. Web Services use the standard Web protocols to communicate unlike COM, RMI, JINI, or CORBA. XML messages are used to interchange information between the service and the application program.
XML Web Services with Java / Session 2 / 2 of 23
Review of Session 1 (2 of 2)
A service provider along with a service registry, a service broker and a service requestor form the important participants in a Web Service. A Web Service architecture primarily consists of the following layers:
Data store Data access Web Service logic Web Service logic facade Listener layer
Session Objectives
Justify the need for a service description language Describe WSDL Discuss a simple Web service and its WSDL file Describe WSDL terminologies Analyze a WSDL file Explain the role of SOAP in WSDL
Specifies functionality of service Platform B Compatibility Issues Lists the parameters required by the exposed method Lists parameters returned by methods Documents the Web service contract (messages that the Web Service will generate and accept)
XML Web Services with Java / Session 2 / 5 of 23
Service 2
. . .
Specifies non-operational information for a XML based Interface Definition service viz. service category, expiry date, Language used to specify operational company name etc. information for a Web Service.
XML Web Services with Java / Session 2 / 7 of 23
elements
XML Web Services with Java / Session 2 / 9 of 23
Ports
SOAP Response CLIENT Web Service
Ports
message: Abstract definition of the data being communicated types: Mechanism to define data type used in Web service operation: Abstract definition of a particular action supported
Web service
by the
port:
portType: Collection of operations binding: Specification that lists the communication protocol and the data
format for a particular port type
Concrete Definitions
Machine or Language Specific
types
messages
portTypes
bindings
services
modifies
ports
operations
types
- <types> - <s:schema attributeFormDefault=qualified elementFormDefault=qualified targetNamespace=http://tempuri.org/> - <s:element name=add> - <s:complexType> - <s:sequence> ...... </s:sequence> </s:complexType> </s:element> ..... </s:schema> </types>
XML Web Services with Java / Session 2 / 14 of 23
message
Specifies the services request and response mechanism Not dependent upon any protocol i.e. there is no naming convention for message names. Divided into parts and each part is defined by the <part> element
- <message name="addSoapIn"> <part name="parameters" element="s0:add" /> </message> - <message name="addSoapOut"> <part name="parameters" element="s0:addResponse" /> </message> ........
XML Web Services with Java / Session 2 / 15 of 23
portType
Operations (input output messages) are to be defined by specifying the <operation> element portType defines operations provided by the Web Service.
<portType name="TestWSSoap"> - <operation name="add"> <input message="s0:addSoapIn" /> <output message="s0:addSoapOut" /> </operation> </portType> ......................
XML Web Services with Java / Session 2 / 16 of 23
binding
Represents the concrete descriptions of the operations Specifies the representation of parameters for a Web method
<binding name="TestWSSoap" type="s0:TestWSSoap"> <soap:binding transport= http://schemas.xmlsoap.org/soap/http style="document" /> -<operation name="add"> <soap:operation soapAction=http://tempuri.org/add style="document" /> - <input><soap:body use="literal" /></input> - <output><soap:body use="literal" /></output> </operation> </binding> .......
XML Web Services with Java / Session 2 / 17 of 23
service
Specifies methods offered by the Web service Services are available on ports, which have specific addresses
<service name="TestWS"> - <port name="TestWSSoap" binding="s0:TestWSSoap"> <soap:address location="http://localhost/ws.asmx" /> </port> - <port name="TestWSHttpGet" binding="s0:TestWSHttpGet"> <http:address location="http://localhost/ws.asmx" /> </port> ..... </service>
SOAP
Lightweight protocol that can be used over HTTP, SMTP etc.
Summary (1 of 2)
The language used to describe a service is known as Service Description Language (SDL). The language used to describe the services offered by a Web Service is known as Web Service Description Language (WSDL). WSDL is a subset of two separate documents, NASSL (Network Accessible Service Specification Language) and WDS (Well Defined Service document). An operation is an abstract definition of a particular action supported by the Web Service. A set of input and output messages collectively defines an operation.
Summary (2 of 2)
in the Web Service. For example, XSD (XML Style Definition). binding specifies a list of communication protocols and data formats for a particular port type. A binding specifies the manner in which operations will access the service using a certain protocol. A WSDL file can be classified into two sections: