SlideShare ist ein Scribd-Unternehmen logo
1 von 15
Downloaden Sie, um offline zu lesen
Building Callouts without WSDL2Apex
or Apex Parser
Ming Yuan
Solution Architect
Zurich North America
Welcome
Zurich Insurance Group (Zurich) is a leading multi-line insurance provider with a global network of
subsidiaries and offices in Europe, North America, Latin America, Asia-Pacific and the Middle East as
well as other markets. For more information about the products and services it offers and people
Zurich employs around the world, go to http://www.zurichna.com/zna/aboutzurich/zna-home.htm.
In North America, Zurich (www.zurichna.com) is a leading commercial property-casualty insurance
provider serving the global corporate, large corporate, middle markets, specialties and programs
sectors. In addition, Zurich also offers life insurance products and services. 2012 marks Zurich’s 100
year anniversary of insuring America and the success of its customers, shareholders and employees.
Further information about Zurich’s 100 year anniversary of insuring America is available at
http://www.zurichna.com/100.
Architecture Landscape
• SFDC is the strategic platform to provide single-pane-of-glass user experience
• Service-Oriented Architecture established enterprise-wide
– SFDC exchanges data with on-premise applications via Enterprise Service Bus (ESB)
EnterpriseServiceBus
The Challenge is..
• Existing service contracts (defined in WSDLs) are based on IBM’s Industry Model
for Insurance
• These WSDLs uncovered some limitations of the WSDL2Apex tool
– Unsupported data types
– Complex namespace inheritance structure
– Multiple XSD imports into a single WSDL; otherwise a consolidated WSDL may exceed size limit
• Known workaround options didn’t work well
– Manually trim down each WSDL to fit in WSDL2Apex
– Develop custom APEX parser per service
POC: WSDL2Apex Stub vs. Framework
Results captured, with permissions to use, from http://www.villagechief.com/product/codescan
Overview of the Framework
• An abstract base class for requests
– Represents all type of requests
– Allows developers to inject logic to generate actual XML requests
• A generic XML parser class
– Parses XML stream into Map structures
• A common response class
– Checks the status of invocation
– Manages the Maps (containing data and metadata)
– Retrieves values using XPath-like keys
Sample Request Class – Per Service Endpoint
public class WeatherRequest extends EasySOARequest {
private String zipCode = ‘’;
public WeatherRequest() {
super();
httpMethod = 'POST';
endpoint = 'http://wsf.cdyne.com/WeatherWS/Weather.asmx';
headers.put('Content-Type', 'text/xml; charset=utf-8');
timeOut = 120000;
}
public void setZipCode(String s) {zipcode = s;}
public override String getPayload() {
return getSOAPRequest(‘<GetCityForecastByZIP><ZIP>’ + zipcode +
‘</ZIP></GetCityForecastByZIP>‘);
}
}
/ForecastReturn/State
/ForecastReturn/City
/ForecastReturn/WeatherStationCity
/ForecastReturn/ForecastResult/Forecast/Date
/ForecastReturn/ForecastResult/Forecast/WeatherID
/ForecastReturn/ForecastResult/Forecast/Description
/ForecastReturn/ForecastResult/Forecast__1/Date
/ForecastReturn/ForecastResult/Forecast__1/WeatherID
/ForecastReturn/ForecastResult/Forecast__1/Description
Keys for data storage
/ForecastReturn/State
/ForecastReturn/City
/ForecastReturn/WeatherStationCity
/ForecastReturn/ForecastResult/Forecast/Date (/0/0/0/0)
/ForecastReturn/ForecastResult/Forecast/WeatherID (/0/0/0/0)
/ForecastReturn/ForecastResult/Forecast/Description (/0/0/0/0)
/ForecastReturn/ForecastResult/Forecast/Date (/0/0/1/0)
/ForecastReturn/ForecastResult/Forecast/WeatherID (/0/0/1/0)
/ForecastReturn/ForecastResult/Forecast/Description (/0/0/1/0)
Keys for data retrieval
The Generic Parse – from XML to Maps
<ForecastReturn>
<State>IL</State>
<City>Arlington Heights</City>
<WeatherStationCity>
Waukegan
</WeatherStationCity>
<ForecastResult>
<Forecast>
<Date>
2014-08-14T00:00:00
</Date>
<WeatherID>4</WeatherID>
<Description>
Sunny
</Description>
</Forecast>
<Forecast>
<Date>
2014-08-15T00:00:00
</Date>
<WeatherID>2</WeatherID>
<Description>
Partly Cloudy
</Description>
</Forecast>
</ForecastResult>
</ForecastReturn>
The Response Class – Data Retrieval
• Simple responses
– response.retrieveElement(xpath)
– response.retrieveElements(List<String> xpaths)
• Responses with collections
– response.getNumberOfSiblings(xpath)
– response.getNumberOfSiblings(xpath, indexpath)
– response.retrieveElement(xpath, indexpath)
– response.retrieveImmediateValuesInCollection(xpath, indexpath)
– response.retrieveUniqueValuesInCollection(xpath, indexpath)
– response.retrieveAllValuesInCollection(xpath, indexpath)
– response.retrieveValuesFromSiblings(xpath, indexpath)
• Advanced methods
– response.createNewSObject(String name, Map<String, String> mappings)
– response.createNewSObject(String name, Map<String, String> mappings, List<String> defaults)
– response.populateFields(SObject s, Map<String, String> mappings)
– response.populateFields(SObject s, Map<String, String> mappings, List<String> defaults)
• Backdoor method for development
– response.debugAndLog()
How the Framework Works..
2: populateReqData
4: callout
6: isValid
8: retrieveElements
Sample Invoker Class – Pattern-Based Development
// initiate a request object
WeatherRequest req = new WeatherRequest();
req.setZipCode(myAccount.zipcode);
// make the callout
EasySOAResponse resp = req.callout();
// check the status of a callout
if (! resp.isValid()) {
// handle exception;
}
// process data in the response
myAccount.WeatherStation = resp.retrieveElement(‘/ForecastReturn/WeatherStationCity’);
More Enriched Features
• Built out one more generic parser for JSON
• Support dynamically creating or populating Sobjects
Map<String, String> m = EasySOAHelper.getMappingRules(‘MyMappingRules__c');
resp.createNewSObject(‘MySObject', m);
Or
Map<String, String> m = EasySOAHelper.getMappingRules(‘MyMappingRules__c');
MySObject obj = new MySObject();
resp.populateFields(obj, m);
• Published a managed package – “Easy XML, JSON and Web Services”
https://appexchange.salesforce.com/listingDetail?listingId=a0N3000000B5DqiEAF
Goals Achieved; Uncovered Hidden Gems!
• Time saving in development phase per service
• Single set of APIs for SOAP, JSON, or Restful web services
• Highly configurable module supporting dynamic modifications
• Leverages WS-Security headers programmatically
• Significant reduction in code base
• True parallel development among SFDC development team, Service modeling
team, and Service implementation team
Building calloutswithoutwsdl2apex
Appendix: The Whole Set of Framework Classes

Weitere ähnliche Inhalte

Was ist angesagt?

Introduction to CSS Grid Layout
Introduction to CSS Grid LayoutIntroduction to CSS Grid Layout
Introduction to CSS Grid LayoutRachel Andrew
 
The New CSS Layout - dotCSS
The New CSS Layout - dotCSSThe New CSS Layout - dotCSS
The New CSS Layout - dotCSSRachel Andrew
 
CSS Grid Layout: An Event Apart Boston 2016
CSS Grid Layout: An Event Apart Boston 2016CSS Grid Layout: An Event Apart Boston 2016
CSS Grid Layout: An Event Apart Boston 2016Rachel Andrew
 
Future Layout & Performance
Future Layout & PerformanceFuture Layout & Performance
Future Layout & PerformanceRachel Andrew
 
CSS Day: CSS Grid Layout
CSS Day: CSS Grid Layout CSS Day: CSS Grid Layout
CSS Day: CSS Grid Layout Rachel Andrew
 
Flexbox and Grid Layout
Flexbox and Grid LayoutFlexbox and Grid Layout
Flexbox and Grid LayoutRachel Andrew
 
Frontend United: Start using CSS Grid Layout today!
Frontend United: Start using CSS Grid Layout today!Frontend United: Start using CSS Grid Layout today!
Frontend United: Start using CSS Grid Layout today!Rachel Andrew
 
AEA Chicago CSS Grid Layout
AEA Chicago CSS Grid LayoutAEA Chicago CSS Grid Layout
AEA Chicago CSS Grid LayoutRachel Andrew
 
Talk Web Design: Get Ready For CSS Grid Layout
Talk Web Design: Get Ready For CSS Grid LayoutTalk Web Design: Get Ready For CSS Grid Layout
Talk Web Design: Get Ready For CSS Grid LayoutRachel Andrew
 
CSS Grid Layout. Implementation status and roadmap (Webkit Contributors Meeti...
CSS Grid Layout. Implementation status and roadmap (Webkit Contributors Meeti...CSS Grid Layout. Implementation status and roadmap (Webkit Contributors Meeti...
CSS Grid Layout. Implementation status and roadmap (Webkit Contributors Meeti...Igalia
 
ConFoo 2016: Making Sense of CSS Layout
ConFoo 2016: Making Sense of CSS LayoutConFoo 2016: Making Sense of CSS Layout
ConFoo 2016: Making Sense of CSS LayoutRachel Andrew
 
CSS Grid Layout - All Things Open
CSS Grid Layout - All Things OpenCSS Grid Layout - All Things Open
CSS Grid Layout - All Things OpenRachel Andrew
 
CSS Grid Changes Everything About Web Layouts: WordCamp Europe 2017
CSS Grid Changes Everything About Web Layouts: WordCamp Europe 2017CSS Grid Changes Everything About Web Layouts: WordCamp Europe 2017
CSS Grid Changes Everything About Web Layouts: WordCamp Europe 2017Morten Rand-Hendriksen
 
Laying out the future
Laying out the futureLaying out the future
Laying out the futureRachel Andrew
 
CSS Grid Layout for Frontend NE
CSS Grid Layout for Frontend NECSS Grid Layout for Frontend NE
CSS Grid Layout for Frontend NERachel Andrew
 
CSS Conf Budapest - New CSS Layout
CSS Conf Budapest - New CSS LayoutCSS Conf Budapest - New CSS Layout
CSS Conf Budapest - New CSS LayoutRachel Andrew
 
Flexbox and Grid Layout
Flexbox and Grid LayoutFlexbox and Grid Layout
Flexbox and Grid LayoutRachel Andrew
 

Was ist angesagt? (20)

Introduction to CSS Grid Layout
Introduction to CSS Grid LayoutIntroduction to CSS Grid Layout
Introduction to CSS Grid Layout
 
The New CSS Layout - dotCSS
The New CSS Layout - dotCSSThe New CSS Layout - dotCSS
The New CSS Layout - dotCSS
 
CSS Grid Layout: An Event Apart Boston 2016
CSS Grid Layout: An Event Apart Boston 2016CSS Grid Layout: An Event Apart Boston 2016
CSS Grid Layout: An Event Apart Boston 2016
 
Future Layout & Performance
Future Layout & PerformanceFuture Layout & Performance
Future Layout & Performance
 
CSS Day: CSS Grid Layout
CSS Day: CSS Grid Layout CSS Day: CSS Grid Layout
CSS Day: CSS Grid Layout
 
Flexbox and Grid Layout
Flexbox and Grid LayoutFlexbox and Grid Layout
Flexbox and Grid Layout
 
Frontend United: Start using CSS Grid Layout today!
Frontend United: Start using CSS Grid Layout today!Frontend United: Start using CSS Grid Layout today!
Frontend United: Start using CSS Grid Layout today!
 
AEA Chicago CSS Grid Layout
AEA Chicago CSS Grid LayoutAEA Chicago CSS Grid Layout
AEA Chicago CSS Grid Layout
 
CSS Grid Layout
CSS Grid LayoutCSS Grid Layout
CSS Grid Layout
 
Talk Web Design: Get Ready For CSS Grid Layout
Talk Web Design: Get Ready For CSS Grid LayoutTalk Web Design: Get Ready For CSS Grid Layout
Talk Web Design: Get Ready For CSS Grid Layout
 
CSS Grid
CSS GridCSS Grid
CSS Grid
 
CSS Grid Layout. Implementation status and roadmap (Webkit Contributors Meeti...
CSS Grid Layout. Implementation status and roadmap (Webkit Contributors Meeti...CSS Grid Layout. Implementation status and roadmap (Webkit Contributors Meeti...
CSS Grid Layout. Implementation status and roadmap (Webkit Contributors Meeti...
 
ConFoo 2016: Making Sense of CSS Layout
ConFoo 2016: Making Sense of CSS LayoutConFoo 2016: Making Sense of CSS Layout
ConFoo 2016: Making Sense of CSS Layout
 
CSS Grid Layout - All Things Open
CSS Grid Layout - All Things OpenCSS Grid Layout - All Things Open
CSS Grid Layout - All Things Open
 
CSS Grid Changes Everything About Web Layouts: WordCamp Europe 2017
CSS Grid Changes Everything About Web Layouts: WordCamp Europe 2017CSS Grid Changes Everything About Web Layouts: WordCamp Europe 2017
CSS Grid Changes Everything About Web Layouts: WordCamp Europe 2017
 
Laying out the future
Laying out the futureLaying out the future
Laying out the future
 
CSS Grid Layout for Frontend NE
CSS Grid Layout for Frontend NECSS Grid Layout for Frontend NE
CSS Grid Layout for Frontend NE
 
Introducing CSS Grid
Introducing CSS GridIntroducing CSS Grid
Introducing CSS Grid
 
CSS Conf Budapest - New CSS Layout
CSS Conf Budapest - New CSS LayoutCSS Conf Budapest - New CSS Layout
CSS Conf Budapest - New CSS Layout
 
Flexbox and Grid Layout
Flexbox and Grid LayoutFlexbox and Grid Layout
Flexbox and Grid Layout
 

Andere mochten auch

The changing face of software testing
The changing face of software testingThe changing face of software testing
The changing face of software testingBruce McLeod
 
Pigeon Poop - You've got to learn to live with it...
Pigeon Poop - You've got to learn to live with it...Pigeon Poop - You've got to learn to live with it...
Pigeon Poop - You've got to learn to live with it...Greg Gifford
 
The Best Social Program is a Job!
The Best Social Program is a Job!The Best Social Program is a Job!
The Best Social Program is a Job!bodziana
 
Repair mechanisms of genetic material
Repair mechanisms of genetic materialRepair mechanisms of genetic material
Repair mechanisms of genetic materialLuisaGP96
 
Hays Plc Annual Report 2016
Hays Plc Annual Report 2016Hays Plc Annual Report 2016
Hays Plc Annual Report 2016Hays
 
Risks and TCoR
Risks and TCoRRisks and TCoR
Risks and TCoRkruijsse
 
Grow with HubSpot - Singapore - June 2016
Grow with HubSpot - Singapore - June 2016Grow with HubSpot - Singapore - June 2016
Grow with HubSpot - Singapore - June 2016Ryan Bonnici
 
The miracle of the blood and heart. english
The miracle of the blood and heart. englishThe miracle of the blood and heart. english
The miracle of the blood and heart. englishHarunyahyaEnglish
 
文件自由日
文件自由日文件自由日
文件自由日fweng322
 
Receta gazpacho andaluz olmeda origenes gourmet
Receta gazpacho andaluz olmeda origenes gourmetReceta gazpacho andaluz olmeda origenes gourmet
Receta gazpacho andaluz olmeda origenes gourmetOlmeda Orígenes
 
The Introduction of Recruit Way In Offshore Dev. Scheme With FPT Software Mem...
The Introduction of Recruit Way In Offshore Dev. Scheme With FPT Software Mem...The Introduction of Recruit Way In Offshore Dev. Scheme With FPT Software Mem...
The Introduction of Recruit Way In Offshore Dev. Scheme With FPT Software Mem...Recruit Technologies
 
Flyer Delitzscher str Häuser
Flyer Delitzscher str HäuserFlyer Delitzscher str Häuser
Flyer Delitzscher str HäuserChristoph Sobotta
 
Νευροινιδιακη εκφυλιση και δενδριτικεσ αλλοιωσεισ
Νευροινιδιακη εκφυλιση και δενδριτικεσ αλλοιωσεισ Νευροινιδιακη εκφυλιση και δενδριτικεσ αλλοιωσεισ
Νευροινιδιακη εκφυλιση και δενδριτικεσ αλλοιωσεισ csdtesting
 

Andere mochten auch (18)

Alimentación balanceada
Alimentación balanceadaAlimentación balanceada
Alimentación balanceada
 
Social Program July
Social Program JulySocial Program July
Social Program July
 
The changing face of software testing
The changing face of software testingThe changing face of software testing
The changing face of software testing
 
Maru y-mili
Maru y-miliMaru y-mili
Maru y-mili
 
Print
PrintPrint
Print
 
Pigeon Poop - You've got to learn to live with it...
Pigeon Poop - You've got to learn to live with it...Pigeon Poop - You've got to learn to live with it...
Pigeon Poop - You've got to learn to live with it...
 
The Best Social Program is a Job!
The Best Social Program is a Job!The Best Social Program is a Job!
The Best Social Program is a Job!
 
Repair mechanisms of genetic material
Repair mechanisms of genetic materialRepair mechanisms of genetic material
Repair mechanisms of genetic material
 
Hays Plc Annual Report 2016
Hays Plc Annual Report 2016Hays Plc Annual Report 2016
Hays Plc Annual Report 2016
 
Risks and TCoR
Risks and TCoRRisks and TCoR
Risks and TCoR
 
Dawn Finch
Dawn FinchDawn Finch
Dawn Finch
 
Grow with HubSpot - Singapore - June 2016
Grow with HubSpot - Singapore - June 2016Grow with HubSpot - Singapore - June 2016
Grow with HubSpot - Singapore - June 2016
 
The miracle of the blood and heart. english
The miracle of the blood and heart. englishThe miracle of the blood and heart. english
The miracle of the blood and heart. english
 
文件自由日
文件自由日文件自由日
文件自由日
 
Receta gazpacho andaluz olmeda origenes gourmet
Receta gazpacho andaluz olmeda origenes gourmetReceta gazpacho andaluz olmeda origenes gourmet
Receta gazpacho andaluz olmeda origenes gourmet
 
The Introduction of Recruit Way In Offshore Dev. Scheme With FPT Software Mem...
The Introduction of Recruit Way In Offshore Dev. Scheme With FPT Software Mem...The Introduction of Recruit Way In Offshore Dev. Scheme With FPT Software Mem...
The Introduction of Recruit Way In Offshore Dev. Scheme With FPT Software Mem...
 
Flyer Delitzscher str Häuser
Flyer Delitzscher str HäuserFlyer Delitzscher str Häuser
Flyer Delitzscher str Häuser
 
Νευροινιδιακη εκφυλιση και δενδριτικεσ αλλοιωσεισ
Νευροινιδιακη εκφυλιση και δενδριτικεσ αλλοιωσεισ Νευροινιδιακη εκφυλιση και δενδριτικεσ αλλοιωσεισ
Νευροινιδιακη εκφυλιση και δενδριτικεσ αλλοιωσεισ
 

Ähnlich wie Building calloutswithoutwsdl2apex

Making sense of the Graph Revolution
Making sense of the Graph RevolutionMaking sense of the Graph Revolution
Making sense of the Graph RevolutionInfiniteGraph
 
Powering a Graph Data System with Scylla + JanusGraph
Powering a Graph Data System with Scylla + JanusGraphPowering a Graph Data System with Scylla + JanusGraph
Powering a Graph Data System with Scylla + JanusGraphScyllaDB
 
Designing Modern Streaming Data Applications
Designing Modern Streaming Data ApplicationsDesigning Modern Streaming Data Applications
Designing Modern Streaming Data ApplicationsArun Kejariwal
 
Mastering MapReduce: MapReduce for Big Data Management and Analysis
Mastering MapReduce: MapReduce for Big Data Management and AnalysisMastering MapReduce: MapReduce for Big Data Management and Analysis
Mastering MapReduce: MapReduce for Big Data Management and AnalysisTeradata Aster
 
Introduction to WSO2 Data Analytics Platform
Introduction to  WSO2 Data Analytics PlatformIntroduction to  WSO2 Data Analytics Platform
Introduction to WSO2 Data Analytics PlatformSrinath Perera
 
Mobility insights at Swisscom - Understanding collective mobility in Switzerland
Mobility insights at Swisscom - Understanding collective mobility in SwitzerlandMobility insights at Swisscom - Understanding collective mobility in Switzerland
Mobility insights at Swisscom - Understanding collective mobility in SwitzerlandFrançois Garillot
 
Spark Summit EU talk by Francois Garillot and Mohamed Kafsi
Spark Summit EU talk by Francois Garillot and Mohamed KafsiSpark Summit EU talk by Francois Garillot and Mohamed Kafsi
Spark Summit EU talk by Francois Garillot and Mohamed KafsiSpark Summit
 
Alerting mechanism and algorithms introduction
Alerting mechanism and algorithms introductionAlerting mechanism and algorithms introduction
Alerting mechanism and algorithms introductionFEG
 
DDS Advanced Tutorial - OMG June 2013 Berlin Meeting
DDS Advanced Tutorial - OMG June 2013 Berlin MeetingDDS Advanced Tutorial - OMG June 2013 Berlin Meeting
DDS Advanced Tutorial - OMG June 2013 Berlin MeetingJaime Martin Losa
 
Opal: Simple Web Services Wrappers for Scientific Applications
Opal: Simple Web Services Wrappers for Scientific ApplicationsOpal: Simple Web Services Wrappers for Scientific Applications
Opal: Simple Web Services Wrappers for Scientific ApplicationsSriram Krishnan
 
Standard Provenance Reporting and Scientific Software Management in Virtual L...
Standard Provenance Reporting and Scientific Software Management in Virtual L...Standard Provenance Reporting and Scientific Software Management in Virtual L...
Standard Provenance Reporting and Scientific Software Management in Virtual L...njcar
 
Using Deep Learning on Apache Spark to Diagnose Thoracic Pathology from Chest...
Using Deep Learning on Apache Spark to Diagnose Thoracic Pathology from Chest...Using Deep Learning on Apache Spark to Diagnose Thoracic Pathology from Chest...
Using Deep Learning on Apache Spark to Diagnose Thoracic Pathology from Chest...Databricks
 
WSO2 Analytics Platform - The one stop shop for all your data needs
WSO2 Analytics Platform - The one stop shop for all your data needsWSO2 Analytics Platform - The one stop shop for all your data needs
WSO2 Analytics Platform - The one stop shop for all your data needsSriskandarajah Suhothayan
 
An Introduction to Spark
An Introduction to SparkAn Introduction to Spark
An Introduction to Sparkjlacefie
 
An Introduct to Spark - Atlanta Spark Meetup
An Introduct to Spark - Atlanta Spark MeetupAn Introduct to Spark - Atlanta Spark Meetup
An Introduct to Spark - Atlanta Spark Meetupjlacefie
 
Scientific
Scientific Scientific
Scientific marpierc
 
Full Stack Reactive In Practice
Full Stack Reactive In PracticeFull Stack Reactive In Practice
Full Stack Reactive In PracticeLightbend
 

Ähnlich wie Building calloutswithoutwsdl2apex (20)

Making sense of the Graph Revolution
Making sense of the Graph RevolutionMaking sense of the Graph Revolution
Making sense of the Graph Revolution
 
Powering a Graph Data System with Scylla + JanusGraph
Powering a Graph Data System with Scylla + JanusGraphPowering a Graph Data System with Scylla + JanusGraph
Powering a Graph Data System with Scylla + JanusGraph
 
Designing Modern Streaming Data Applications
Designing Modern Streaming Data ApplicationsDesigning Modern Streaming Data Applications
Designing Modern Streaming Data Applications
 
Mastering MapReduce: MapReduce for Big Data Management and Analysis
Mastering MapReduce: MapReduce for Big Data Management and AnalysisMastering MapReduce: MapReduce for Big Data Management and Analysis
Mastering MapReduce: MapReduce for Big Data Management and Analysis
 
Introduction to WSO2 Data Analytics Platform
Introduction to  WSO2 Data Analytics PlatformIntroduction to  WSO2 Data Analytics Platform
Introduction to WSO2 Data Analytics Platform
 
Mobility insights at Swisscom - Understanding collective mobility in Switzerland
Mobility insights at Swisscom - Understanding collective mobility in SwitzerlandMobility insights at Swisscom - Understanding collective mobility in Switzerland
Mobility insights at Swisscom - Understanding collective mobility in Switzerland
 
Spark Summit EU talk by Francois Garillot and Mohamed Kafsi
Spark Summit EU talk by Francois Garillot and Mohamed KafsiSpark Summit EU talk by Francois Garillot and Mohamed Kafsi
Spark Summit EU talk by Francois Garillot and Mohamed Kafsi
 
Alerting mechanism and algorithms introduction
Alerting mechanism and algorithms introductionAlerting mechanism and algorithms introduction
Alerting mechanism and algorithms introduction
 
Presentation
PresentationPresentation
Presentation
 
DDS Advanced Tutorial - OMG June 2013 Berlin Meeting
DDS Advanced Tutorial - OMG June 2013 Berlin MeetingDDS Advanced Tutorial - OMG June 2013 Berlin Meeting
DDS Advanced Tutorial - OMG June 2013 Berlin Meeting
 
Opal: Simple Web Services Wrappers for Scientific Applications
Opal: Simple Web Services Wrappers for Scientific ApplicationsOpal: Simple Web Services Wrappers for Scientific Applications
Opal: Simple Web Services Wrappers for Scientific Applications
 
Standard Provenance Reporting and Scientific Software Management in Virtual L...
Standard Provenance Reporting and Scientific Software Management in Virtual L...Standard Provenance Reporting and Scientific Software Management in Virtual L...
Standard Provenance Reporting and Scientific Software Management in Virtual L...
 
Using Deep Learning on Apache Spark to Diagnose Thoracic Pathology from Chest...
Using Deep Learning on Apache Spark to Diagnose Thoracic Pathology from Chest...Using Deep Learning on Apache Spark to Diagnose Thoracic Pathology from Chest...
Using Deep Learning on Apache Spark to Diagnose Thoracic Pathology from Chest...
 
WSO2 Analytics Platform - The one stop shop for all your data needs
WSO2 Analytics Platform - The one stop shop for all your data needsWSO2 Analytics Platform - The one stop shop for all your data needs
WSO2 Analytics Platform - The one stop shop for all your data needs
 
An Introduction to Spark
An Introduction to SparkAn Introduction to Spark
An Introduction to Spark
 
An Introduct to Spark - Atlanta Spark Meetup
An Introduct to Spark - Atlanta Spark MeetupAn Introduct to Spark - Atlanta Spark Meetup
An Introduct to Spark - Atlanta Spark Meetup
 
Scientific
Scientific Scientific
Scientific
 
Full Stack Reactive In Practice
Full Stack Reactive In PracticeFull Stack Reactive In Practice
Full Stack Reactive In Practice
 
Horizons doc
Horizons docHorizons doc
Horizons doc
 
Analytics with Spark
Analytics with SparkAnalytics with Spark
Analytics with Spark
 

Mehr von Ming Yuan

Cloud and Analytics -- 2020 sparksummit
Cloud and Analytics -- 2020 sparksummitCloud and Analytics -- 2020 sparksummit
Cloud and Analytics -- 2020 sparksummitMing Yuan
 
Forrester2019
Forrester2019Forrester2019
Forrester2019Ming Yuan
 
R & Python on Hadoop
R & Python on HadoopR & Python on Hadoop
R & Python on HadoopMing Yuan
 
SSO with sfdc
SSO with sfdcSSO with sfdc
SSO with sfdcMing Yuan
 
Rest and beyond
Rest and beyondRest and beyond
Rest and beyondMing Yuan
 
Simplifying Apache Cascading
Simplifying Apache CascadingSimplifying Apache Cascading
Simplifying Apache CascadingMing Yuan
 

Mehr von Ming Yuan (7)

Cloud and Analytics -- 2020 sparksummit
Cloud and Analytics -- 2020 sparksummitCloud and Analytics -- 2020 sparksummit
Cloud and Analytics -- 2020 sparksummit
 
Forrester2019
Forrester2019Forrester2019
Forrester2019
 
R & Python on Hadoop
R & Python on HadoopR & Python on Hadoop
R & Python on Hadoop
 
SSO with sfdc
SSO with sfdcSSO with sfdc
SSO with sfdc
 
Singleton
SingletonSingleton
Singleton
 
Rest and beyond
Rest and beyondRest and beyond
Rest and beyond
 
Simplifying Apache Cascading
Simplifying Apache CascadingSimplifying Apache Cascading
Simplifying Apache Cascading
 

Kürzlich hochgeladen

IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019IES VE
 
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationUsing IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationIES VE
 
Computer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsComputer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsSeth Reyes
 
Babel Compiler - Transforming JavaScript for All Browsers.pptx
Babel Compiler - Transforming JavaScript for All Browsers.pptxBabel Compiler - Transforming JavaScript for All Browsers.pptx
Babel Compiler - Transforming JavaScript for All Browsers.pptxYounusS2
 
Do we need a new standard for visualizing the invisible?
Do we need a new standard for visualizing the invisible?Do we need a new standard for visualizing the invisible?
Do we need a new standard for visualizing the invisible?SANGHEE SHIN
 
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfDianaGray10
 
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAAnypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAshyamraj55
 
Empowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintEmpowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintMahmoud Rabie
 
Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemAsko Soukka
 
Designing A Time bound resource download URL
Designing A Time bound resource download URLDesigning A Time bound resource download URL
Designing A Time bound resource download URLRuncy Oommen
 
OpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureOpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureEric D. Schabell
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6DianaGray10
 
Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Adtran
 
RAG Patterns and Vector Search in Generative AI
RAG Patterns and Vector Search in Generative AIRAG Patterns and Vector Search in Generative AI
RAG Patterns and Vector Search in Generative AIUdaiappa Ramachandran
 
UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7DianaGray10
 
Linked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesLinked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesDavid Newbury
 
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Will Schroeder
 
9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding TeamAdam Moalla
 
UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8DianaGray10
 
Cloud Revolution: Exploring the New Wave of Serverless Spatial Data
Cloud Revolution: Exploring the New Wave of Serverless Spatial DataCloud Revolution: Exploring the New Wave of Serverless Spatial Data
Cloud Revolution: Exploring the New Wave of Serverless Spatial DataSafe Software
 

Kürzlich hochgeladen (20)

IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
 
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationUsing IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
 
Computer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and HazardsComputer 10: Lesson 10 - Online Crimes and Hazards
Computer 10: Lesson 10 - Online Crimes and Hazards
 
Babel Compiler - Transforming JavaScript for All Browsers.pptx
Babel Compiler - Transforming JavaScript for All Browsers.pptxBabel Compiler - Transforming JavaScript for All Browsers.pptx
Babel Compiler - Transforming JavaScript for All Browsers.pptx
 
Do we need a new standard for visualizing the invisible?
Do we need a new standard for visualizing the invisible?Do we need a new standard for visualizing the invisible?
Do we need a new standard for visualizing the invisible?
 
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdfUiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
UiPath Solutions Management Preview - Northern CA Chapter - March 22.pdf
 
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPAAnypoint Code Builder , Google Pub sub connector and MuleSoft RPA
Anypoint Code Builder , Google Pub sub connector and MuleSoft RPA
 
Empowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership BlueprintEmpowering Africa's Next Generation: The AI Leadership Blueprint
Empowering Africa's Next Generation: The AI Leadership Blueprint
 
Bird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystemBird eye's view on Camunda open source ecosystem
Bird eye's view on Camunda open source ecosystem
 
Designing A Time bound resource download URL
Designing A Time bound resource download URLDesigning A Time bound resource download URL
Designing A Time bound resource download URL
 
OpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability AdventureOpenShift Commons Paris - Choose Your Own Observability Adventure
OpenShift Commons Paris - Choose Your Own Observability Adventure
 
UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6UiPath Studio Web workshop series - Day 6
UiPath Studio Web workshop series - Day 6
 
Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™Meet the new FSP 3000 M-Flex800™
Meet the new FSP 3000 M-Flex800™
 
RAG Patterns and Vector Search in Generative AI
RAG Patterns and Vector Search in Generative AIRAG Patterns and Vector Search in Generative AI
RAG Patterns and Vector Search in Generative AI
 
UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7UiPath Studio Web workshop series - Day 7
UiPath Studio Web workshop series - Day 7
 
Linked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesLinked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond Ontologies
 
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
Apres-Cyber - The Data Dilemma: Bridging Offensive Operations and Machine Lea...
 
9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team9 Steps For Building Winning Founding Team
9 Steps For Building Winning Founding Team
 
UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8
 
Cloud Revolution: Exploring the New Wave of Serverless Spatial Data
Cloud Revolution: Exploring the New Wave of Serverless Spatial DataCloud Revolution: Exploring the New Wave of Serverless Spatial Data
Cloud Revolution: Exploring the New Wave of Serverless Spatial Data
 

Building calloutswithoutwsdl2apex

  • 1. Building Callouts without WSDL2Apex or Apex Parser Ming Yuan Solution Architect Zurich North America
  • 2. Welcome Zurich Insurance Group (Zurich) is a leading multi-line insurance provider with a global network of subsidiaries and offices in Europe, North America, Latin America, Asia-Pacific and the Middle East as well as other markets. For more information about the products and services it offers and people Zurich employs around the world, go to http://www.zurichna.com/zna/aboutzurich/zna-home.htm. In North America, Zurich (www.zurichna.com) is a leading commercial property-casualty insurance provider serving the global corporate, large corporate, middle markets, specialties and programs sectors. In addition, Zurich also offers life insurance products and services. 2012 marks Zurich’s 100 year anniversary of insuring America and the success of its customers, shareholders and employees. Further information about Zurich’s 100 year anniversary of insuring America is available at http://www.zurichna.com/100.
  • 3. Architecture Landscape • SFDC is the strategic platform to provide single-pane-of-glass user experience • Service-Oriented Architecture established enterprise-wide – SFDC exchanges data with on-premise applications via Enterprise Service Bus (ESB) EnterpriseServiceBus
  • 4. The Challenge is.. • Existing service contracts (defined in WSDLs) are based on IBM’s Industry Model for Insurance • These WSDLs uncovered some limitations of the WSDL2Apex tool – Unsupported data types – Complex namespace inheritance structure – Multiple XSD imports into a single WSDL; otherwise a consolidated WSDL may exceed size limit • Known workaround options didn’t work well – Manually trim down each WSDL to fit in WSDL2Apex – Develop custom APEX parser per service
  • 5. POC: WSDL2Apex Stub vs. Framework Results captured, with permissions to use, from http://www.villagechief.com/product/codescan
  • 6. Overview of the Framework • An abstract base class for requests – Represents all type of requests – Allows developers to inject logic to generate actual XML requests • A generic XML parser class – Parses XML stream into Map structures • A common response class – Checks the status of invocation – Manages the Maps (containing data and metadata) – Retrieves values using XPath-like keys
  • 7. Sample Request Class – Per Service Endpoint public class WeatherRequest extends EasySOARequest { private String zipCode = ‘’; public WeatherRequest() { super(); httpMethod = 'POST'; endpoint = 'http://wsf.cdyne.com/WeatherWS/Weather.asmx'; headers.put('Content-Type', 'text/xml; charset=utf-8'); timeOut = 120000; } public void setZipCode(String s) {zipcode = s;} public override String getPayload() { return getSOAPRequest(‘<GetCityForecastByZIP><ZIP>’ + zipcode + ‘</ZIP></GetCityForecastByZIP>‘); } }
  • 8. /ForecastReturn/State /ForecastReturn/City /ForecastReturn/WeatherStationCity /ForecastReturn/ForecastResult/Forecast/Date /ForecastReturn/ForecastResult/Forecast/WeatherID /ForecastReturn/ForecastResult/Forecast/Description /ForecastReturn/ForecastResult/Forecast__1/Date /ForecastReturn/ForecastResult/Forecast__1/WeatherID /ForecastReturn/ForecastResult/Forecast__1/Description Keys for data storage /ForecastReturn/State /ForecastReturn/City /ForecastReturn/WeatherStationCity /ForecastReturn/ForecastResult/Forecast/Date (/0/0/0/0) /ForecastReturn/ForecastResult/Forecast/WeatherID (/0/0/0/0) /ForecastReturn/ForecastResult/Forecast/Description (/0/0/0/0) /ForecastReturn/ForecastResult/Forecast/Date (/0/0/1/0) /ForecastReturn/ForecastResult/Forecast/WeatherID (/0/0/1/0) /ForecastReturn/ForecastResult/Forecast/Description (/0/0/1/0) Keys for data retrieval The Generic Parse – from XML to Maps <ForecastReturn> <State>IL</State> <City>Arlington Heights</City> <WeatherStationCity> Waukegan </WeatherStationCity> <ForecastResult> <Forecast> <Date> 2014-08-14T00:00:00 </Date> <WeatherID>4</WeatherID> <Description> Sunny </Description> </Forecast> <Forecast> <Date> 2014-08-15T00:00:00 </Date> <WeatherID>2</WeatherID> <Description> Partly Cloudy </Description> </Forecast> </ForecastResult> </ForecastReturn>
  • 9. The Response Class – Data Retrieval • Simple responses – response.retrieveElement(xpath) – response.retrieveElements(List<String> xpaths) • Responses with collections – response.getNumberOfSiblings(xpath) – response.getNumberOfSiblings(xpath, indexpath) – response.retrieveElement(xpath, indexpath) – response.retrieveImmediateValuesInCollection(xpath, indexpath) – response.retrieveUniqueValuesInCollection(xpath, indexpath) – response.retrieveAllValuesInCollection(xpath, indexpath) – response.retrieveValuesFromSiblings(xpath, indexpath) • Advanced methods – response.createNewSObject(String name, Map<String, String> mappings) – response.createNewSObject(String name, Map<String, String> mappings, List<String> defaults) – response.populateFields(SObject s, Map<String, String> mappings) – response.populateFields(SObject s, Map<String, String> mappings, List<String> defaults) • Backdoor method for development – response.debugAndLog()
  • 10. How the Framework Works.. 2: populateReqData 4: callout 6: isValid 8: retrieveElements
  • 11. Sample Invoker Class – Pattern-Based Development // initiate a request object WeatherRequest req = new WeatherRequest(); req.setZipCode(myAccount.zipcode); // make the callout EasySOAResponse resp = req.callout(); // check the status of a callout if (! resp.isValid()) { // handle exception; } // process data in the response myAccount.WeatherStation = resp.retrieveElement(‘/ForecastReturn/WeatherStationCity’);
  • 12. More Enriched Features • Built out one more generic parser for JSON • Support dynamically creating or populating Sobjects Map<String, String> m = EasySOAHelper.getMappingRules(‘MyMappingRules__c'); resp.createNewSObject(‘MySObject', m); Or Map<String, String> m = EasySOAHelper.getMappingRules(‘MyMappingRules__c'); MySObject obj = new MySObject(); resp.populateFields(obj, m); • Published a managed package – “Easy XML, JSON and Web Services” https://appexchange.salesforce.com/listingDetail?listingId=a0N3000000B5DqiEAF
  • 13. Goals Achieved; Uncovered Hidden Gems! • Time saving in development phase per service • Single set of APIs for SOAP, JSON, or Restful web services • Highly configurable module supporting dynamic modifications • Leverages WS-Security headers programmatically • Significant reduction in code base • True parallel development among SFDC development team, Service modeling team, and Service implementation team
  • 15. Appendix: The Whole Set of Framework Classes