SlideShare a Scribd company logo

Scalaxb preso

1 of 22
Download to read offline
So We Have To
Use SOAP!?
Trent Johnson
@trentio
trent.johnson@banno.com
What is SOAP?
Simple Object Access Protocol
A protocol specification for exchanging sturctured information in the
implementation of WebServices that uses XML format and usually
uses HTTP or SMTP for message negotiation.
Allows for namespacing
Flexibility
Parts of SOAP
Envelope - Required
Identifies the XML document as a SOAP message.
Header - Optional
Passes along application level info that is processed by SOAP
nodes along the way
Body - Required
The information on the message that you are trying to send
Fault - Optional
Error and Status information
Example SOAP Request
<xlvrin".">
?m eso=10?
<opEvlp xlssa=ht:/w.3og20/5sa-neoe>
sa:neoe mn:op"tp/www.r/030/opevlp"
<opHae>
sa:edr
<:Scrt>. <oScrt>
o euiy.. /:euiy
<sa:edr
/opHae>
<opBd>
sa:oy
<:eSokrc xlsm"tp/wweapeogsok>
mGttcPie mn:=ht:/w.xml.r/tc"
<:tcNm>B<mSokae
mSokaeIM/:tcNm>
<mGttcPie
/:eSokrc>
<sa:oy
/opBd>
<sa:neoe
/opEvlp>
WSDL & XSD
WSDL
Describes the service and operations available for that service.
Its about the functionality of the service
XSD
Describes the structure of the complex datatypes of the service
Its about the sturcture of the objects (types, fields, restrictions like
max leghth)
They work together to give you a contract for the service

Recommended

Introduction to PythonTeX
Introduction to PythonTeXIntroduction to PythonTeX
Introduction to PythonTeXHirwanto Iwan
 
The Ring programming language version 1.3 book - Part 17 of 88
The Ring programming language version 1.3 book - Part 17 of 88The Ring programming language version 1.3 book - Part 17 of 88
The Ring programming language version 1.3 book - Part 17 of 88Mahmoud Samir Fayed
 
Devinsampa nginx-scripting
Devinsampa nginx-scriptingDevinsampa nginx-scripting
Devinsampa nginx-scriptingTony Fabeen
 
C++ course start
C++ course startC++ course start
C++ course startNet3lem
 
PHP 7.x - past, present, future
PHP 7.x - past, present, futurePHP 7.x - past, present, future
PHP 7.x - past, present, futureBoyan Yordanov
 
Clone database using_active_duplicate
Clone database using_active_duplicateClone database using_active_duplicate
Clone database using_active_duplicateViaggio Italia
 
PHP 7.x - past, present, future (WordPress Varna #4)
PHP 7.x - past, present, future (WordPress Varna #4)PHP 7.x - past, present, future (WordPress Varna #4)
PHP 7.x - past, present, future (WordPress Varna #4)Boyan Yordanov
 

More Related Content

What's hot

The why and how of moving to PHP 5.4/5.5
The why and how of moving to PHP 5.4/5.5The why and how of moving to PHP 5.4/5.5
The why and how of moving to PHP 5.4/5.5Wim Godden
 
How to deploy node to production
How to deploy node to productionHow to deploy node to production
How to deploy node to productionSean Hess
 
いろいろ
いろいろいろいろ
いろいろtekezo
 
Clojure: Practical functional approach on JVM
Clojure: Practical functional approach on JVMClojure: Practical functional approach on JVM
Clojure: Practical functional approach on JVMsunng87
 
Scaling antispam solutions with Puppet
Scaling antispam solutions with PuppetScaling antispam solutions with Puppet
Scaling antispam solutions with PuppetGiovanni Bechis
 
The why and how of moving to php 5.4
The why and how of moving to php 5.4The why and how of moving to php 5.4
The why and how of moving to php 5.4Wim Godden
 
A CTF Hackers Toolbox
A CTF Hackers ToolboxA CTF Hackers Toolbox
A CTF Hackers ToolboxStefan
 
PHP 5.6 New and Deprecated Features
PHP 5.6  New and Deprecated FeaturesPHP 5.6  New and Deprecated Features
PHP 5.6 New and Deprecated FeaturesMark Niebergall
 
C programming file handling
C  programming file handlingC  programming file handling
C programming file handlingargusacademy
 
File handling in C
File handling in CFile handling in C
File handling in CRabin BK
 
File handling in c
File handling in cFile handling in c
File handling in cmohit biswal
 

What's hot (20)

Linux intro 4 awk + makefile
Linux intro 4  awk + makefileLinux intro 4  awk + makefile
Linux intro 4 awk + makefile
 
The why and how of moving to PHP 5.4/5.5
The why and how of moving to PHP 5.4/5.5The why and how of moving to PHP 5.4/5.5
The why and how of moving to PHP 5.4/5.5
 
Linux intro 3 grep + Unix piping
Linux intro 3 grep + Unix pipingLinux intro 3 grep + Unix piping
Linux intro 3 grep + Unix piping
 
Web Services
Web ServicesWeb Services
Web Services
 
How to deploy node to production
How to deploy node to productionHow to deploy node to production
How to deploy node to production
 
いろいろ
いろいろいろいろ
いろいろ
 
rioinfo2012
rioinfo2012rioinfo2012
rioinfo2012
 
Clojure: Practical functional approach on JVM
Clojure: Practical functional approach on JVMClojure: Practical functional approach on JVM
Clojure: Practical functional approach on JVM
 
Linux intro 2 basic terminal
Linux intro 2   basic terminalLinux intro 2   basic terminal
Linux intro 2 basic terminal
 
Unit5
Unit5Unit5
Unit5
 
Scaling antispam solutions with Puppet
Scaling antispam solutions with PuppetScaling antispam solutions with Puppet
Scaling antispam solutions with Puppet
 
The why and how of moving to php 5.4
The why and how of moving to php 5.4The why and how of moving to php 5.4
The why and how of moving to php 5.4
 
A CTF Hackers Toolbox
A CTF Hackers ToolboxA CTF Hackers Toolbox
A CTF Hackers Toolbox
 
PHP Filing
PHP Filing PHP Filing
PHP Filing
 
PHP 5.6 New and Deprecated Features
PHP 5.6  New and Deprecated FeaturesPHP 5.6  New and Deprecated Features
PHP 5.6 New and Deprecated Features
 
Unix shell scripts
Unix shell scriptsUnix shell scripts
Unix shell scripts
 
C programming file handling
C  programming file handlingC  programming file handling
C programming file handling
 
File handling in C
File handling in CFile handling in C
File handling in C
 
Wscript
WscriptWscript
Wscript
 
File handling in c
File handling in cFile handling in c
File handling in c
 

Similar to Scalaxb preso

Intro to web services
Intro to web servicesIntro to web services
Intro to web servicesNeil Ghosh
 
Mashups MAX 360|MAX 2008 Unconference
Mashups MAX 360|MAX 2008 UnconferenceMashups MAX 360|MAX 2008 Unconference
Mashups MAX 360|MAX 2008 UnconferenceElad Elrom
 
jkljklj
jkljkljjkljklj
jkljkljhoefo
 
How Xslate Works
How Xslate WorksHow Xslate Works
How Xslate WorksGoro Fuji
 
Webservices in SalesForce (part 1)
Webservices in SalesForce (part 1)Webservices in SalesForce (part 1)
Webservices in SalesForce (part 1)Mindfire Solutions
 
Jazoon2010 - Edgar Silva - Open source SOA on Steroids
Jazoon2010 - Edgar Silva - Open source SOA on SteroidsJazoon2010 - Edgar Silva - Open source SOA on Steroids
Jazoon2010 - Edgar Silva - Open source SOA on SteroidsEdgar Silva
 
Xke - Introduction to Apache Camel
Xke - Introduction to Apache CamelXke - Introduction to Apache Camel
Xke - Introduction to Apache CamelAlexis Kinsella
 
The Functional Web
The Functional WebThe Functional Web
The Functional WebRyan Riley
 
Who pulls the strings?
Who pulls the strings?Who pulls the strings?
Who pulls the strings?Ronny
 
Taming Deployment With Smart Frog
Taming Deployment With Smart FrogTaming Deployment With Smart Frog
Taming Deployment With Smart FrogSteve Loughran
 
Implementing WebServices with Camel and CXF in ServiceMix
Implementing WebServices with Camel and CXF in ServiceMixImplementing WebServices with Camel and CXF in ServiceMix
Implementing WebServices with Camel and CXF in ServiceMixAdrian Trenaman
 
Using OTP and gen_server Effectively
Using OTP and gen_server EffectivelyUsing OTP and gen_server Effectively
Using OTP and gen_server EffectivelyKen Pratt
 
Web data from R
Web data from RWeb data from R
Web data from Rschamber
 
Intercloud interoperability
Intercloud interoperabilityIntercloud interoperability
Intercloud interoperabilitySam Johnston
 
Implementing the Genetic Algorithm in XSLT: PoC
Implementing the Genetic Algorithm in XSLT: PoCImplementing the Genetic Algorithm in XSLT: PoC
Implementing the Genetic Algorithm in XSLT: PoCjimfuller2009
 
Java Web Services [2/5]: Introduction to SOAP
Java Web Services [2/5]: Introduction to SOAPJava Web Services [2/5]: Introduction to SOAP
Java Web Services [2/5]: Introduction to SOAPIMC Institute
 
JUDCon 2010 - Innovative ideas for Integration Solutions through JBoss ESB
JUDCon 2010 - Innovative ideas for Integration Solutions through JBoss ESBJUDCon 2010 - Innovative ideas for Integration Solutions through JBoss ESB
JUDCon 2010 - Innovative ideas for Integration Solutions through JBoss ESBEdgar Silva
 

Similar to Scalaxb preso (20)

Intro to web services
Intro to web servicesIntro to web services
Intro to web services
 
Mashups MAX 360|MAX 2008 Unconference
Mashups MAX 360|MAX 2008 UnconferenceMashups MAX 360|MAX 2008 Unconference
Mashups MAX 360|MAX 2008 Unconference
 
jkljklj
jkljkljjkljklj
jkljklj
 
How Xslate Works
How Xslate WorksHow Xslate Works
How Xslate Works
 
Webservices in SalesForce (part 1)
Webservices in SalesForce (part 1)Webservices in SalesForce (part 1)
Webservices in SalesForce (part 1)
 
Jazoon2010 - Edgar Silva - Open source SOA on Steroids
Jazoon2010 - Edgar Silva - Open source SOA on SteroidsJazoon2010 - Edgar Silva - Open source SOA on Steroids
Jazoon2010 - Edgar Silva - Open source SOA on Steroids
 
Xke - Introduction to Apache Camel
Xke - Introduction to Apache CamelXke - Introduction to Apache Camel
Xke - Introduction to Apache Camel
 
The Functional Web
The Functional WebThe Functional Web
The Functional Web
 
Who pulls the strings?
Who pulls the strings?Who pulls the strings?
Who pulls the strings?
 
SOAP Overview
SOAP OverviewSOAP Overview
SOAP Overview
 
Taming Deployment With Smart Frog
Taming Deployment With Smart FrogTaming Deployment With Smart Frog
Taming Deployment With Smart Frog
 
Implementing WebServices with Camel and CXF in ServiceMix
Implementing WebServices with Camel and CXF in ServiceMixImplementing WebServices with Camel and CXF in ServiceMix
Implementing WebServices with Camel and CXF in ServiceMix
 
Using OTP and gen_server Effectively
Using OTP and gen_server EffectivelyUsing OTP and gen_server Effectively
Using OTP and gen_server Effectively
 
Web data from R
Web data from RWeb data from R
Web data from R
 
SOA and web services
SOA and web servicesSOA and web services
SOA and web services
 
Intercloud interoperability
Intercloud interoperabilityIntercloud interoperability
Intercloud interoperability
 
Implementing the Genetic Algorithm in XSLT: PoC
Implementing the Genetic Algorithm in XSLT: PoCImplementing the Genetic Algorithm in XSLT: PoC
Implementing the Genetic Algorithm in XSLT: PoC
 
Java Web Services [2/5]: Introduction to SOAP
Java Web Services [2/5]: Introduction to SOAPJava Web Services [2/5]: Introduction to SOAP
Java Web Services [2/5]: Introduction to SOAP
 
Web Service
Web ServiceWeb Service
Web Service
 
JUDCon 2010 - Innovative ideas for Integration Solutions through JBoss ESB
JUDCon 2010 - Innovative ideas for Integration Solutions through JBoss ESBJUDCon 2010 - Innovative ideas for Integration Solutions through JBoss ESB
JUDCon 2010 - Innovative ideas for Integration Solutions through JBoss ESB
 

Scalaxb preso

  • 1. So We Have To Use SOAP!? Trent Johnson @trentio trent.johnson@banno.com
  • 3. Simple Object Access Protocol A protocol specification for exchanging sturctured information in the implementation of WebServices that uses XML format and usually uses HTTP or SMTP for message negotiation. Allows for namespacing Flexibility
  • 4. Parts of SOAP Envelope - Required Identifies the XML document as a SOAP message. Header - Optional Passes along application level info that is processed by SOAP nodes along the way Body - Required The information on the message that you are trying to send Fault - Optional Error and Status information
  • 5. Example SOAP Request <xlvrin"."> ?m eso=10? <opEvlp xlssa=ht:/w.3og20/5sa-neoe> sa:neoe mn:op"tp/www.r/030/opevlp" <opHae> sa:edr <:Scrt>. <oScrt> o euiy.. /:euiy <sa:edr /opHae> <opBd> sa:oy <:eSokrc xlsm"tp/wweapeogsok> mGttcPie mn:=ht:/w.xml.r/tc" <:tcNm>B<mSokae mSokaeIM/:tcNm> <mGttcPie /:eSokrc> <sa:oy /opBd> <sa:neoe /opEvlp>
  • 6. WSDL & XSD WSDL Describes the service and operations available for that service. Its about the functionality of the service XSD Describes the structure of the complex datatypes of the service Its about the sturcture of the objects (types, fields, restrictions like max leghth) They work together to give you a contract for the service
  • 8. Roll Your Own Pros: You control all the details. Cons: You control all the details. You are forced to think about lower level details.
  • 9. JAXB Java Architecture for XML Binding https://netbeans.org/kb/docs/websvc/jaxb.html Java standard for binding XML schemas to Java classes. Allows converting Java objects to XML documents, and vice versa, based on JAXB annotations on the corresponding Java classes. Pros: It handles all the crufty work for you. Well tested Cons: Doesnt generate the code from the wsdl for you. Annotations clutter up your code.
  • 10. Apache CXF http://cxf.apache.org CXF helps you build and develop services using frontend programming APIs, like JAX-WS and JAX-RS. These services can speak a variety of protocols such as SOAP, XML/HTTP, RESTful HTTP, or CORBA and work over a variety of transports such as HTTP, JMS or JBI. Pros: Its an apache project! Wraps JAXB Hides away the annotations for you in generated code. Cons: Generates java
  • 11. ScalaXB http://scalaxb.org Eugene Yokota - @eed3si9n Pros: For the most part handles receiving faults pretty well Generates Scala that uses the cake pattern for implementation details You end up with case classes to use for the messages created Cons: Not as active as some other open source projects.
  • 12. ScalaXB and How it Works
  • 13. Setting Up A Simple Project Has options for mvn, ivy, cli, and sbt
  • 14. Plugin plugins.sbt adbPui(ogsaab %"b-clx"%".." dStlgn"r.clx" stsaab 112) build.sbt saabetns clxStig sucGnrtr i Cmie<=saabi Cmie oreeeaos n opl + clx n opl pcaeaei saabi Cmie: "otetproi.op akgNm n clx n opl = i.rn.eidcsa" dsacVrini saabi Cmie: ".01 iptheso n clx n opl = 01." lbayeednis<=(iptheso i saabi Cmie{d = irrDpnece + dsacVrin n clx n opl) v > "e.aaidrdsac"% "ipthcr"%d ntdtbne.ipth % dsac-oe v }
  • 15. File structure Place your wsdl/xsd files poetpuisst rjc/lgn.b bidst ul.b scmi/s r/anxd scmi/sl r/anwd scmi/cl r/ansaa
  • 16. Using the calls tatProiLouSrie1{ ri eidcokpevcV vlsrie=(e Proitbeop2idns a evc nw eidcalSa1Bnig wt saabSaCins ih clx.oplet wt saabDsacHtCins{)srie ih clx.ipthtplet }.evc }
  • 17. Generated Methods / fo tre/r_aae / rm agtscmngd / Gnrtdb < he=ht:/clx.r/>clx<a. / eeae y a rf"tp/saabog"saab/> pcaei.rn.eidc akg otetproi tatProitbeop{ ri eidcalSa dfgttm(: e eAos) Ete[clx.al[n] i.rn.eidcGttmRsos] ihrsaabFutAy, otetproi.eAosepne dfgttmcegteeetae Oto[tig) e eAoiWih(lmnNm: pinSrn]: Ete[clx.al[n] i.rn.eidcGttmcegtep ihrsaabFutAy, otetproi.eAoiWihRso ne s] dfgttmcubreeetae Oto[tig) e eAoiNme(lmnNm: pinSrn]: Ete[clx.al[n] i.rn.eidcGttmcubrep ihrsaabFutAy, otetproi.eAoiNmeRso ne s] dfgtlmnSmo(lmnNm:Oto[tig) e eEeetybleeetae pinSrn]: Ete[clx.al[n] i.rn.eidcGtlmnSmoRs ihrsaabFutAy, otetproi.eEeetyblep os] ne }
  • 18. Clean it up a bit tatProiLouSrie2{ ri eidcokpevcV piaeti]vlsrie=(e Proitbeop2idns rvt[hs a evc nw eidcalSa1Bnig wt saabSaCins ih clx.oplet wt saabDsacHtCins{)s ih clx.ipthtplet }. evc rie dfgttm( ={ e eAos) vlfutrtm =sriegttm( a alOAos evc.eAos) futrtm.ih.a(alTProiTbeal) alOAosrgtmpfutoeidcalFut .etmpaoRsosTEeet lf.a(tmepneolmn) } piaeti]dffutoeidcalFutfut FutAy)= rvt[hs e alTProiTbeal(al: al[n] <apn t ormdl> mpig o u oes piaeti]dfaoRsosTEeetaos GttmRsos)= rvt[hs e tmepneolmn(tm: eAosepne <apn t ormdl> mpig o u oes }
  • 19. Security Header tatOroplet etnsSaCins1{htCin:HtCins= ri uSaCins xed oplet1 tplet tplet > oerd lz vlsaCin =nwWsoplet{ vrie ay a oplet e sSaCin } tatOropletetnsSa1Cin { ri uSaCin xed op1let oerd dfrqetepnebd:NdSq vrie e eusRsos(oy oee, haes NdSq edr: oee, soe Nmsaeidn, cp: aepcBnig ades UI drs: R, wbehd Srn, eMto: tig ato:Oto[R]: cin pinUI) Ete[op1al[eal,(oee ihrSa1FutDti] NdS q NdSq]={ , oee) sprrqetepnexlihoseNmsae ue.eusRsos(mWtHitdaepc, haes+ scrtHae,..) edr + euiyedr . } } lz vlscrtHae =<xlfrhae" ay a euiyedr "m o edr> }
  • 20. Security Header (cont.) tatProiLouSrie3{ ri eidcokpevcV piaeti]vlsrie=(e Proitbeop2idns rvt[hs a evc nw eidcalSa1Bnig wt OSaCins ih uoplet wt saabDsacHtCins{)s ih clx.ipthtplet }. evc rie dfgttm( ={ e eAos) / terqetwl cnanorhae nw / h eus il oti u edr o vlfutrtm =sriegttm( a alOAos evc.eAos) futrtm.ih.a(alTProiTbeal) alOAosrgtmpfutoeidcalFut .etmpaoRsosTEeet lf.a(tmepneolmn) } piaeti]dffutoeidcalFutfut FutAy)= rvt[hs e alTProiTbeal(al: al[n] <apn t ormdl> mpig o u oes piaeti]dfaoRsosTEeetaos GttmRsos)= rvt[hs e tmepneolmn(tm: eAosepne <apn t ormdl> mpig o u oes }
  • 21. Pitfalls We Have Encountered Sax Parsing Errors Happens when the service you are connected to does not adhere to the wsdl that you are using Timeouts We ended up writing a nice little wrapper around API requests to catch the timeoutErrors and handle them appropriately
  • 22. We're Hiring Talk to one of the guys here from banno banno.com/jobs