320 likes | 437 Views
How PL/SQL Applications Can Participate in a Service-Oriented Architecture. Aino Andriessen AMIS. ?. PL/SQL. SOA Party. IBM. j2ee. wsdl. messaging. soap. php. .NET. XML. webservices. SOA. design connectivity. Service Design. Focus on function
E N D
How PL/SQL Applications Can Participate in a Service-Oriented Architecture Aino Andriessen AMIS
? PL/SQL SOA Party IBM j2ee wsdl messaging soap php .NET XML webservices
SOA • design • connectivity
Service Design • Focus on function • a service is not a technical solution • Component vs. service
Examples • zipcode check / address check • notification service • converter • xx -> xml • currency • CD information lookup
Connectivity • any technology • standards • XML • http • soap • ws-... • ... • synchronous vs. a-synchronous • a service is not necessarily a webservice • Loosely-coupled
internet intranet Forms VB webapp db The position of the database • Traditionally, the database could be considered as an isolated entity, only available to its application(s).
appB internet intranet db 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 • synchronous and a-synchronous
PL/SQL applications can function as a service provider and as a service consumer.
Database access (provider) SQL*NET HTTP ODBC WEBDAV JDBC FTP Oracle Database XMLDB webserver
Access the outside world (consumer) External procedure HTTP Database link mail files host Oracle Database
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
Web service protocol stack • Service transport • http, smtp, ftp, ... • XML messaging • soap, rest, xml-rpc, ... • Service description • wsdl • Service discovery • uddi
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>
Webservice http Java stored procedure PL/SQL wrapper PL/SQL as a Webservice consumer Webservice http utl_http / utl_dbws PL/SQL
Demo wsdl Webservice utl_http utl_dbws ws_odtug_service_client.pkb
consumer consumer http http Application Server Webapp XMLDB webserver PL/SQL PL/SQL Webservice producer mod_plsql
Browser http XMLDB webserver /ws ws_server.conferences Demo DBMS_EPG.create_dad ( dad_name => 'ws', path => '/ws/*'); ws_server.pkb
Messaging • a-synchronous • transportlayer - MOM • Tibco, IBM MQ, JMS, AQ, ... • some standarization • JMS interface • SOAP message format
Messaging concepts • queue / topic • enqueue - dequeue • point - to - point • publish - subscribe producer queue consumer enqueue dequeue consumer publish producer queue / topic subscribe consumer
Oracle Streams Advanced Queuing (AQ) • queue • queue table (or memory) • exception queue • queue view • payload • subscriber • propagation
AQ • API : • dbms_aqadm • dbms_aq • ! Never, ever perform direct dml on queue tables • payload = message type: • object • oracle objects, xmltype, collections • varchar2 • raw
Access • PL/SQL • java / JMS / jdbc • oracle.jms, javax.jms • VB • Oracle objects for OLE • OCI • Internet • Oracle Messaging Gateway
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.
Oracle Messaging Gateway • Messaging Gateway enables communication between applications based on non-Oracle messaging systems and Oracle Streams AQ.
AQ implementation • Oracle products • interconnect • ... • ESB / integration products • Mule • Oracle ESB • iWay • BEA • ...
Demo Developer2.java do_enqueue.prc aq_send.xml Developer.java do_dequeue.fnc aq_receive.xml
Conclusion • PL/SQL can interact directly with the world outside the database, using standard 'internet' technology, either directly or via Oracle messaging (AQ).
! SOA Party IBM j2ee wsdl messaging soap PL/SQL .NET php XML webservices
Questions & Answers aino.andriessen@amis.nl AMIS weblog : http://technology.amis.nl/blog/