How PL/SQL Applications Can Participate in a Service

Download Report

Transcript How PL/SQL Applications Can Participate in a Service


How PL/SQL Applications Can Participate in
a Service-Oriented Architecture
Aino Andriessen
AMIS

1
?

PL/SQL
SOA Party

2
SOA

 design
 connectivity

3
Service Design

 Focus on function
 a service is not a technical solution
 Component vs. service

4
Examples

 zipcode check / address check
 notification service
 converter
 xx -> xml
 currency
 CD information lookup

5
Connectivity

 any technology
 standards





XML
http
soap
ws-...
...
 synchronous vs. a-synchronous
 a service is not necessarily a webservice
 Loosely-coupled

6
The position of the database

 Traditionally, the database could be
considered as an isolated entity, only
available to its application(s).
internet
intranet
Forms
VB
webapp
db

7
The position of the database - 2

 Nowadays, the (Oracle) database is able to
function on its own and
 to deliver applications / services without the need
of an application server
 to connect directly to other applications / services
 use on standard internet technology
appB
 synchronous and a-synchronous
internet
intranet
db

8

 PL/SQL applications can function as a
service provider and as a service
consumer.

9
Database access (provider)

SQL*NET
HTTP
ODBC
WEBDAV
JDBC
FTP
XMLDB webserver
Oracle Database

10
Access the outside world (consumer)

External procedure
HTTP
Database link
mail
files
host
Oracle Database

11

 This sheet has been left blank on purpose

12
Webservices

 According to the W3C a Web service is a
software system designed to support
interoperable machine-to-machine interaction
over a network
 (in general) synchronous Request Response mechanism

13
Web service protocol stack

 Service transport
 http, smtp, ftp, ...
 XML messaging
 soap, rest, xml-rpc, ...
 Service description
 wsdl
 Service discovery
 uddi

14
SOAP example

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>...</soap:Header>
<soap:Body>
<getProductDetails xmlns="http://warehouse.example.com/ws">
<productID>827635</productID>
</getProductDetails>
</soap:Body>
</soap:Envelope>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<getProductDetailsResponse xmlns="http://warehouse.example.com/ws">
<getProductDetailsResult>
<productName>Toptimate 3-Piece Set</productName>
<productID>827635</productID>
<description>3-Piece luggage set. Black Polyester.</description>
<price>96.50</price>
<inStock>true</inStock>
</getProductDetailsResult>
</getProductDetailsResponse>
</soap:Body>
</soap:Envelope>

15
PL/SQL as a Webservice consumer

Webservice
Webservice
http
http
utl_http / utl_dbws
PL/SQL
Java stored
procedure
PL/SQL wrapper

16
Demo

wsdl
Webservice
utl_http
utl_dbws
ws_odtug_service_client.pkb

17
Webservice producer

consumer
http
XMLDB
webserver
consumer
http
Webapp
Application Server
mod_plsql
PL/SQL
PL/SQL

18
Demo

Browser
http
DBMS_EPG.create_dad (
dad_name => 'ws',
path => '/ws/*');
XMLDB
webserver
/ws
ws_server.conferences
ws_server.pkb

19


20
Messaging

 a-synchronous
 transportlayer - MOM
 Tibco, IBM MQ, JMS, AQ, ...
 some standarization
 JMS interface
 SOAP message format

21
Messaging concepts

 queue / topic
 enqueue - dequeue
 point - to - point
 publish - subscribe
producer
queue
enqueue
consumer
dequeue
consumer
producer
publish
queue /
topic
subscribe
consumer

22
Oracle Streams Advanced Queuing (AQ)

 queue
 queue table (or memory)
 exception queue
 queue view
 payload
 subscriber
 propagation

23
AQ

 API :
 dbms_aqadm
 dbms_aq
 ! Never, ever perform direct dml on queue tables
 payload = message type:
 object
•
oracle objects, xmltype, collections
 varchar2
 raw

24
Access

 PL/SQL
 java / JMS / jdbc
 oracle.jms, javax.jms
 VB
 Oracle objects for OLE
 OCI
 Internet
 Oracle Messaging Gateway

25
AQ Internet access

 You can access Oracle Streams AQ over the
Internet by using Simple Object Access
Protocol (SOAP).
 Internet Data Access Presentation (IDAP) defines
the XML message structure for the body of the
SOAP request.

26
Oracle Messaging Gateway

 Messaging Gateway enables communication
between applications based on non-Oracle
messaging systems and Oracle Streams AQ.

27
AQ implementation

 Oracle products
 interconnect
 ...
 ESB / integration products





Mule
Oracle ESB
iWay
BEA
...

28
Demo

Command Line
Command Line
Mule - ESB
Mule - ESB
Developer2
Developer2
1
4
B.
Developer
JDBC
A.
Conference
Registration
3
regconfirmation_out
registration_in
2
receive_registration
send_confirmation
4
A.
Conference
Registration
3
2
A.
Conference
Registration
3
Developer2.java
do_enqueue.prc
do_dequeue.fnc
registration_in
1
4
regconfirmation_out
2
make_registration
receive_confirmation
regconfirmation_out
registration_in
1
B.
Developer
Developer.java
aq_send.xml
aq_receive.xml

29
Conclusion

 PL/SQL can interact directly with the world
outside the database, using standard
'internet' technology, either directly or via
Oracle messaging (AQ).

30
!

SOA Party

31
Questions & Answers

[email protected]
AMIS weblog : http://technology.amis.nl/blog/

32