SlideShare a Scribd company logo
1 of 11
MARKTECH LTD
Adobe Campaign Classic
Concept for storing data through ACC API
David Garcia
A proposal thatallowsdatato be sentthroughACC’sAPI(soaprouter.jsp) to store dataintocustomschemasusingJavaScriptlibrariesandcustomfunctionstohandle
requestsandstorage destination.
© David Garcia
Custom Schemas & WSDL Enrich API Library
Creating core reference custom schema
Create a customschema whichwill containcustommethodsthatwill extendourAPIandpointstothe javascriptlibrarywhich holdsall the post-processingcode tostore
the requestaccordingly,furthermore,thisschemawill logall entriesdestinedtounderlyingcustomschemas.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?xml version="1.0" encoding="UTF-8"?>
<srcSchema _cs="StoreEvent (cus)" created="2017-08-21 09:54:55.017Z"
createdBy-id="0" desc="StoreEvent" entitySchema="xtk:srcSchema" img="xtk:schema.png"
label="StoreEvent" labelSingular="StoreEvent" lastModified="2017-08-21 09:58:28.090Z" mappingType="sql"
md5="E47B48897224056C10DF42CE72E84434" modifiedBy-id="0" name="StoreEvent" namespace="cus" xtkschema="xtk:srcSchema">
<createdBy _cs="david garcia (david garcia)" />
<modifiedBy _cs="david garcia (david garcia)" /
<element autopk="true" desc="StoreEvent" label="StoreEvent" labelSingular="StoreEvent" name="StoreEvent">
<attribute label="origin" name="origin" type="string" />
<attribute label="destinationId" name="destinationId" type="int64" />
<attribute label="destinationSchema" name="destinationSchema" type="string" />
<attribute label="created" name="created" type="datetime" />
</element>
<methods>
<method library="cus:PushStoreEvent" name="PushStoreEvent" static="true">
<help>Insert an event.</help>
<parameters>
<param desc="Event." inout="in" name="domEvent" type="DOMDocument" />
<param desc="Status" inout="out" name="status" type="string" />
</parameters>
</method>
</methods>
</srcSchema>
lines15-23: declarationof methodsincustomschema.
library: value pointsto JavaScriptlibrarycontainingfunctionstoexecute.
name: value containingfunctiontoexecute.
© David Garcia
(WSDL) Web Service Definition Library
Once custom schemahasbeencreatedanddeployed,aWSDL file ismade available containingcustommethods andbindstoACC’sdefaultAPI.
© David Garcia
Custom Storage Schema(scores)
The followingschemawill store datadestinedfor scoresrequest.Lines22-26 definedan:1linkbetweenrequestsandrecipient,hence,arecipientcanbe assignedmultiple
scoresrecords.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<srcSchema _cs="scores (cus)" created="2017-08-17 09:57:51.933Z" createdBy-id="0"
desc="scores" entitySchema="xtk:srcSchema" img="xtk:activities/signal.png"
label="scores" labelSingular="scores" lastModified="2017-09-11 13:47:36.947Z"
mappingType="sql" md5="4F76944F562FC722DB77184831AFD129" modifiedBy-id="0"
name="scores" namespace="cus" xtkschema="xtk:srcSchema">
<createdBy _cs="david garcia (david garcia)"/>
<modifiedBy _cs="david garcia (david garcia)"/>
<element autopk="true" desc="scores" img="xtk:activities/signal.png" label="scores"
labelSingular="scores" name="scores">
<attribute label="member_id" name="member_id" type="int64"/>
<attribute label="score_id" name="score_id" type="string"/>
<attribute label="dateOfCompletion" name="dateOfCompletion" type="datetime"/>
<attribute label="dateOfRecurrence" name="dateOfRecurrence" type="datetime"/>
<attribute label="percentageComplete" name="percentageComplete" type="long"/>
<attribute label="status" name="status" type="string"/>
<attribute label="created" name="created" type="datetime"/>
<element integrity="define" label="scores-recipient" name="scores-recipient"
target="nms:recipient" type="link">
<join xpath-dst="@member_id" xpath-src="@member_id"/>
</element>
</element>
</srcSchema>
Member_idservesasa key and will be usedtocreate a joinbetweenthisschemaandrecipient schema;anadditional index canbe addedonthisfieldforperformance.
1
2
3
<dbindex name="member_id" unique="false">
<keyfield xpath="@member_id"/>
</dbindex>
© David Garcia
JavaScript Libraries & Functions
JavaScript Libraries (cus:PushStoreEvent)
The followingscriptisexecuteduponreceivingSOAPrequestcontains cus:StoreEvent#PushStoreEventasAction.Itloadsan extralibrarycontainingwritingmethodsforto
handle multiple customstorage schemas.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
//reference functions which write data into tables
loadLibrary("cus:storeFunctions");
//function to parse SOAP request
function cus_StoreEvent_PushStoreEvent(request)
{
var xmlMessage = new XML(request);
var schema = xmlMessage.schema;
var created = formatDate(new Date(), '%4Y-%2M-%2D %2H:%2N:%2S');
var origin = xmlMessage.origin;
if (schema = "scores") {
storeScores(xmlMessage);
}
//return primary key of inserted record
var latestEntry = sqlSelect("Records,id:string","SELECT MAX(i"+schema+"id) as newRecord FROM cus"+schema+" where
tscreated='"+created+"'");
//log request
xtk.session.Write(<StoreEvent xtkschema="cus:StoreEvent" origin ={origin} destinationSchema ={schema} destinationId
={latestEntry.Records.id} created ={created} _operation="insert" />);
/**debug var f = new File("c:/file.txt")
f.open("a")
f.writeln(xmlMessage.toXMLString())
f.close()
**/
//return request response
return("success:"+schema+":"+latestEntry.Records.id);
}
© David Garcia
JavaScript Libraries (cus:storeFunctions)
The followingfunctionisexecutedandreferencedbycus:PushStoreEvent upontrue conditionmet if(schema= "scores") {storeScores(xmlMessage);}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
function storeScores(xmlMessage)
{
var MEMBER_ID = parseInt(xmlMessage.member_id);
var SCORE_ID = xmlMessage.score_id;
var DATE_OF_COMPLETION = xmlMessage.dateOfCompletion;
var DATE_OF_RECURRENCE = xmlMessage.dateOfRecurrence;
var PERCENTAGE_COMPLETED = xmlMessage.percentageComplete;
var STATUS = xmlMessage.status
var CREATED = formatDate(new Date(), '%4Y-%2M-%2D %2H:%2N:%2S');
xtk.session.Write(<scores xtkschema="cus:scores" member_id ={MEMBER_ID}
score_id ={SCORE_ID}
dateOfCompletion ={DATE_OF_COMPLETION}
dateOfRecurrence ={DATE_OF_RECURRENCE}
percentageComplete ={PERCENTAGE_COMPLETED}
status ={STATUS}
created ={CREATED}
_operation="insert" />);
}
Write isa data APImethodthatallowsACCto store data intoschemas,inthiscase,data parsedfromthe SOAPrequestisconverted intoanXML objectandnode valuesare
assignedtolocal variables,consecutivelywrittenintothe customschema named“scores”.
© David Garcia
SOAP Request, Client & Database
SOAP Format Structure
The followingSOAPcall requestsdatacontainedinthe ctx contexttobe storedina customschemacalled“scores”.The methodtotriggeristhe value inthe SOAPAction
optionprovidedbythe SOAPclientandthe endpoint isthe followingURL inline 1 which representsACC’s API.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
POST http://ec2-18-222-255-12.us-east-2.compute.amazonaws.com/nl/jsp/soaprouter.jsp HTTP/1.1
Content-Type: text/xml; charset=utf-8
SOAPAction: cus:StoreEvent#PushStoreEvent
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:cus:StoreEvent">
<soapenv:Header/>
<soapenv:Body>
<urn:PushStoreEvent>
<urn:sessiontoken>AC7/PW</urn:sessiontoken>
<urn:domEvent>
<ctx>
<origin>scoreMicroService</origin>
<schema>scores</schema>
<member_id>5316191164430650570</member_id>
<score_id>1</score_id>
<dateOfCompletion>2019-04-03T09:00:00</dateOfCompletion>
<dateOfRecurrence>2019-04-03T09:00:00</dateOfRecurrence>
<percentageComplete>50</percentageComplete>
<status>1</status>
</ctx>
</urn:domEvent>
</urn:PushStoreEvent>
</soapenv:Body>
</soapenv:Envelope>
© David Garcia
SOAP response
Once ACC’sAPIconsumesthe request,itreturnsthe destinationschemaandthe primarykeyof the recordinserted;thisishandledbythe JavaScriptlibrary
cus:PushStoreEvent
© David Garcia
Schema Table Records
Recordsof logsstoredinthe StoreEvent reference core table
Recordsof data storedfromsoaprequeststocustom scoresschema
© David Garcia
Database Table Records
Recordsas seenonthe postgresdatabase forcus:StoreEventschema
© David Garcia
Conclusion
The proof of conceptservesasa pointof entryfor data meantto be storedto customschemasinAdobe CampaignClassic,customJavaScriptlibrariescanbe extendedto
cater for multiplecustomtablesandrequestscanbe processedinparallel.

More Related Content

What's hot

Digital Marketing for B2B:
 Introduction and Steps to Get Started.
Digital Marketing for B2B:
 Introduction and Steps to Get Started.Digital Marketing for B2B:
 Introduction and Steps to Get Started.
Digital Marketing for B2B:
 Introduction and Steps to Get Started.Thomas Webster
 
Digital Marketing Agency- Pegalogics Business Plan and Proposal
Digital Marketing Agency- Pegalogics Business Plan and ProposalDigital Marketing Agency- Pegalogics Business Plan and Proposal
Digital Marketing Agency- Pegalogics Business Plan and ProposalPegaLogic Solutions Pvt. Ltd.
 
Google case study
Google case studyGoogle case study
Google case studystacian
 
sitagliptin for diabetics
sitagliptin for diabeticssitagliptin for diabetics
sitagliptin for diabeticsMahmoud Yossof
 
Recent advances in treatment of diabetics mellitus
Recent advances in  treatment of diabetics mellitusRecent advances in  treatment of diabetics mellitus
Recent advances in treatment of diabetics mellitusDineshk117
 
Generic Moxifloxacin Hydrochloride Tablets (Moxif)
Generic Moxifloxacin Hydrochloride Tablets (Moxif) Generic Moxifloxacin Hydrochloride Tablets (Moxif)
Generic Moxifloxacin Hydrochloride Tablets (Moxif) Clearsky Pharmacy
 
Case study presentation on DM-II (1).pptx
Case study presentation on DM-II (1).pptxCase study presentation on DM-II (1).pptx
Case study presentation on DM-II (1).pptxHozanBurhan
 
5 steps to promote your school's open house through social media
5 steps to promote your school's open house through social media5 steps to promote your school's open house through social media
5 steps to promote your school's open house through social mediaHigher Education Marketing
 
Product Profile for Dapagliflozin
Product Profile for DapagliflozinProduct Profile for Dapagliflozin
Product Profile for DapagliflozinPranay Kumar
 

What's hot (12)

glyxambi
glyxambiglyxambi
glyxambi
 
Digital Marketing for B2B:
 Introduction and Steps to Get Started.
Digital Marketing for B2B:
 Introduction and Steps to Get Started.Digital Marketing for B2B:
 Introduction and Steps to Get Started.
Digital Marketing for B2B:
 Introduction and Steps to Get Started.
 
Digital Marketing Agency- Pegalogics Business Plan and Proposal
Digital Marketing Agency- Pegalogics Business Plan and ProposalDigital Marketing Agency- Pegalogics Business Plan and Proposal
Digital Marketing Agency- Pegalogics Business Plan and Proposal
 
Google case study
Google case studyGoogle case study
Google case study
 
sitagliptin for diabetics
sitagliptin for diabeticssitagliptin for diabetics
sitagliptin for diabetics
 
Recent advances in treatment of diabetics mellitus
Recent advances in  treatment of diabetics mellitusRecent advances in  treatment of diabetics mellitus
Recent advances in treatment of diabetics mellitus
 
Generic Moxifloxacin Hydrochloride Tablets (Moxif)
Generic Moxifloxacin Hydrochloride Tablets (Moxif) Generic Moxifloxacin Hydrochloride Tablets (Moxif)
Generic Moxifloxacin Hydrochloride Tablets (Moxif)
 
Case study presentation on DM-II (1).pptx
Case study presentation on DM-II (1).pptxCase study presentation on DM-II (1).pptx
Case study presentation on DM-II (1).pptx
 
IDF DIABETES ATLAS
IDF DIABETES ATLASIDF DIABETES ATLAS
IDF DIABETES ATLAS
 
Digital marketing portfolio
Digital marketing portfolioDigital marketing portfolio
Digital marketing portfolio
 
5 steps to promote your school's open house through social media
5 steps to promote your school's open house through social media5 steps to promote your school's open house through social media
5 steps to promote your school's open house through social media
 
Product Profile for Dapagliflozin
Product Profile for DapagliflozinProduct Profile for Dapagliflozin
Product Profile for Dapagliflozin
 

Similar to Neolane API Custom SOAP request handler

Kick your database_to_the_curb_reston_08_27_19
Kick your database_to_the_curb_reston_08_27_19Kick your database_to_the_curb_reston_08_27_19
Kick your database_to_the_curb_reston_08_27_19confluent
 
KSQL - Stream Processing simplified!
KSQL - Stream Processing simplified!KSQL - Stream Processing simplified!
KSQL - Stream Processing simplified!Guido Schmutz
 
Running Vue Storefront in production (PWA Magento webshop)
Running Vue Storefront in production (PWA Magento webshop)Running Vue Storefront in production (PWA Magento webshop)
Running Vue Storefront in production (PWA Magento webshop)Vendic Magento, PWA & Marketing
 
Data processing platforms architectures with Spark, Mesos, Akka, Cassandra an...
Data processing platforms architectures with Spark, Mesos, Akka, Cassandra an...Data processing platforms architectures with Spark, Mesos, Akka, Cassandra an...
Data processing platforms architectures with Spark, Mesos, Akka, Cassandra an...Anton Kirillov
 
Webpack Encore - Asset Management for the rest of us
Webpack Encore - Asset Management for the rest of usWebpack Encore - Asset Management for the rest of us
Webpack Encore - Asset Management for the rest of usStefan Adolf
 
2013 05-openstack-israel-heat
2013 05-openstack-israel-heat2013 05-openstack-israel-heat
2013 05-openstack-israel-heatAlex Heneveld
 
Javascript frameworks: Backbone.js
Javascript frameworks: Backbone.jsJavascript frameworks: Backbone.js
Javascript frameworks: Backbone.jsSoós Gábor
 
Rails 6 frontend frameworks
Rails 6 frontend frameworksRails 6 frontend frameworks
Rails 6 frontend frameworksEric Guo
 
(2018) Webpack Encore - Asset Management for the rest of us
(2018) Webpack Encore - Asset Management for the rest of us(2018) Webpack Encore - Asset Management for the rest of us
(2018) Webpack Encore - Asset Management for the rest of usStefan Adolf
 
Cutting Edge Data Processing with PHP & XQuery
Cutting Edge Data Processing with PHP & XQueryCutting Edge Data Processing with PHP & XQuery
Cutting Edge Data Processing with PHP & XQueryWilliam Candillon
 
Azure Day Reloaded 2019 - ARM Template workshop
Azure Day Reloaded 2019 - ARM Template workshopAzure Day Reloaded 2019 - ARM Template workshop
Azure Day Reloaded 2019 - ARM Template workshopMarco Obinu
 
RESTful Web Applications with Apache Sling
RESTful Web Applications with Apache SlingRESTful Web Applications with Apache Sling
RESTful Web Applications with Apache SlingBertrand Delacretaz
 
RMG203 Cloud Infrastructure and Application Monitoring with Amazon CloudWatch...
RMG203 Cloud Infrastructure and Application Monitoring with Amazon CloudWatch...RMG203 Cloud Infrastructure and Application Monitoring with Amazon CloudWatch...
RMG203 Cloud Infrastructure and Application Monitoring with Amazon CloudWatch...Amazon Web Services
 
Embracing Serverless Ops (Lightning Talk)
Embracing Serverless Ops (Lightning Talk)Embracing Serverless Ops (Lightning Talk)
Embracing Serverless Ops (Lightning Talk)Erica Windisch
 
How to build a html5 websites.v1
How to build a html5 websites.v1How to build a html5 websites.v1
How to build a html5 websites.v1Bitla Software
 
Node Summit 2018 - Optimize your Lambda functions
Node Summit 2018 - Optimize your Lambda functionsNode Summit 2018 - Optimize your Lambda functions
Node Summit 2018 - Optimize your Lambda functionsMatt Lavin
 
Soa development using javascript
Soa development using javascriptSoa development using javascript
Soa development using javascriptDsixE Inc
 
Example R usage for oracle DBA UKOUG 2013
Example R usage for oracle DBA UKOUG 2013Example R usage for oracle DBA UKOUG 2013
Example R usage for oracle DBA UKOUG 2013BertrandDrouvot
 
(DEV204) Building High-Performance Native Cloud Apps In C++
(DEV204) Building High-Performance Native Cloud Apps In C++(DEV204) Building High-Performance Native Cloud Apps In C++
(DEV204) Building High-Performance Native Cloud Apps In C++Amazon Web Services
 
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)Igor Bronovskyy
 

Similar to Neolane API Custom SOAP request handler (20)

Kick your database_to_the_curb_reston_08_27_19
Kick your database_to_the_curb_reston_08_27_19Kick your database_to_the_curb_reston_08_27_19
Kick your database_to_the_curb_reston_08_27_19
 
KSQL - Stream Processing simplified!
KSQL - Stream Processing simplified!KSQL - Stream Processing simplified!
KSQL - Stream Processing simplified!
 
Running Vue Storefront in production (PWA Magento webshop)
Running Vue Storefront in production (PWA Magento webshop)Running Vue Storefront in production (PWA Magento webshop)
Running Vue Storefront in production (PWA Magento webshop)
 
Data processing platforms architectures with Spark, Mesos, Akka, Cassandra an...
Data processing platforms architectures with Spark, Mesos, Akka, Cassandra an...Data processing platforms architectures with Spark, Mesos, Akka, Cassandra an...
Data processing platforms architectures with Spark, Mesos, Akka, Cassandra an...
 
Webpack Encore - Asset Management for the rest of us
Webpack Encore - Asset Management for the rest of usWebpack Encore - Asset Management for the rest of us
Webpack Encore - Asset Management for the rest of us
 
2013 05-openstack-israel-heat
2013 05-openstack-israel-heat2013 05-openstack-israel-heat
2013 05-openstack-israel-heat
 
Javascript frameworks: Backbone.js
Javascript frameworks: Backbone.jsJavascript frameworks: Backbone.js
Javascript frameworks: Backbone.js
 
Rails 6 frontend frameworks
Rails 6 frontend frameworksRails 6 frontend frameworks
Rails 6 frontend frameworks
 
(2018) Webpack Encore - Asset Management for the rest of us
(2018) Webpack Encore - Asset Management for the rest of us(2018) Webpack Encore - Asset Management for the rest of us
(2018) Webpack Encore - Asset Management for the rest of us
 
Cutting Edge Data Processing with PHP & XQuery
Cutting Edge Data Processing with PHP & XQueryCutting Edge Data Processing with PHP & XQuery
Cutting Edge Data Processing with PHP & XQuery
 
Azure Day Reloaded 2019 - ARM Template workshop
Azure Day Reloaded 2019 - ARM Template workshopAzure Day Reloaded 2019 - ARM Template workshop
Azure Day Reloaded 2019 - ARM Template workshop
 
RESTful Web Applications with Apache Sling
RESTful Web Applications with Apache SlingRESTful Web Applications with Apache Sling
RESTful Web Applications with Apache Sling
 
RMG203 Cloud Infrastructure and Application Monitoring with Amazon CloudWatch...
RMG203 Cloud Infrastructure and Application Monitoring with Amazon CloudWatch...RMG203 Cloud Infrastructure and Application Monitoring with Amazon CloudWatch...
RMG203 Cloud Infrastructure and Application Monitoring with Amazon CloudWatch...
 
Embracing Serverless Ops (Lightning Talk)
Embracing Serverless Ops (Lightning Talk)Embracing Serverless Ops (Lightning Talk)
Embracing Serverless Ops (Lightning Talk)
 
How to build a html5 websites.v1
How to build a html5 websites.v1How to build a html5 websites.v1
How to build a html5 websites.v1
 
Node Summit 2018 - Optimize your Lambda functions
Node Summit 2018 - Optimize your Lambda functionsNode Summit 2018 - Optimize your Lambda functions
Node Summit 2018 - Optimize your Lambda functions
 
Soa development using javascript
Soa development using javascriptSoa development using javascript
Soa development using javascript
 
Example R usage for oracle DBA UKOUG 2013
Example R usage for oracle DBA UKOUG 2013Example R usage for oracle DBA UKOUG 2013
Example R usage for oracle DBA UKOUG 2013
 
(DEV204) Building High-Performance Native Cloud Apps In C++
(DEV204) Building High-Performance Native Cloud Apps In C++(DEV204) Building High-Performance Native Cloud Apps In C++
(DEV204) Building High-Performance Native Cloud Apps In C++
 
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
 

Recently uploaded

SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
 

Recently uploaded (20)

SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
 

Neolane API Custom SOAP request handler

  • 1. MARKTECH LTD Adobe Campaign Classic Concept for storing data through ACC API David Garcia A proposal thatallowsdatato be sentthroughACC’sAPI(soaprouter.jsp) to store dataintocustomschemasusingJavaScriptlibrariesandcustomfunctionstohandle requestsandstorage destination.
  • 2. © David Garcia Custom Schemas & WSDL Enrich API Library Creating core reference custom schema Create a customschema whichwill containcustommethodsthatwill extendourAPIandpointstothe javascriptlibrarywhich holdsall the post-processingcode tostore the requestaccordingly,furthermore,thisschemawill logall entriesdestinedtounderlyingcustomschemas. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 <?xml version="1.0" encoding="UTF-8"?> <srcSchema _cs="StoreEvent (cus)" created="2017-08-21 09:54:55.017Z" createdBy-id="0" desc="StoreEvent" entitySchema="xtk:srcSchema" img="xtk:schema.png" label="StoreEvent" labelSingular="StoreEvent" lastModified="2017-08-21 09:58:28.090Z" mappingType="sql" md5="E47B48897224056C10DF42CE72E84434" modifiedBy-id="0" name="StoreEvent" namespace="cus" xtkschema="xtk:srcSchema"> <createdBy _cs="david garcia (david garcia)" /> <modifiedBy _cs="david garcia (david garcia)" / <element autopk="true" desc="StoreEvent" label="StoreEvent" labelSingular="StoreEvent" name="StoreEvent"> <attribute label="origin" name="origin" type="string" /> <attribute label="destinationId" name="destinationId" type="int64" /> <attribute label="destinationSchema" name="destinationSchema" type="string" /> <attribute label="created" name="created" type="datetime" /> </element> <methods> <method library="cus:PushStoreEvent" name="PushStoreEvent" static="true"> <help>Insert an event.</help> <parameters> <param desc="Event." inout="in" name="domEvent" type="DOMDocument" /> <param desc="Status" inout="out" name="status" type="string" /> </parameters> </method> </methods> </srcSchema> lines15-23: declarationof methodsincustomschema. library: value pointsto JavaScriptlibrarycontainingfunctionstoexecute. name: value containingfunctiontoexecute.
  • 3. © David Garcia (WSDL) Web Service Definition Library Once custom schemahasbeencreatedanddeployed,aWSDL file ismade available containingcustommethods andbindstoACC’sdefaultAPI.
  • 4. © David Garcia Custom Storage Schema(scores) The followingschemawill store datadestinedfor scoresrequest.Lines22-26 definedan:1linkbetweenrequestsandrecipient,hence,arecipientcanbe assignedmultiple scoresrecords. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 <srcSchema _cs="scores (cus)" created="2017-08-17 09:57:51.933Z" createdBy-id="0" desc="scores" entitySchema="xtk:srcSchema" img="xtk:activities/signal.png" label="scores" labelSingular="scores" lastModified="2017-09-11 13:47:36.947Z" mappingType="sql" md5="4F76944F562FC722DB77184831AFD129" modifiedBy-id="0" name="scores" namespace="cus" xtkschema="xtk:srcSchema"> <createdBy _cs="david garcia (david garcia)"/> <modifiedBy _cs="david garcia (david garcia)"/> <element autopk="true" desc="scores" img="xtk:activities/signal.png" label="scores" labelSingular="scores" name="scores"> <attribute label="member_id" name="member_id" type="int64"/> <attribute label="score_id" name="score_id" type="string"/> <attribute label="dateOfCompletion" name="dateOfCompletion" type="datetime"/> <attribute label="dateOfRecurrence" name="dateOfRecurrence" type="datetime"/> <attribute label="percentageComplete" name="percentageComplete" type="long"/> <attribute label="status" name="status" type="string"/> <attribute label="created" name="created" type="datetime"/> <element integrity="define" label="scores-recipient" name="scores-recipient" target="nms:recipient" type="link"> <join xpath-dst="@member_id" xpath-src="@member_id"/> </element> </element> </srcSchema> Member_idservesasa key and will be usedtocreate a joinbetweenthisschemaandrecipient schema;anadditional index canbe addedonthisfieldforperformance. 1 2 3 <dbindex name="member_id" unique="false"> <keyfield xpath="@member_id"/> </dbindex>
  • 5. © David Garcia JavaScript Libraries & Functions JavaScript Libraries (cus:PushStoreEvent) The followingscriptisexecuteduponreceivingSOAPrequestcontains cus:StoreEvent#PushStoreEventasAction.Itloadsan extralibrarycontainingwritingmethodsforto handle multiple customstorage schemas. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 //reference functions which write data into tables loadLibrary("cus:storeFunctions"); //function to parse SOAP request function cus_StoreEvent_PushStoreEvent(request) { var xmlMessage = new XML(request); var schema = xmlMessage.schema; var created = formatDate(new Date(), '%4Y-%2M-%2D %2H:%2N:%2S'); var origin = xmlMessage.origin; if (schema = "scores") { storeScores(xmlMessage); } //return primary key of inserted record var latestEntry = sqlSelect("Records,id:string","SELECT MAX(i"+schema+"id) as newRecord FROM cus"+schema+" where tscreated='"+created+"'"); //log request xtk.session.Write(<StoreEvent xtkschema="cus:StoreEvent" origin ={origin} destinationSchema ={schema} destinationId ={latestEntry.Records.id} created ={created} _operation="insert" />); /**debug var f = new File("c:/file.txt") f.open("a") f.writeln(xmlMessage.toXMLString()) f.close() **/ //return request response return("success:"+schema+":"+latestEntry.Records.id); }
  • 6. © David Garcia JavaScript Libraries (cus:storeFunctions) The followingfunctionisexecutedandreferencedbycus:PushStoreEvent upontrue conditionmet if(schema= "scores") {storeScores(xmlMessage);} 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 function storeScores(xmlMessage) { var MEMBER_ID = parseInt(xmlMessage.member_id); var SCORE_ID = xmlMessage.score_id; var DATE_OF_COMPLETION = xmlMessage.dateOfCompletion; var DATE_OF_RECURRENCE = xmlMessage.dateOfRecurrence; var PERCENTAGE_COMPLETED = xmlMessage.percentageComplete; var STATUS = xmlMessage.status var CREATED = formatDate(new Date(), '%4Y-%2M-%2D %2H:%2N:%2S'); xtk.session.Write(<scores xtkschema="cus:scores" member_id ={MEMBER_ID} score_id ={SCORE_ID} dateOfCompletion ={DATE_OF_COMPLETION} dateOfRecurrence ={DATE_OF_RECURRENCE} percentageComplete ={PERCENTAGE_COMPLETED} status ={STATUS} created ={CREATED} _operation="insert" />); } Write isa data APImethodthatallowsACCto store data intoschemas,inthiscase,data parsedfromthe SOAPrequestisconverted intoanXML objectandnode valuesare assignedtolocal variables,consecutivelywrittenintothe customschema named“scores”.
  • 7. © David Garcia SOAP Request, Client & Database SOAP Format Structure The followingSOAPcall requestsdatacontainedinthe ctx contexttobe storedina customschemacalled“scores”.The methodtotriggeristhe value inthe SOAPAction optionprovidedbythe SOAPclientandthe endpoint isthe followingURL inline 1 which representsACC’s API. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 POST http://ec2-18-222-255-12.us-east-2.compute.amazonaws.com/nl/jsp/soaprouter.jsp HTTP/1.1 Content-Type: text/xml; charset=utf-8 SOAPAction: cus:StoreEvent#PushStoreEvent <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:cus:StoreEvent"> <soapenv:Header/> <soapenv:Body> <urn:PushStoreEvent> <urn:sessiontoken>AC7/PW</urn:sessiontoken> <urn:domEvent> <ctx> <origin>scoreMicroService</origin> <schema>scores</schema> <member_id>5316191164430650570</member_id> <score_id>1</score_id> <dateOfCompletion>2019-04-03T09:00:00</dateOfCompletion> <dateOfRecurrence>2019-04-03T09:00:00</dateOfRecurrence> <percentageComplete>50</percentageComplete> <status>1</status> </ctx> </urn:domEvent> </urn:PushStoreEvent> </soapenv:Body> </soapenv:Envelope>
  • 8. © David Garcia SOAP response Once ACC’sAPIconsumesthe request,itreturnsthe destinationschemaandthe primarykeyof the recordinserted;thisishandledbythe JavaScriptlibrary cus:PushStoreEvent
  • 9. © David Garcia Schema Table Records Recordsof logsstoredinthe StoreEvent reference core table Recordsof data storedfromsoaprequeststocustom scoresschema
  • 10. © David Garcia Database Table Records Recordsas seenonthe postgresdatabase forcus:StoreEventschema
  • 11. © David Garcia Conclusion The proof of conceptservesasa pointof entryfor data meantto be storedto customschemasinAdobe CampaignClassic,customJavaScriptlibrariescanbe extendedto cater for multiplecustomtablesandrequestscanbe processedinparallel.