Uniface User Conference



Similar documents
XML Processing and Web Services. Chapter 17

Developing a Web Server Platform with SAPI Support for AJAX RPC using JSON

High Performance XML Data Retrieval

Freight Tracking Web Service Implementation Guide

Types of Cloud Computing

Blue Cross Blue Shield of Michigan

Data Integration through XML/XSLT. Presenter: Xin Gu

NoSQL web apps. w/ MongoDB, Node.js, AngularJS. Dr. Gerd Jungbluth, NoSQL UG Cologne,

Introducing Apache Pivot. Greg Brown, Todd Volkert 6/10/2010

Sage CRM Connector Tool White Paper

GetFormatList. Webservice name: GetFormatList. Adress:

What is Distributed Annotation System?

An XML Based Data Exchange Model for Power System Studies

Table of Contents. Open-Xchange Authentication & Session Handling. 1.Introduction...3

Cache Configuration Reference

Course Name: Course in JSP Course Code: P5

XML in Programming 2, Web services

George McGeachie Metadata Matters Limited. ER SIG June 9th,

REST web services. Representational State Transfer Author: Nemanja Kojic

Structured vs. unstructured data. Motivation for self describing data. Enter semistructured data. Databases are highly structured

estatistik.core: COLLECTING RAW DATA FROM ERP SYSTEMS

4.2 Understand Microsoft ASP.NET Web Application Development

Real World Hadoop Use Cases

by LindaMay Patterson PartnerWorld for Developers, AS/400 January 2000

10CS73:Web Programming

Address Phone & Fax Internet

Drupal CMS for marketing sites

Normalization. Normalization. First goal: to eliminate redundant data. for example, don t storing the same data in more than one table

Introduction to XML Applications

General principles and architecture of Adlib and Adlib API. Petra Otten Manager Customer Support

database abstraction layer database abstraction layers in PHP Lukas Smith BackendMedia

WebSphere ESB Best Practices

How To Use Query Console

Associate Professor, Department of CSE, Shri Vishnu Engineering College for Women, Andhra Pradesh, India 2

Chapter 3: XML Namespaces

DataDirect XQuery Technical Overview

Quiz! Database Indexes. Index. Quiz! Disc and main memory. Quiz! How costly is this operation (naive solution)?

Web Services Technologies

Specific Simple Network Management Tools

Application of XML Tools for Enterprise-Wide RBAC Implementation Tasks

Apache Sling A REST-based Web Application Framework Carsten Ziegeler cziegeler@apache.org ApacheCon NA 2014

SCA-based Enterprise Service Bus WebSphere ESB

Qlik REST Connector Installation and User Guide

Change Management for XML, in XML

SSC - Web development Model-View-Controller for Java web application development

J j enterpririse. Oracle Application Express 3. Develop Native Oracle database-centric web applications quickly and easily with Oracle APEX

BASI DI DATI II 2 modulo Parte II: XML e namespaces. Prof. Riccardo Torlone Università Roma Tre

Creating an EAD Finding Aid. Nicole Wilkins. SJSU School of Library and Information Science. Libr 281. Professor Mary Bolin.

Raima Database Manager Version 14.0 In-memory Database Engine

CHAPTER 5: BUSINESS ANALYTICS

Dynamic Web Programming BUILDING WEB APPLICATIONS USING ASP.NET, AJAX AND JAVASCRIPT

Logix5000 Controllers Import/Export Project Components

YouTrack MPS case study

The BritNed Explicit Auction Management System. Kingdom Web Services Interfaces

What s New in IBM Web Experience Factory IBM Corporation

Progressive Enhancement With GQuery and GWT. Ray Cromwell

IBM Operational Decision Manager Version 8 Release 5. Getting Started with Business Rules

Modern XML applications

NoSQL and Agility. Why Document and Graph Stores Rock November 12th, 2015 COPYRIGHT 2015 MARKLOGIC CORPORATION. ALL RIGHTS RESERVED

Pre-authentication XXE vulnerability in the Services Drupal module

Treemap Visualisations

StreamServe Persuasion SP5 Document Broker Plus

Dev Guide for Encrypted Swipe

Introduction. Tom Dinkelaker, Ericsson Guido Salvaneschi, Mira Mezini, TUD

JBoss SOAP Web Services User Guide. Version: M5

PeopleSoft Query Training

The end. Carl Nettelblad

Common definitions and specifications for OMA REST interfaces

Middleware and the Internet. Example: Shopping Service. What could be possible? Service Oriented Architecture

Example. Represent this as XML

Introduction to Ingeniux Forms Builder. 90 minute Course CMSFB-V6 P

Ficha técnica de curso Código: IFCAD320a

Uniface Education Directory

Creating Database Tables in Microsoft SQL Server

LabVIEW Internet Toolkit User Guide

Commerce Services Documentation

CrownPeak Java Web Hosting. Version 0.20

Handling Exceptions. Schedule: Timing Topic 45 minutes Lecture 20 minutes Practice 65 minutes Total

Three Step Redirect API V2.0 Patent Pending

Apigee Gateway Specifications

Example for Using the PrestaShop Web Service : CRUD

SavvyDox Publishing Augmenting SharePoint and Office 365 Document Content Management Systems

Modernize your NonStop COBOL Applications with XML Thunder September 29, 2009 Mike Bonham, TIC Software John Russell, Canam Software

Listeners. Formats. Free Form. Formatted

White Paper BMC Remedy Action Request System Security

WORKING WITH WEB SERVICES. Rob Richards

Facebook: Cassandra. Smruti R. Sarangi. Department of Computer Science Indian Institute of Technology New Delhi, India. Overview Design Evaluation

Tutorial on Relational Database Design

WA2087 Programming Java SOAP and REST Web Services - WebSphere 8.0 / RAD 8.0. Student Labs. Web Age Solutions Inc.

Cloud Elements! Marketing Hub Provisioning and Usage Guide!

Programming Autodesk PLM 360 Using REST. Doug Redmond Software Engineer, Autodesk

Creating SOAP and REST Services and Web Clients with Ensemble

Last Week. XML (extensible Markup Language) HTML Deficiencies. XML Advantages. Syntax of XML DHTML. Applets. Modifying DOM Event bubbling

Portals and Hosted Files

XML: extensible Markup Language. Anabel Fraga

How To Write A Web Server In Javascript

MarkLogic Server. Application Developer s Guide. MarkLogic 8 February, Last Revised: 8.0-4, November, 2015

Web Design Technology

Developers Guide. Designs and Layouts HOW TO IMPLEMENT WEBSITE DESIGNS IN DYNAMICWEB. Version: English

Transcription:

Uniface User Conference Face2face Enhancing Uniface Web services Berry Kuijer Saat May 23, 2012

Agenda Transformation The Struct Applying Struct SOAP complex parameter support SOAP Header support SOAP Fault support

Challenge With the various formats used for Web Services we needed a solution that allowed us to interface with and transform to and from the objects and constructs used within Uniface. Plus it had to be fast and extensible

Challenges of formats Entity List XML HTML JSON Entity List XML HTML JSON

Transformation Challenges Naming conflicts Name casing (Upper/lowercase) Duplicate Names Data Type conflicts Entity/Occ/Field/Properties v.s. Element/Attributes Nesting (complex-types) Data Type incompatibilities (boolean T/F 1/0 Y/N) Huge Issue: Transformation can result in information loss!!!

Transformation solutions Declarative e.g. XSLT Source data Target data Transition definition Procedural Source data Transform code Transform code Transform code. Transform code Target data

Our Solution New Struct data type New proc translation instructions

What is Struct conceptual Procedural solution to resolve complex data transformation Source data Regular translation Target data Convert into Struct Convert from Struct Source data Transform Struct Transform Struct Transform Struct. Transform Struct Target data Retains origin attributes

What is Struct technical New data type in Proc language: struct A struct variable is a reference (handle) to a Structure A Structure is a collection of members in memory that are hierarchical organized A Structure is created once it is referenced A Structure is deleted once it references count is zero A Structure has no specification A struct variable has no specification A Structure is created dynamically (at runtime) A member of a Structure is either a node or a leave Every member can be directly addressed Every member can be created, moved, copied, deleted, renamed using Proc Leaves have a value that can be read and set using Proc variables struct uorder endvariables putmess uorder->$dbgstring [MYORDERFORM] [ORDER.SALES] [occ] [ORDER_ID] = "21EC2020" [DATE] = 20110801 [STATUS] = 2 [SHIP_TO] = "My house" [ORDERLINE.SALES] [occ] [LINE_ID] = "213A3AAB" [ITEM_NAME] = "Les Paul" [UNIT_PRICE] = 1200 [QUANTITY] = 1 [LINE_TOTAL] = 1200 [occ] [LINE_ID] = "1234FFFF" [ITEM_NAME] = "PHB Slater" [UNIT_PRICE] = 3225 [QUANTITY] = 2 [LINE_TOTAL] = 6450 [TOTAL] = 7650 quantity = uorder->myorderform->order.sales->occ{1}->orderline.sales->occ{2}->quantity ; quantity = 2

What is Struct technical A Structure can be inspected e.g. in the debugger A Structure can take any hierarchical format A component structure can be converted into a Structure and vice verse An XML stream can be converted into a Structure and vice verse When created by conversion, a member maintains information about what it originally was (member type + value type) This information can be get and set [ORDER.SALES] [$tags] [u_type] = "entity" <aaa> abc </aaa> [aaa] = "abc" [$tags] [xmlclass] = "element" [xmltypecategory] = "simple" [xmldatatype] = "string" [xmltypenamespace] = "http://www.w3.org/2001/xmlschema"

Supportive Proc Instructions XMLTOSTRUCT STRUCTTOXML STRUCTTOCOMPONENT COMPONENTTOSTRUCT FOR - NEXT

New Struct Functions $newstruct - Creates a struct member $collsize - Get the number of Structs in the collection $dbgstring - Get a string that represents the Struct collection. $index - Get or set the index of the Struct collection. $isleaf - Check whether a Struct is a Struct leaf $isscalar - Check whether a Struct is a scalar Struct. $istags - Check whether the Struct is a $tags Struct for another Struct $membercount - Get the number of members in a Struct. $name - Get the name of a Struct $parent - Get or set the parent of the Struct. $tags - Get or set annotations for a Struct.

Use a Struct in Proc Move members within its collection variables struct uorder endvariables uorder->order->occ{2}->$index = 1 OUTPUT = uorder->$dbgstring end [MYORDERFORM] [ORDER] [OCC] [ORDER_ID] = 1 [DATE] = 20110812 [SHIP_TO] = "Gerton" [OCC] [ORDER_ID] = 2 [DATE] = 20110813 [SHIP_TO] = "Kees" [MYORDERFORM] [ORDER] [OCC] [ORDER_ID] = 2 [DATE] = 20110813 [SHIP_TO] = "Kees" [OCC] [ORDER_ID] = 1 [DATE] = 20110812 [SHIP_TO] = "Gerton"

Use a Struct in Proc Conversion to component variables struct uorder endvariables uorder->$name = "<$componentname>" uorder->order = $newstruct uorder->order->occ = $newstruct uorder->order->occ->order_id = 1 uorder->order->occ->date = $date uorder->order->occ->ship_to = "Gerton" putmess uorder->$dbgstring structtocomponent uorder end [MYORDERFORM] [ORDER] [OCC] [ORDER_ID] = 1 [DATE] = 20110812 [SHIP_TO] = "Gerton"

Use a Struct in Proc Conversion from component and meta tags variables struct uorder Endvariables end retrieve componenttostruct uorder putmess uorder->$dbgstring [ORDERFORM] [$tags] [u_type] = "component" [ORDER.SALES] [$tags] [u_type] = "entity" [OCC] [$tags] [u_type] = "occurrence" [ORDER_ID] = "1" [$tags] [u_type] = "field" [DATE] = "20110105" [$tags] [u_type] = "field" [STATUS] = "02" [$tags] [u_type] = "field" [SHIP_TO] = "Gerton" [$tags] [u_type] = "field" [TOTAL]...

Use a Struct in Proc Conversion from XML and meta tags <?xml version="1.0"?> <Order> <OrderLine id="21ec2020"> Gibson Les Paul </OrderLine> <OrderLine> PHB Slater I </OrderLine> </Order> variables struct uorder endvariables xmltostruct uorder, $xml$ putmess uorder->$dbgstring [] [$tags] [xmlversion] = 1.0 [Order] [$tags] [xmlclass] = element [OrderLine] [$tags] [xmlclass] = element [id] = 21EC2020 [$tags] [xmlclass] = attribute [] = Gibson Les Paul [OrderLine] = PHB Slater I [$tags] [xmlclass] = element end

Application Where can we use Struct?

Application examples 9.5 Complex parameter support of Web Services complex parameters are created using Structs and then converted into XML to be passed as parameter and vice versa. (Struct supports XML schemas and all XML data types) Transformation of SOAP Headers and Messages SOAP headers are made available as XML and converted into STRUCT for processing and/or encryption Splitting and merging entities

Application in the future Complex data exchange between 4GL component instances the Struct is directly used as a parameter, both for component instances running in the same and in different processes. Serialization is done automatically and on demand. 3-Tier communication the 4GL developer already has a 3-tier application and wants to gradually replace xmlsave and xmlload statements (including all the DTDs and other overhead) with Struct constructions, where the Struct basically takes over the DTD and mapping administration Exchange of JavaScript objects between browser and server the serialized format of these JavaScript objects is JSON which can be converted into a Struct (on the server) for further processing. JavaScript objects are typically used in DSPs to exchange field properties and valreps, parameters and return values of custom JavaScript functions, parameters and return values of JavaScript functions of third party technology with a JS API (e.g. Google Maps) Replacement of expensive list processing The Uniface list is a String and therefore inefficient for any type of manipulation; the Struct is an ordered collection of references to individual data members in memory and therefore very efficient for any type manipulation Complex data exchange between functions/entries/operations the 4GL developer already has entries/operations that exchange complex data using lists and he wants to interact with those. The lists can be converted to Struct for further processing.

SOAP Support SOAP Call-out SOAP Header SOAP Fault

SOAP call-out No changes in the SOAP implementation of 9.5 Complex parameters are mapped to String (raw XML)

SOAP call-out Component SOAP call-out (activate) Field or variable IN (basic) Entity or Occurrence IN (1-level) Component Structure Field or variable To STRUCT Transform To XML IN (complex) OUT (basic) SOAP Request SOAP Response External Web Service Provider Entity or Occurrence OUT (1-level) Component Structure To Entity Transform To STRUCT OUT (complex)

entry getdetails params string porderid : IN endparams variables struct uorder, uconfirmation xmlstream xorder, xconfirmation endvariables ; Get data ORDER_ID.ORDER/init = porderid retrieve "ORDER" if ($status < 0) return -1 ; Transform data componenttostruct/one uorder, "ORDER.SALES" ; convert to STRUCT uorder->order->$name = "Order" ; rename entity uorder->*->ship_to->$name = "ShipTo" ; rename field uorder->*->order_id->$tags->xmlclass = attribute ; force to XML attribute iso. Element uorder->order->order_id->$name = "id" ; rename field structtoxml/schema uorder, xorder, "order.xsd ; convert to XML ; Activate (SOAP call-out) activate "SHOP_SERVICE".putOrder(xOrder, xconfirmation) ; IN-XML OUT-XML selectcase $procerror case "SOAP Fault returned"... case...... endselectcase ; Transform data xmltostruct/schema uconfirmation, xconfirmation, "confirmation.xsd if (uconfirmation->status = "OK") uconfirmation->status = "1" ; Set data STATUS.ORDER = uconfirmation->status store/e "ORDER" commit end

SOAP call-in Component SOAP call-in IN (basic) Field or variable IN (1-level) Entity or Occurrence External Web Service Consumer SOAP Request SOAP Response IN (complex) OUT (basic) To STRUCT Transform To Entity Component Structure Field or variable OUT (1-level) Entity or Occurrence OUT (complex) To XML Transform To STRUCT Component Structure

operation order params xmlstream xorder : IN ; some XML schema xmlstream xconfirmation : OUT ; some XML schema endparams variables struct uorder, uconfirmation endvariables ; transform data xmltostruct uorder, xorder uorder->$name = "ORDER.SALES" if (uorder->shipto!= uorder->billto) ; Unsupported -> return SOAP Fault return -1 endif ;... structtocomponent uorded ; Process... ORDER_ID = $uuid store commit ; generate result if ($status = 0) uconfirmation->orderstatus = "ordered" uconfirmation->orderid = ORDER_ID.ORDER.SALES else uconfirmation->orderstatus = "failed" ;... endif structtoxml xconfirmation, uconfirmation return 0 end

SOAP Header support <?xml version="1.0"?> <soap:envelope xmlns:soap="http://www.w3.org/2001/12/soapenvelope""> <soap:header> <transaction soap:mustunderstand="1 >234</transaction> </soap:header> <soap:body> <OrderForm> <Order id="21ec2020"> <Date>20110801</date> <Status>2</status> <Total>7650</Total> <ShipTo> My house Dreef 60 Amsterdam </ShipTo> <OrderLine id="1234ffff "> <Item> PHB Slater I </item> <UnitPrice>3225</UnitPrice> <Quantity>2</Quantity> <Total>6450</Total> </OrderLine> </Order> </OrderForm> </soap:body> </soap:envelope>

SOAP call-out call-back operations Component operation SOAP_CALLOUT_PRE Params xmlstream SOAP_Request : INOUT string component : IN string operation : IN Endparams ; Your Code here... End SOAP Request activate parameters SOAP call-out driver SOAP Response External Web Service Provider operation SOAP_CALLOUT_POST Params xmlstream SOAP_Response : INOUT string component : IN string operation : IN Endparams ; Your Code here... End

SOAP call-out call-back operations Call-back operation execution sequence: [DRIVER_SETTINGS] USYS$SOP_PARAMS = callback=svc1,svc2,svc3 ; overlaid with: [SERVICES_EXEC] MYSOAPCPT = $SOP:COMP1 callback=svc1,svc2

SOAP call-out call-back operations Component operation SOAP_CALLIN_PRE Params xmlstream SOAP_Request : INOUT string ServVars : IN Endparams ; Your Code here... End External Web Service Consumer SOAP Request SOAP Response SOAP call-in driver Parameters` operation myoper Params... Endparams ; My implmentation... end; operation SOAP_CALLIN_POST Params xmlstream SOAP_Response : INOUT Endparams ; Your Code here... End

SOAP call-in call-back operations Call-back operation execution sequence: [SETTINGS] $SOAP_CALLIN_CB = svc1, svc2, self, svc3 Where 'self' refers to the current activated instance

SOAP Fault support <?xml version="1.0"?> <soap:envelope xmlns:soap="http://www.w3.org/2001/12/soapenvelope""> <soap:header> <transaction soap:mustunderstand="1 >234</transaction> </soap:header> <soap:body> <soap:fault> <faultcode>soap-env:server</faultcode> <faultstring>server Error</faultstring> <detail> <myfaultdetails> <message> My application didn't work </message> <errorcode> 1001 </errorcode> <myfaultdetails> </detail> </soap:fault> </soap:body> </soap:envelope>

SOAP Fault support SOAP Fault automatically returned by SOAP call-in driver for any technical reasons Custom SOAP Faults can be returned using Struct and SOAP Call-back triggers (Use Proc to replace the SOAP Response with a SOAP Fault) Received SOAP Faults by SOAP call-out driver are available to Proc via $procerrorcontext

THANKS & QUESTIONS