Title: Web services ja SOAP
1Web services ja SOAP
- Enn Õunapuu
- Tallinn Technical University
- enn_at_cc.ttu.ee
- 372 050 97720
2Content
- Introduction
- Software component
- BIT component
- Web service
- Message, state, contract, policies
- Service agent
- System architecture
- Näited
3SOAP
- SOAP stands for Simple Object Access Protocol
- SOAP is a communication protocol
- SOAP is for communication between applications
- SOAP is a format for sending messages
- SOAP is designed to communicate via Internet
- SOAP is platform independent
- SOAP is language independent
- SOAP is based on XML
- SOAP is simple and extensible
- SOAP allows you to get around firewalls
- SOAP will be developed as a W3C standard
4(No Transcript)
5(No Transcript)
6(No Transcript)
7lt_at_ page import"java.net.URL" gtlt_at_ page
import"javax.xml.rpc.Call" gtlt_at_ page
import"javax.xml.rpc.namespace.QName" gtlt_at_
page import"org.apache.axis.client.Service"
gtltString firstName request.getParameter("fir
stName")String lastName request.getParameter("
lastName")Service service new Service(new
URL("http//localhost/soapXarch/jsp2asp/ASPSoapSer
vice.wsdl"),new QName("http//tempuri.org/wsdl/",
"ASPSoapService"))Call call
service.createCall(new QName("ContactSoapPort"),
new QName("getAddress"))String address
(String) call.invoke(new Object firstName,
lastName)gt
8public class Contactpublic String
getAddress(String first, String last)String
addresstryClass.forName("sun.jdbc.odbc.JdbcO
dbcDriver")Connection conn DriverManager.getCo
nnection("jdbcodbcmyodbc")Statement stmt
conn.createStatement()String sql "select
address from people where firstname '" first
"' and lastname '" last "'"ResultSet rs
stmt.executeQuery(sql)if (rs.next())address
rs.getString("address")elseaddress "No
Address was found with those names"catch
(Exception e)address e.getMessage()retur
n address
9Software component
A software component is a unit of composition
with contractually specified interfaces and
context dependencies only. A software component
can be deployed independently and is subject to
composition by third parties
10BIT component
- A BIT component is a component with one or more
test interfaces that increase the testability of
the component. Inspiration to BIT components
comes from complex integrated electronic circuits
that often have tests built in to make them
testable.
11Web service
- Software services are discrete units of
application logic that expose message-based
interfaces suitable for being accessed across a
network.
12Message, state, contract, policies
- In the service model presented here, the service
is defined purely by the messages it will accept
and produce, including the sequencing
requirements for those messages. - Service-to-service communication follows a
contract, and by making this contract explicit it
is possible to change one service implementation
without compromising the interaction. - Services need to be managed and secured. A policy
consists of a set of rules, and each rule applies
to an aspect of the run-time behavior - Services manage state this state is the very
reason for their existence. Services guard this
state and they ensure through their business
logic that it is kept consistent and accurate.
13Service agent
- A service agent is a service that helps you work
with other services. Often supplied by the
provider of the target service, the agent runs
topologically close to the application consuming
the service. It helps both to prepare requests to
a service and to interpret responses from the
service.
14System architecture
15Näited
- localhost/agent/featurescomputer.htm
- localhost/JavaAaspSoap/StartJava.htm
- localhost/JavaAaspSoap/StartASP.htm
16