View
218
Download
0
Tags:
Embed Size (px)
Citation preview
CSE298
CSE300
OV-1.1
CSE300
Distributed Object Computing using XML-SOAPDistributed Object Computing using XML-SOAP
Kevin WhiteJames Kebinger
Fall 2000
CSE298
CSE300
OV-1.2
CSE300
Introduction to XMLIntroduction to XML
XML it s a text-based markup language that is XML it s a text-based markup language that is becoming a standard to store databecoming a standard to store data
XML tags tell you what the data XML tags tell you what the data meansmeans, rather than , rather than how to display it.how to display it.
Elements are the holding blocks for data in an Elements are the holding blocks for data in an XML object.XML object.
CSE298
CSE300
OV-1.3
CSE300
XML ExampleXML Example
The following is a XML example of a pizza item:The following is a XML example of a pizza item:
<pizza>
<name>The Texan</name>
<toppings>
<topping>barbeque brisket</topping>
<topping>dill pickles</topping>
<topping>onions</topping>
<topping>mozzarella cheese</topping>
<topping>tomato sauce</topping>
</toppings>
<description>Put the lone in lone star state!</description>
</pizza>
CSE298
CSE300
OV-1.4
CSE300
What is XML?What is XML?
XML objects can also consist of the following XML objects can also consist of the following items: items:
• Elements: holding blocks for data
• Attributes: Name-value pairs that occur inside start-tags after the element name.
• Entity references: Created to allow entity to be created and used in places where multiple instances of the same text will be use in many places.
• Processing instructions: used to provide information specific to applications.
• Comments: User comments
• CDATA: A section of character data that will not be interpreted by the XML parser.
CSE298
CSE300
OV-1.5
CSE300
Why is XML important?Why is XML important?
Plain TextPlain Text XML is it stored as plain ASCII text Allows for viewing and editing the XML data
with any text editor
Data IdentificationData Identification Tag names relate to the data it holds Produces easily parable data with reference to
tag names
CSE298
CSE300
OV-1.6
CSE300
Why is XML important?Why is XML important?
Display stylesDisplay styles XML is only a way to store data. A separate
file can be created to display this data XSL
HierarchicalHierarchical XML documents benefit from their hierarchical
structure Like stepping through a table of contents
CSE298
CSE300
OV-1.7
CSE300
Present Distributed Object ModelsPresent Distributed Object Models
Java RMI for Java applicationsJava RMI for Java applications DCOM for Windows applicationsDCOM for Windows applications CORBA for cross platform applicationsCORBA for cross platform applications
Each have overhead and large scale interoperability Each have overhead and large scale interoperability issuesissues
Answer: SOAP = Simple Object Access ProtocolAnswer: SOAP = Simple Object Access Protocol
CSE298
CSE300
OV-1.8
CSE300
Java RMIJava RMI
Design goal for the RMI architecture was to create Design goal for the RMI architecture was to create a Java distributed object modela Java distributed object model
RMI works in 3 layersRMI works in 3 layers The first layer intercepts method calls made by the client and
redirects these calls to a remote RMI service.
This second layer understands how to interpret and manage references made from clients to the remote service objects.
The final layer is the transport layer and is based on TCP/IP connections between machines in a network.
Java RMI works for Java applications onlyJava RMI works for Java applications only
CSE298
CSE300
OV-1.9
CSE300
DCOMDCOM
DCOM: DCOM: DDistributed istributed CComponent omponent OObject bject MModelodel
Microsoft’s solution for distributed computingMicrosoft’s solution for distributed computing
Allows one client application to remotely start a Allows one client application to remotely start a DCOM server object on another machine and DCOM server object on another machine and invoke its methodsinvoke its methods
DCOM provides the ability to use and reuse DCOM provides the ability to use and reuse components dynamically, without recompiling, on components dynamically, without recompiling, on any platform, from any language, at any timeany platform, from any language, at any time
CSE298
CSE300
OV-1.10
CSE300
CORBACORBA
CORBA: CORBA: Common Object Request Broker ArchitectureCommon Object Request Broker Architecture CORBA is platform and language independentsCORBA is platform and language independents
CORBA Object Request Broker (ORB) provides a CORBA Object Request Broker (ORB) provides a way to connect a client application with an object way to connect a client application with an object that it needsthat it needs
When creating CORBA applications, two main When creating CORBA applications, two main classes, a stub and a skeleton, are created along classes, a stub and a skeleton, are created along with several helper classeswith several helper classes
The ORB is the glue that connects the stubs and The ORB is the glue that connects the stubs and skeletons. skeletons.
CSE298
CSE300
OV-1.11
CSE300
The SOAP ProtocolThe SOAP Protocol
SOAP stands for Simple Object Access Protocol SOAP stands for Simple Object Access Protocol
SOAP doesn't care what operating system, SOAP doesn't care what operating system, programming language, or object model is being programming language, or object model is being used on either the server side or the client side used on either the server side or the client side
SOAP is a cross-platform way to make remote SOAP is a cross-platform way to make remote method calls, serialize and de-serialize objects method calls, serialize and de-serialize objects using XML using XML
CSE298
CSE300
OV-1.12
CSE300
The SOAP ProtocolThe SOAP Protocol
For a protocol it commonly uses HTTP, which is For a protocol it commonly uses HTTP, which is simple to implement and used universally simple to implement and used universally
SOAP works over many protocols, not limited to SOAP works over many protocols, not limited to HTTPHTTP
Using HTTP for transport gives SOAP an Using HTTP for transport gives SOAP an advantage over other previous middleware advantage over other previous middleware solutions because it does not require changes be solutions because it does not require changes be made to network routers and proxy serversmade to network routers and proxy servers
An inherent advantage of SOAP being able to use An inherent advantage of SOAP being able to use HTTP is that it is a universally deployed protocolHTTP is that it is a universally deployed protocol
CSE298
CSE300
OV-1.13
CSE300
SOAP ProcessSOAP Process
SOAP request would be processed in the following SOAP request would be processed in the following steps:steps:1. Get a request on the listen port.2. Parse the request for the method id to call.3. Consult a configuration file for what class/function to
call to handle the request.4. De-serialize the parameters for the method call.5. Call the function with the given de-serialized parameters6. Serialize the return value from the function and send it
back to the requestor
SOAP is not rocket-science. SOAP is simple to SOAP is not rocket-science. SOAP is simple to understand, implement and deploy.understand, implement and deploy.
CSE298
CSE300
OV-1.14
CSE300
Basic SOAP SampleBasic SOAP Sample
Here is a SOAP request:Here is a SOAP request:
POST /StockQuote HTTP/1.1POST /StockQuote HTTP/1.1Host: www.stockquoteserver.comHost: www.stockquoteserver.comContent-Type: text/xml; charset="utf-8"Content-Type: text/xml; charset="utf-8"Content-Length: nnnnContent-Length: nnnnSOAPAction: "Some-URI"SOAPAction: "Some-URI"
<SOAP-ENV:Envelope<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body> <SOAP-ENV:Body> <m:GetLastTradePrice xmlns:m="Some-URI"> <m:GetLastTradePrice xmlns:m="Some-URI"> <symbol>DIS</symbol> <symbol>DIS</symbol> </m:GetLastTradePrice> </m:GetLastTradePrice> </SOAP-ENV:Body> </SOAP-ENV:Body></SOAP-ENV:Envelope></SOAP-ENV:Envelope>
CSE298
CSE300
OV-1.15
CSE300
Basic SOAP SampleBasic SOAP Sample
And the matching response is:And the matching response is:
HTTP/1.1 200 OKHTTP/1.1 200 OKContent-Type: text/xml; charset="utf-8"Content-Type: text/xml; charset="utf-8"Content-Length: nnnnContent-Length: nnnn
<SOAP-ENV:Envelope<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> <SOAP-ENV:Body> <SOAP-ENV:Body> <m:GetLastTradePriceResponse xmlns:m="Some-URI"> <m:GetLastTradePriceResponse xmlns:m="Some-URI"> <Price>34.5</Price> <Price>34.5</Price> </m:GetLastTradePriceResponse> </m:GetLastTradePriceResponse> </SOAP-ENV:Body> </SOAP-ENV:Body></SOAP-ENV:Envelope></SOAP-ENV:Envelope>
CSE298
CSE300
OV-1.16
CSE300
Apache SOAPApache SOAP
Used Apache SOAP v 2.0 for implementation.Used Apache SOAP v 2.0 for implementation.
Java library for both client and serverJava library for both client and server
Application need not parse nor create XMLApplication need not parse nor create XML
Server implemented as a servletServer implemented as a servlet
Server application programmed without regard to Server application programmed without regard to SOAPSOAP
Client SOAP calls easy to construct using APIClient SOAP calls easy to construct using API
CSE298
CSE300
OV-1.17
CSE300
SOAP National BankSOAP National Bank
Prototype client-server application
Supports basic banking tasks:
Balance inquiries Deposits/withdrawals Transfers View transaction history
CSE298
CSE300
OV-1.18
CSE300
Use CasesUse Cases
Check Balance (s)
Transfer Funds
Deposit/Withdraw
Close Account
Transaction HistoryCreate New Account
Customer
Login to Account
<<include>>
<<include>>
<<include>>
<<include>>
<<include>>
CSE298
CSE300
OV-1.20
CSE300
System ArchitectureSystem Architecture
SOAP
GUI
ClientServer
Servlet Runner
Access DB
JDBC
DBAccess
CSE298
CSE300
OV-1.21
CSE300
System ImplementationSystem Implementation
Client and Server written in Java v 1.22Client and Server written in Java v 1.22 Client GUI uses Java Swing APIClient GUI uses Java Swing API Server uses JDBC to connect to MS Access DBServer uses JDBC to connect to MS Access DB Client and Server communicate using Apache’s Client and Server communicate using Apache’s
Java SOAP libraryJava SOAP library
CSE298
CSE300
OV-1.23
CSE300
Bank System ConclusionsBank System Conclusions
System successful, all functions workSystem successful, all functions work Implementation fairly painless once we learned Implementation fairly painless once we learned
SOAP APISOAP API Only major snag was learning how to configure the Only major snag was learning how to configure the
SOAP servletSOAP servlet Application rather slow: what causes slowness?Application rather slow: what causes slowness?
MS Access calls SOAP itself
CSE298
CSE300
OV-1.24
CSE300
SOAP BenchmarkingSOAP Benchmarking
Compare RMI to SOAPCompare RMI to SOAP Build a small client-server system to exchange the Build a small client-server system to exchange the
current data and timecurrent data and time As a java.util.Date object As a java.lang.String object
Different objects will compare efficiency and Different objects will compare efficiency and scalability of serializationscalability of serialization
CSE298
CSE300
OV-1.25
CSE300
SOAP Serialization ExampleSOAP Serialization Example
StringString<return xsi:type="xsd:string">Thu Nov 23 17:24:46 <return xsi:type="xsd:string">Thu Nov 23 17:24:46
EST 2000EST 2000</return></return>
DateDate<return xsi:type="ns1:date"><return xsi:type="ns1:date"><time xsi:type="xsd:long">975013920065</time><time xsi:type="xsd:long">975013920065</time><minutes xsi:type="xsd:int">12</minutes><minutes xsi:type="xsd:int">12</minutes><seconds xsi:type="xsd:int">0</seconds><seconds xsi:type="xsd:int">0</seconds><date xsi:type="xsd:int">23</date><date xsi:type="xsd:int">23</date><day xsi:type="xsd:int">4</day><day xsi:type="xsd:int">4</day><hours xsi:type="xsd:int">16</hours><hours xsi:type="xsd:int">16</hours><year xsi:type="xsd:int">100</year><year xsi:type="xsd:int">100</year><timezoneOffset <timezoneOffset
xsi:type="xsd:int">300</timezoneOffset>xsi:type="xsd:int">300</timezoneOffset><month xsi:type="xsd:int">10</month><month xsi:type="xsd:int">10</month></return></return>
CSE298
CSE300
OV-1.26
CSE300
Benchmark SetupBenchmark Setup
250 Remote Calls per trial250 Remote Calls per trial Took average of 3 trials for final resultsTook average of 3 trials for final results
Tests run on Pentium 2 266 Laptop with 288 Megs Tests run on Pentium 2 266 Laptop with 288 Megs of RAMof RAM
Tests run locally, therefore do not reflect cost of Tests run locally, therefore do not reflect cost of network time.network time.
CSE298
CSE300
OV-1.27
CSE300
SOAP SerializationSOAP Serialization
SOAP Serialization Times
0.92
0.94
0.96
0.98
1
1.02
1.04
1.06
1.08
1.1
1.12
1.14
Date String
CSE298
CSE300
OV-1.28
CSE300
RMI SerializationRMI Serialization
RMI Serialization Times
0.97
0.98
0.99
1
1.01
1.02
1.03
1.04
1.05
1.06
Date String
CSE298
CSE300
OV-1.29
CSE300
RMI v. SOAPRMI v. SOAP
SOAP v. RMITime Per Call
0
20
40
60
80
100
120
140
160
SOAP-Date SOAP-String RMI-Date RMI-String
ms
CSE298
CSE300
OV-1.30
CSE300
Benchmark ConclusionsBenchmark Conclusions
RMI about ten times faster than SOAPRMI about ten times faster than SOAP Agrees with published results from Indiana
University
RMI Serialization may scale better than SOAPRMI Serialization may scale better than SOAP SOAP using possibly inefficient generic
serializer in test
CSE298
CSE300
OV-1.31
CSE300
SOAP ConclusionsSOAP Conclusions
SOAP could use an automatic stub generator like SOAP could use an automatic stub generator like RMIRMI Would have sped up development greatly
Lots of people using SOAPLots of people using SOAP IBM, Microsoft, Compaq etc.
SOAP not a standard yetSOAP not a standard yet Could change a lot before settling down
CSE298
CSE300
OV-1.32
CSE300
SOAP ConclusionsSOAP Conclusions
SOAP very usable todaySOAP very usable today Some questions concerning interoperability
between SOAP implementation
SLOWSLOW May be OK for some web apps Not for high performance computing
Would recommend use for small systemsWould recommend use for small systems