eXtc XML and Web Services for Cach - PowerPoint PPT Presentation

1 / 37
About This Presentation
Title:

eXtc XML and Web Services for Cach

Description:

Native implementation of the W3C's XML Document Object Model (DOM) ... Up to date currency conversion. Credit card authorisation. Credit rating checks ... – PowerPoint PPT presentation

Number of Views:110
Avg rating:3.0/5.0
Slides: 38
Provided by: robt9
Category:
Tags: xml | cach | extc | services | web

less

Transcript and Presenter's Notes

Title: eXtc XML and Web Services for Cach


1
eXtc XML and Web Servicesfor Caché
2
Why eXtc?
  • XML is a must have/must do technology
  • Most Caché applications that require XML support
    are mature legacy products
  • Limited timescales and resources
  • Are Objects necessary if all we want is XML?
  • Implementation, migration, learning curve

3
What is eXtc?
  • Native implementation of the W3Cs XML Document
    Object Model (DOM)
  • DOM physically represented in globals
  • DOM API methods implemented as extrinsic
    functions
  • Object syntax available for Caché 5.0

4
eXtcs functionality
  • XML Parser with full DTD validation
  • XML DOM API methods (all)
  • XPath (subset)
  • XML/HTTP server client
  • Web Services (WSDL/SOAP/HTTP)
  • server
  • client

5
eXtcs Technical Implementation
  • Written in standard Caché ObjectScript, using
    direct access to globals
  • Maximise performance
  • Caché version and platform independence
  • No third-party add-ons
  • Supports CSP and WebLink for HTTP/ HTTPS
    connectivity in server role

6
eXtc Parser DOM
XML DOM Conforms to W3C DOM Level 2
Core Specification v1.0
Incoming/Outgoing XML Document/Dataset
ltINCOMEgt ltSALARYgt ltYEARgt1999lt/YEARgt
ltAMOUNTgt20000.00lt/AMOUNTgt lt/SALARYgt ltSALARYgt
ltYEARgt2000lt/YEARgt ltAMOUNTgt22000.00lt/AMOUNTgt
lt/SALARYgt ltTAXgt ltAMOUNTgt20.00lt/AMOUNTgt
lt/TAXgt lt/INCOMEgt
Convert DOM to XML
eXtc DOM Builder
eXtc Parser conforms to W3C XML 1.0 XML
Namespaces 1999
Internal storage and manipulation format
Interchange format
Structural syntactical errors
eXtc DOM API functions
Programmer access using Caché ObjectScript
Globals
Objects
7
eXtc XML Import/Export
Other import method
Global
Text File
Web Server
HTTP POST from remote server
XML Document/Dataset
ltINCOMEgt ltSALARYgt ltYEARgt1999lt/YEARgt
ltAMOUNTgt20000.00lt/AMOUNTgt lt/SALARYgt ltSALARYgt
ltYEARgt2000lt/YEARgt ltAMOUNTgt22000.00lt/AMOUNTgt
lt/SALARYgt ltTAXgt ltAMOUNTgt20.00lt/AMOUNTgt
lt/TAXgt lt/INCOMEgt
XML DOM
WebLink/ CSP
DOM Builder
Parser
Convert DOM to XML
Send using HTTP POST
To remote HTTP server
DOM API Functions
Programmer Access
Global
Text File
Caché System
Other export method
8
DOM Tree Structure
Document
parentNode
parentNode
parentNode
firstChild
lastChild
Processing Instruction
Document Type
nextSibling
nextSibling
Element
documentElement
previousSibling
previousSibling
parentNode
parentNode
parentNode
lastChild
firstChild
Element
nextSibling
Text
Element
nextSibling
previousSibling
previousSibling
lt?xml version'1.0'?gt lt!DOCTYPE DemoDoc SYSTEM
'DemoDoc.dtd'gt ltDemoDocgt This is a Demo ltMyTag
Year2001/gt ltOtherTag/gt lt/DemoDocgt
OwnerElement
attribute
Attribute
lastChild
parentNode
firstChild
Text
9
eXtc DOM Manipulation
XML DOM(s)

eXtc DOM API functions
Conforms to W3C DOM Level 2 Core Specification v1.
0
Functions for navigating and accessing DOM
contents
Functions for Modifying DOM
Create new DOM instance
Programmer access interfaces using Caché
ObjectScript
10
eXtc DOM API
Caché ObjectScript Syntax
Set tagNamegetTagNameeDOMAPI(childOID3) Set
hasAttrshasAttributeseDOMAPI(childOID3)
Caché 5.0 Object Syntax
Set tagNamedocument.firstChild.nextSibling.nextSi
bling.nodeName Set hasAttrsdocument.firstChild.ne
xtSibling.nextSibling.hasAttributes()
11
XML Server-Server Data Exchange over HTTP or HTTPS
XML Server
XML Client
Web Server
1.
2.
Internet/ Intranet
4.
3.
1. XML request sent via HTTP or HTTPS
2. XML request forwarded to server
3. XML response created and sent to web server
4. XML response returned via HTTP or HTTPS
12
Example XML Request
POST /Income.csp HTTP/1.1 Host
www.yourdomainname.com Content-Type
text/xml Content-Length 181 lt?xml
version'1.0' encoding'us-ascii'?gt lt!DOCTYPE
REQUEST SYSTEM "request.dtd"gt ltREQUESTgt ltREQUEST_T
YPEgtINCOMElt/REQUEST_TYPEgt ltNAMEgtCUST_IDlt/NAMEgt ltVA
LUEgt987654321lt/VALUEgt lt/REQUESTgt
13
The Resulting Response
HTTP/1.1 200 OK Content-type text/xml lt?xml
version'1.0' encoding'us-ascii'?gt lt!DOCTYPE
Income SYSTEM income.dtd"gt ltINCOMEgt ltSALARYgt lt
AMOUNTgt ltGROSSAMOUNTgt30000.00lt/GROSSAMOUNTgt ltNET
Amountgt20000.00lt/NETAmountgt lt/AMOUNTgt lt/SALARYgt
lt/INCOMEgt
14
eXtc XML client processing
Build XML DOM for outgoing request
Data stored in globals or objects
Internet/ Intranet
HTTP
eXtc Client Connect to remote web
server Convert DOM to XML stream Send XML as
HTTP request Receive response Parse incoming
XML Build new DOM
eXtc Client Connect to remote web
server Convert DOM to XML stream Send XML as
HTTP request Receive response Parse incoming
XML Validate against DTD Build new response DOM
To/from remote HTTP Server
HTTP
User processing of response DOM, eg save data
Data stored in globals or objects
15
eXtc XML client processingusing SSL
Build XML DOM for outgoing request
Data stored in globals or objects
HTTPS
Internet/ Intranet
HTTPS Proxy
HTTP
eXtc Client Connect to remote web
server Convert DOM to XML stream Send XML as
HTTP request Receive response Parse incoming
XML Build new DOM
eXtc Client Connect to remote web
server Convert DOM to XML stream Send XML as
HTTP request Receive response Parse incoming
XML Validate against DTD Build new response DOM
HTTPS
To/from remote HTTP Server
HTTP
eg Delegate
User processing of response DOM, eg save data
Data stored in globals or objects
16
eXtc XML Server processing
eXtc Server Triggered by WebLink/CSP Receive
incoming XML request Parse XML and build
DOM Validate request against DTD
Web Server
HTTP or HTTPS
Internet/ Intranet
User validation of contents of request DOM
Data stored in globals/ objects
WebLink/ CSP
From/to remote HTTP Server
User processing to use request DOM and create
new response DOM
eXtc Server Convert response DOM to XML,
wrapper as HTTP response and send
17
What DTD? What process?
POST /Income.csp HTTP/1.1 Host
www.yourdomainname.com Content-Type
text/xml Content-Length 181 lt?xml
version'1.0' encoding'us-ascii'?gt lt!DOCTYPE
REQUEST SYSTEM "request.dtd"gt ltREQUESTgt ltREQUEST_T
YPEgtINCOMElt/REQUEST_TYPEgt ltNAMEgtCUST_IDlt/NAMEgt ltVA
LUEgt987654321lt/VALUEgt lt/REQUESTgt
eXtc associates request.dtd with a dispatch to
a specified Caché function/method.
18
eXtc for Web Services
  • Web services are method oriented
  • XML-based standards for remote procedure call
    (RPC)
  • Simple Object Access Protocol (SOAP)
  • Web Services Description Language (WSDL)
  • HTTP/HTTPS normally used to provide the wire
    protocol

19
SOAP
  • Formally and generically defines an XML syntax
    for describing
  • method call
  • parameter(s)
  • returned result(s)
  • eg
  • function getEmployeeAddress(employeeID)
  • Uses XML namespaces and schemas

20
Example SOAP Request
ltSOAP-ENVEnvelope SOAP-ENC"http//schemas.
xmlsoap.org/soap/encoding/"
SOAP-ENVencodingStyle"http//schemas.xmlsoap.org
/soap/encoding/" xmlnsSOAP-ENV"http//sche
mas.xmlsoap.org/soap/envelope/"
xmlnsxsd"http//www.w3.org/1999/XMLSchema"
xmlnsxsi"http//www.w3.org/1999/XMLSchema-insta
nce"gt ltSOAP-ENVBodygt ltaSquare
xmlnsa"http//192.168.123.124/SOAP/square"gt
ltInputValue xsitype"xsddouble"gt 5
lt/InputValuegt lt/aSquaregt
lt/SOAP-ENVBodygt lt/SOAP-ENVEnvelopegt
Equivalent to Square(5)
21
Example SOAP Response
lt?xml version'1.0'?gt ltSOAP-ENVEnvelope
SOAP-ENC"http//schemas.xmlsoap.org/soap/encoding
/" SOAP-ENVencodingStyle"http//schemas.xm
lsoap.org/soap/encoding/"
xmlnsSOAP-ENV"http//schemas.xmlsoap.org/soap/en
velope/" xmlnsxsd"http//www.w3.org/1999/X
MLSchema" xmlnsxsi"http//www.w3.org/1999/
XMLSchema-instance"gt ltSOAP-ENVBodygt
ltaSquareResponse xmlnsa"http//192.168.123.124/
SOAP/square"gt ltSquaredValue
xsitype"xsddouble"gt 25
lt/SquaredValuegt lt/aSquareResponsegt
lt/SOAP-ENVBodygt lt/SOAP-ENVEnvelopegt
22
How can I run your SOAP methods?
  • You could tell me
  • Phone
  • Email
  • Documentation
  • Better use a standard for formally defining
    them
  • WSDL
  • Provided I can get your WSDL document, I can
    automatically build the interfaces to run your
    methods

23
WSDL
  • XML-based standard for defining a set of Web
    Services, eg
  • SOAP method(s)
  • Input parameters
  • Response structure
  • Endpoint URL
  • WSDL document is retrieved using HTTP

24
eXtc WSDL Import
lt?xml version'1.0'?gt ltdefinitions
name"CATrafficService" targetNamespace"http//ww
w.xmethods.net/sd /CATrafficService.wsdl"
xmlns"http//schemas.xmlsoap.org/wsdl/"
xmlnssoap"htt p//schemas.xmlsoap.org/wsdl/soap/
" xmlnstns"http//www.xmethods.net/sd/CATraf fic
Service.wsdl" xmlnsxsd"http//www.w3.org/1999/XM
LSchema"gt ltmessage name"getTrafficRequest"gt ltpart
name"hwynums" type"xsdstring"gt lt/partgt lt/messa
gegt ltmessage name"getTrafficResponse"gt ltpart
name"return" type"xsdstring"gt lt/partgt lt/message
gt ltportType name"CATrafficPortType"gt ltoperation
name"getTraffic"gt ltinput message"tnsgetTrafficR
equest" name"getTraffic"gt lt/inputgt ltoutput
message"tnsgetTrafficResponse"
name"getTrafficResponse"gt lt/outputgt lt/operationgt
lt/portTypegt ltbinding name"CATrafficBinding"
type"tnsCATrafficPortType"gt ltsoapbinding
style"rpc" transport"http//schemas.xmlsoap.org/
soap/http"gt lt/soapbindinggt ltoperation
name"getTraffic"gt ltsoapoperation
soapAction""gt lt/soapoperationgt ltinputgt ltsoapbod
y encodingStyle"http//schemas.xmlsoap.org/soap/e
ncoding/" namespace" urnxmethods-CATraffic"
use"encoded"gt lt/soapbodygt lt/inputgt ltoutputgt ltsoa
pbody encodingStyle"http//schemas.xmlsoap.org/s
oap/encoding/" namespace" urnxmethods-CATraffic"
use"encoded"gt lt/soapbodygt lt/outputgt lt/operation
gt lt/bindinggt ltservice name"CATrafficService"gt ltdo
cumentationgt Provides information on California
Highway Conditions. lt/documentationgt ltport
binding"tnsCATrafficBinding" name"CATrafficPort
"gt ltsoapaddress location"http//services.xmethod
s.net80/soap/servlet/rpcrouter"gt lt/soapaddressgt
lt/portgt lt/servicegt lt/definitionsgt
HTTP GET Request for WSDL document
To remote HTTP server
Parser
DOM Builder
From remote HTTP server
WSDL stored as XML DOM
25
Providing a Web Service
  • Caché extrinsic function/subroutine/method
  • New
  • Legacy business logic, maybe wrappered
  • eXtcs web-based WSDL builder
  • Web forms ask you to specify
  • SOAP method name
  • Caché function/method (creates dispatch linkage)
  • Input parameter names and data type details
  • WSDL document generated for you
  • The WSDL document is all a client needs to run
    your method(s)

26
Consuming others Web Services
  • Direct integration of a third-party web service
    into a Caché application, eg
  • Up to date currency conversion
  • Credit card authorisation
  • Credit rating checks
  • Medical procedure validation and pricing
  • Run behind the scenes user doesnt have to
    leave your application

27
eXtc Web Services Client
  • All you need to know is the URL of the
    third-party WSDL document
  • eXtc automates
  • Analysis of the WSDL what methods?
  • Builds the Caché ObjectScript code needed to run
    that method
  • Cut and paste into your application
  • You just provide the input parameter values
  • eXtc builds and sends the SOAP request
  • eXtc delivers you the SOAP response as a DOM
  • Use XPath or DOM API methods to extract the
    results
  • You can then use the results in your own
    application

28
eXtc WSDL Client
  • Very high level of interoperability
  • Full complex data type support
  • Tested against most of the Web Service examples
    at xmethods.net
  • M/Gateway is now providing a web service
    validator from our web site, using the eXtc
    client.
  • Test your web services from our client
  • View the raw SOAP requests and responses
  • Not even IONAs validator can match our
    interoperability. Quite simply the best Web
    Services client that is currently available!

29
eXtc Web Services Client
  • The most complex part of eXtc
  • WSDL documents are very difficult to analyse
  • Recursive references and pointers
  • Pointers start at the end of the document and
    work their way up to the top
  • Complex data type schemas
  • A DOM parser is the only practical solution
  • Single-step parsing stage
  • Random access for analysis
  • DOM provides ready-made structure for its storage
  • Cached as DOM for subsequent re-use

30
eXtc
  • A complete XML environment for the Caché
    programmer
  • Particularly well suited to XML-enabling legacy
    applications
  • Positions Caché as a Native XML Database
  • Fully compliant with W3C standards
  • Available today for all Caché versions
  • Free single-user version
  • http//www.mgateway.com

31
Special AnnouncementM/Gateway Developments
Ltdare proud to launchm_phpThe PHP to MUMPS
Gateway
32
m_php
  • PHP is now the de facto web application
    development environment
  • Over 7 million domains on the web using PHP
  • Huge numbers of PHP programmers
  • PHP provides similar features to CSP and WLD,
    but
  • No integral database
  • No Event Broker/ Hyper Events

33
m_php
  • PHPs scripting environment is very like M
  • Weakly typed
  • Associative arrays (allow text as subscripts)
  • Powerful string-handling functions
  • Similar immediacy in programming
  • No integral database, so relational databases (eg
    MySQL) are the norm, via SQL/ODBC
  • So database access means a discontinuity

34
The m_php Concept
  • Provide a simple and intuitive means of
    projecting PHP arrays in and out of globals
  • MUMPS as a persistence service for PHP
  • No discontinuity, retain the immediacy
  • Exploit the dynamic on demand nature of global
    manipulation
  • Merge arrays between PHP and MUMPS transparently
  • Simple PHP function calls
  • High performance, massive scalability

35
The m_php opportunity
  • Get that huge population of PHP programmers
    hooked on MUMPS, after which theyll begin to
    explore more of its capabilities
  • Exploit the very fact that MUMPS is different
    from the mainstream
  • perfect fit with the needs of PHP programmers

36
m_phps functionality
  • Direct access to globals (get, set, kill, order)
  • Bi-directional merge between PHP arrays and MUMPS
    globals
  • Ability to invoke an M function from PHP
  • Complex back-end interactions

37
m_php
  • Free single connection version
  • Unlimited version costs 50
  • Available tomorrow from http//www.mgateway.com
  • Lets get tens of thousands of PHP programmers
    turned on to the technology we all know is the
    worlds best kept secret!
Write a Comment
User Comments (0)
About PowerShow.com