InfoCenter Home >
4: Developing applications >
4.8: Web services - an overview >
4.8.1: Web services components
4.8.1: Web services components
These are the key components of a Web service:
- SOAP (simple object access protocol)
- WSDL (Web Services Description Language)
- UDDI (Universal Discovery , Description and Integration Protocol)
- UDDI4J (client version of UDDI)
SOAP or Simple Object Access Protocol
is a new protocol created by IBM, Microsoft, Userland, and DevelopMentor
to support remote procedure calls and other requests over HTTP.
Built on HTTP and XML, SOAP attempts to convert application servers into object servers.
See the W3C SOAP protocol site for more information on SOAP messages, supported datatypes, and
attributes. For SOAP implementation guidelines, visit the Apache site.
SOAP requests and the responses are XML based. The following examples illustrate a SOAP request and response:
Sample SOAP Request |
Sample SOAP Request
POST /Supplier HTTP/1.1
Host: www.somesupplier.com
Content-Type: text/xml; charset="utf-8"
Content-Length: nnnn
SOAPAction: "Some-URI"
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<m:OrderItem xmlns:m="Some-URI">
<RetailerID>557010<</RetailerID>
<ItemNumber>1050420459</ItemNumber>
<ItemName>AMF Night Hawk Pearl M2</ItemName>
<ItemDesc>Bowling Ball</ItemDesc>
<OrderQuantity>100</OrderQuantity>
<WholesalePrice>130.95</WholeSalePrice>
<OrderDateTime>2000-06-19 10:09:56</OrderDateTime>
</m:OrderItem>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
|
The SOAP request indicates that the OrderItem method, from the "Some-URI" namespace,
should be invoked from http://www.somesupplier.com/Supplier.
Upon receiving this request, the supplier application at www.somesupplier.com executes
the business logic that corresponds to OrderItem.
The SOAP protocol does not specify how to process the order.
The supplier could run a CGI script, invoke a servlet, or perform any other process that generates
the appropriate response.
See article SOAP support for the list
of artifacts that WebSphere Application Server supports as Web services.
In this example, the SOAP Envelope element is the top element of the XML
document that represents the SOAP message. The reference to the XML namespace
(xmlns:m="Some-URI") specifies the namespace to use for the SOAP identifiers.
This request is asking the application to place an order for the item identified by the elements:
- RetailerId
- ItemNumber
- ItemName
- ItemDesc
- OrderQuantity
- WholesalePrice
- OrderDateTime
The response comes in the form of an XML document that contains the results of the processing,
in this case, the order number for the order placed by the retailer.
The response is sent by the service provider located at http://www.somesupplier.com/Supplier.
Sample SOAP Response |
HTTP/1.1 200 OK
Content-Type: text/xml; charset="utf-8"
Content-Length: nnnn
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
<SOAP-ENV:Body>
<m:OrderItemResponse xmlns:m="Some-URI">
<OrderNumber>561381</OrderNumber>
</m:OrderItemResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
|
The response does not include a SOAP-specified header.
The results are placed in an element whose
name matches the method name (OrderItem) with the suffix, "Response" as in
OrderItemResponse.
Although Apache SOAP allows for SOAP over SMTP, WebSphere Application Server only supports
SOAP over HTTP.
The SOAP Javadoc is shipped with WebSphere Application Server.
Review WebSphere Application Server's Javadoc for SOAP implementation details.
WSDL or Web Services Description Language
is an XML-based interface definition language that provides operational
information about a service, such as the service interface, implementation details, access protocol, and contact endpoints.
Compliant server applications must support these interfaces, and client users can learn from the
document how a service should be accessed.
WebSphere Application Server does not provide tools
for generating WSDL files.
View a WSDL representation in the AddressBook2 sample.
See article UDDI4J samples for more information.
Review the WSDL specifications at W3C WSDL protocol site.
UDDI or Universal Discovery Description and Integration (Project)
is a comprehensive, open industry initiative enabling businesses to:
- Discover each other
- Define how they interact over the Internet, and share information in a global registry architecture.
WebSphere Application Server does not provide a private UDDI directory. IBM, among others,
provides public UDDI registries. For more information about UDDI,
see www.uddi.org.
Also visit
Alphaworks
for the Web services toolkit, which includes an IBM implementation of a private
UDDI registry.
UDDI is the building block which enables businesses to quickly, easily, and dynamically find and transact with one another by means of
their preferred applications.
As described in the Web services overview, UDDI provides the three basic Web services functions: publish, find, and bind.
UDDI4J
is an open-source Java implementation of the Universal Discovery, Description, and
Integration protocol (UDDI).
UDDI4J contains an implementation of the client side of UDDI (everything your application needs to publish, find, and bind a Web service).
It also includes the source code, and the complete Javadoc for the APIs. For more information,
visit the UDDI4J open source
site at oss.software.ibm.com/developerworks/projects/uddi4j.
Review IBM's Javadoc for UDDI4J implementation details.
|
|