SlideShare a Scribd company logo
1 of 12
SOA Development Using Javascript
          An alternative approach to web development

Carl Domingue
IBM Certified Solution Developer
carl.domingue@dsixe.com

http://dsixe-wpf.blogspot.com/
SOA Development Using Javascript


                         Typical web application: AJAX requests
      Browser            HTML fragments from servlet.
Asks servlet for HTML




                                                          Data


      Servlet               Web Service
Invokes WS and creates   Business logic and calls
   HTML for browser       to data repositories


                                                         Subsystem
SOA Development Using Javascript


                                   Javascript web application: AJAX requests
                Browser
          Asks servlet for HTML
                                   data directly from web service, manipulate
          Invokes web services     HTML using javascript.


HTML with templates                                                  Data


                 Servlet               Web Service
             Creates HTML for       Business logic and calls
                 browser             to data repositories


                                                                    Subsystem
SOA Development Using Javascript

Why do it this way?
• Serving HTML from a back end server to a browser is an
  antiquated design that predates modern browsers

• Cut out the middle man, more like developing
  traditional thick client applications

• Simplify AJAX – dynamic portions of user interface are
  built entirely with javascript, not with servlet

• Easier when implementing rich user interface which
  requires extensive manipulation of the DOM
SOA Development Using Javascript

Why do it this way?
• Improved performance - load distributed on many
  clients instead of single server

• Follows SOA approach
   • Presentation/UI layer – browser
   • Business logic – reusable web services
   • Data – database/subsystems

• Short learning curve, most developers know some
  javascript

• No need to render the whole page when user action is
  requested
SOA Development Using Javascript

Arguments for not using this approach

• Performance - dojo is too big/slow
   • Dojo is already being used in WPS 7 and has been
      load tested with excellent results, little additional
      overhead is required
   • Dojo classes are about 1k after compression

• No IDE for javascript
   • RAD offers extensive support for dojo, even custom
     classes

• Javascript is not an ideal language for enterprise
  development, easy to turn code into an unmaintainable
  mess
SOA Development Using Javascript

Arguments for not using this approach
• Security
   • Retrieve user id from web service using @Resource
     instead of request
   • Secure web service URL with group permissions at
     servlet level
   • Needs more thought

• Browser incompatibilities
   • Use dojo when possible to isolate code
   • Traditional approach faces same issues
SOA Development Using Javascript

Java bean class


package com.dsixe.evaluation.operations;

public class Evaluation {
private static int DAYS_TO_SUBMIT = 10; // ???

private   String   evaluationID = "";
private   String   teacherID;
private   String   startDate;
private   String   savedDate;
private   String   completedDate;
private   String   evaluatorName;
SOA Development Using Javascript

Javascript bean class

dojo.provide(“com.dsixe.evaluation.operations.Evaluation");
dojo.require(“com.dsixe._BeanBase");

dojo.declare(“com.dsixe.evaluation.operations.Evaluation",
com.dsixe._BeanBase, {

// By default all fields are private
_evaluationID : null,
_teacherID : null,
_startDate : null,                     Javascript generated with
_savedDate : null,                      Fast Code eclipse plugin
_completedDate : null,                  using custom template,
_evaluatorName : null,                   minimal hand coding
SOA Development Using Javascript


            UI.htm                             Controller.js




Dojo
                          Service proxy
                          Custom code




 Generated javascript   Generated javascript       Generated javascript
     bean class             bean class                 bean class
SOA Development Using Javascript
goGetSubjects(“600”, “02”, updateUISubjects);          Controller




goGetSubjects : function(schoolID, gradeID, callback){
     var params = new dojox.wire.ml.XmlElement("getSubjects");
     params.setPropertyValue("SchoolID", schoolID);
     params.setPropertyValue("GradeID", gradeID);
     var deferred = myService.getSubjects(params); Service proxy

      // ajax callback                                                                 Javascript bean
      deferred.addCallback(function(xmlData){                                               class
           var info = new com.dsixe.commonListService.objects.subject.Subject();
           var subjList = info.createFromXML(xmlData);
           callback(subjList);
      });
}




function updateUISubjects(/* com.dsixe.commonListService.objects.subject.Subject */oSubjects){
var selector = dojo.byId("subject");
selector.options.length = 0; // wipe out list         Controller

    for (var x=0; x < oSubjects.length; x++){
       var opt = new Option(oSubjects[x].getDeptDesc(), oSubjects[x].getDeptCode());
       selector.options[x] = opt;
    }
}
SOA Development Using Javascript
Using ibm_soap dojo module
     <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
     xmlns:gcp="http://k12.gcps.ga.us/GCPSCommonListServices">
      <soapenv:Header/>
      <soapenv:Body>
        <gcp:getSubjects>
                                                                  Raw XML from SoapUI
          <SchoolID>600</SchoolID>
          <GradeID>02</GradeID>
        </gcp:getSubjects>
      </soapenv:Body>
     </soapenv:Envelope>


 myService = new ibm_soap.rpc.SoapService(gcpsCommonService);
 myService.serviceUrl = "http://localhost:81/MyListServices_WS/MyListServices";

 goGetSubjects : function(schoolID, gradeID, callback){
      var params = new dojox.wire.ml.XmlElement("getSubjects");                         Service proxy
      params.setPropertyValue("SchoolID", schoolID);
      params.setPropertyValue("GradeID", gradeID);
      var deferred = myService.getSubjects(params);

       // ajax callback
       deferred.addCallback(function(xmlData){
            var info = new k12.gcps.commonListService.objects.subject.Subject();
            var subjList = info.createFromXML(xmlData);
                                                                              Pass in XML
            callback(subjList);
                                       Array of Subject                        response
       });
 }                                                 classes

More Related Content

What's hot

Servlet sessions
Servlet sessionsServlet sessions
Servlet sessions
vantinhkhuc
 
D2W Branding Using jQuery ThemeRoller
D2W Branding Using jQuery ThemeRollerD2W Branding Using jQuery ThemeRoller
D2W Branding Using jQuery ThemeRoller
WO Community
 
Introduction to Backbone.js for Rails developers
Introduction to Backbone.js for Rails developersIntroduction to Backbone.js for Rails developers
Introduction to Backbone.js for Rails developers
AoteaStudios
 
Integration of Backbone.js with Spring 3.1
Integration of Backbone.js with Spring 3.1Integration of Backbone.js with Spring 3.1
Integration of Backbone.js with Spring 3.1
Michał Orman
 
Lessons Learned from Building a Multi-Tenant Saas Content Management System o...
Lessons Learned from Building a Multi-Tenant Saas Content Management System o...Lessons Learned from Building a Multi-Tenant Saas Content Management System o...
Lessons Learned from Building a Multi-Tenant Saas Content Management System o...
MongoDB
 

What's hot (20)

More Cache for Less Cash
More Cache for Less CashMore Cache for Less Cash
More Cache for Less Cash
 
JavaScript JQUERY AJAX
JavaScript JQUERY AJAXJavaScript JQUERY AJAX
JavaScript JQUERY AJAX
 
10 Ways to Gaurantee Your Azure Project will Fail
10 Ways to Gaurantee Your Azure Project will Fail10 Ways to Gaurantee Your Azure Project will Fail
10 Ways to Gaurantee Your Azure Project will Fail
 
Servlet sessions
Servlet sessionsServlet sessions
Servlet sessions
 
DirectToWeb 2.0
DirectToWeb 2.0DirectToWeb 2.0
DirectToWeb 2.0
 
D2W Branding Using jQuery ThemeRoller
D2W Branding Using jQuery ThemeRollerD2W Branding Using jQuery ThemeRoller
D2W Branding Using jQuery ThemeRoller
 
MongoDB & NoSQL 101
 MongoDB & NoSQL 101 MongoDB & NoSQL 101
MongoDB & NoSQL 101
 
Introduction to Backbone.js for Rails developers
Introduction to Backbone.js for Rails developersIntroduction to Backbone.js for Rails developers
Introduction to Backbone.js for Rails developers
 
Internet and Web Technology (CLASS-10) [Node.js] | NIC/NIELIT Web Technology
Internet and Web Technology (CLASS-10) [Node.js] | NIC/NIELIT Web Technology Internet and Web Technology (CLASS-10) [Node.js] | NIC/NIELIT Web Technology
Internet and Web Technology (CLASS-10) [Node.js] | NIC/NIELIT Web Technology
 
Ajax
AjaxAjax
Ajax
 
Xml http request
Xml http requestXml http request
Xml http request
 
JavaOne 2014 - Supporting Multi-tenancy Applications with Java EE
JavaOne 2014 - Supporting Multi-tenancy Applications with Java EEJavaOne 2014 - Supporting Multi-tenancy Applications with Java EE
JavaOne 2014 - Supporting Multi-tenancy Applications with Java EE
 
Ajax and Jquery
Ajax and JqueryAjax and Jquery
Ajax and Jquery
 
Introduction to Node.js Platform
Introduction to Node.js PlatformIntroduction to Node.js Platform
Introduction to Node.js Platform
 
jQuery Ajax
jQuery AjaxjQuery Ajax
jQuery Ajax
 
MSc Enterprise Systems Development Guest Lecture at UniS (2/12/09)
MSc Enterprise Systems Development Guest Lecture at UniS (2/12/09)MSc Enterprise Systems Development Guest Lecture at UniS (2/12/09)
MSc Enterprise Systems Development Guest Lecture at UniS (2/12/09)
 
Microservices/dropwizard
Microservices/dropwizardMicroservices/dropwizard
Microservices/dropwizard
 
Integration of Backbone.js with Spring 3.1
Integration of Backbone.js with Spring 3.1Integration of Backbone.js with Spring 3.1
Integration of Backbone.js with Spring 3.1
 
Lessons Learned from Building a Multi-Tenant Saas Content Management System o...
Lessons Learned from Building a Multi-Tenant Saas Content Management System o...Lessons Learned from Building a Multi-Tenant Saas Content Management System o...
Lessons Learned from Building a Multi-Tenant Saas Content Management System o...
 
jsf2 Notes
jsf2 Notesjsf2 Notes
jsf2 Notes
 

Viewers also liked

Json-based Service Oriented Architecture for the web
Json-based Service Oriented Architecture for the webJson-based Service Oriented Architecture for the web
Json-based Service Oriented Architecture for the web
kriszyp
 
The real makalah ( reaksi kimia dalam larutan air )
The real makalah ( reaksi kimia dalam larutan air )The real makalah ( reaksi kimia dalam larutan air )
The real makalah ( reaksi kimia dalam larutan air )
Sylvester Saragih
 
Assignment 12
Assignment 12Assignment 12
Assignment 12
debbie14
 
Implementasi uu tambang no 4 tahun 2009 di wilayah kalimantan tenga1 the real
Implementasi uu tambang no 4 tahun 2009 di wilayah kalimantan tenga1 the realImplementasi uu tambang no 4 tahun 2009 di wilayah kalimantan tenga1 the real
Implementasi uu tambang no 4 tahun 2009 di wilayah kalimantan tenga1 the real
Sylvester Saragih
 
2013 awards master (website)
2013 awards master (website)2013 awards master (website)
2013 awards master (website)
TLMI
 
Strenthening   students' language skills through technology
Strenthening   students' language skills through  technologyStrenthening   students' language skills through  technology
Strenthening   students' language skills through technology
Telly J Hajny
 
Media studies mark_scheme
Media studies mark_schemeMedia studies mark_scheme
Media studies mark_scheme
debbie14
 

Viewers also liked (20)

Riereta Node.js session 3 (with notes)
Riereta Node.js session 3 (with notes)Riereta Node.js session 3 (with notes)
Riereta Node.js session 3 (with notes)
 
Json-based Service Oriented Architecture for the web
Json-based Service Oriented Architecture for the webJson-based Service Oriented Architecture for the web
Json-based Service Oriented Architecture for the web
 
Services Oriented Architecture with PHP and MySQL
Services Oriented Architecture with PHP and MySQLServices Oriented Architecture with PHP and MySQL
Services Oriented Architecture with PHP and MySQL
 
SOA And Cloud Computing
SOA And Cloud ComputingSOA And Cloud Computing
SOA And Cloud Computing
 
The real makalah ( reaksi kimia dalam larutan air )
The real makalah ( reaksi kimia dalam larutan air )The real makalah ( reaksi kimia dalam larutan air )
The real makalah ( reaksi kimia dalam larutan air )
 
Assignment 12
Assignment 12Assignment 12
Assignment 12
 
Implementasi uu tambang no 4 tahun 2009 di wilayah kalimantan tenga1 the real
Implementasi uu tambang no 4 tahun 2009 di wilayah kalimantan tenga1 the realImplementasi uu tambang no 4 tahun 2009 di wilayah kalimantan tenga1 the real
Implementasi uu tambang no 4 tahun 2009 di wilayah kalimantan tenga1 the real
 
2013 awards master (website)
2013 awards master (website)2013 awards master (website)
2013 awards master (website)
 
Presentacion Informatica
Presentacion InformaticaPresentacion Informatica
Presentacion Informatica
 
Un sencillo gesto con importantes consecuencias medio ambientales
Un sencillo gesto con importantes consecuencias medio ambientalesUn sencillo gesto con importantes consecuencias medio ambientales
Un sencillo gesto con importantes consecuencias medio ambientales
 
Strenthening   students' language skills through technology
Strenthening   students' language skills through  technologyStrenthening   students' language skills through  technology
Strenthening   students' language skills through technology
 
11 Telephone Phrases
11 Telephone Phrases11 Telephone Phrases
11 Telephone Phrases
 
100 104 9115-
100 104  9115-100 104  9115-
100 104 9115-
 
Omega City Plots on NH8
Omega City Plots on NH8Omega City Plots on NH8
Omega City Plots on NH8
 
General info
General infoGeneral info
General info
 
Media studies mark_scheme
Media studies mark_schemeMedia studies mark_scheme
Media studies mark_scheme
 
Primero corporate presentation january 2015 update final
Primero corporate presentation january 2015 update finalPrimero corporate presentation january 2015 update final
Primero corporate presentation january 2015 update final
 
Cesi meet 2012
Cesi meet 2012Cesi meet 2012
Cesi meet 2012
 
Merry Christmas
Merry ChristmasMerry Christmas
Merry Christmas
 
Kaolin
KaolinKaolin
Kaolin
 

Similar to Soa development using javascript

Javascript frameworks: Backbone.js
Javascript frameworks: Backbone.jsJavascript frameworks: Backbone.js
Javascript frameworks: Backbone.js
Soós Gábor
 
Using Java to implement SOAP Web Services: JAX-WS
Using Java to implement SOAP Web Services: JAX-WS�Using Java to implement SOAP Web Services: JAX-WS�
Using Java to implement SOAP Web Services: JAX-WS
Katrien Verbert
 

Similar to Soa development using javascript (20)

Integrating React.js Into a PHP Application
Integrating React.js Into a PHP ApplicationIntegrating React.js Into a PHP Application
Integrating React.js Into a PHP Application
 
Javascript frameworks: Backbone.js
Javascript frameworks: Backbone.jsJavascript frameworks: Backbone.js
Javascript frameworks: Backbone.js
 
Building Applications Using Ajax
Building Applications Using AjaxBuilding Applications Using Ajax
Building Applications Using Ajax
 
netbeans
netbeansnetbeans
netbeans
 
netbeans
netbeansnetbeans
netbeans
 
JavaScript on the server - Node.js
JavaScript on the server - Node.jsJavaScript on the server - Node.js
JavaScript on the server - Node.js
 
11-DWR-and-JQuery
11-DWR-and-JQuery11-DWR-and-JQuery
11-DWR-and-JQuery
 
11-DWR-and-JQuery
11-DWR-and-JQuery11-DWR-and-JQuery
11-DWR-and-JQuery
 
Liferay (DXP) 7 Tech Meetup for Developers
Liferay (DXP) 7 Tech Meetup for DevelopersLiferay (DXP) 7 Tech Meetup for Developers
Liferay (DXP) 7 Tech Meetup for Developers
 
Jquery beltranhomewrok
Jquery beltranhomewrokJquery beltranhomewrok
Jquery beltranhomewrok
 
Jquery beltranhomewrok
Jquery beltranhomewrokJquery beltranhomewrok
Jquery beltranhomewrok
 
[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC[Coscup 2012] JavascriptMVC
[Coscup 2012] JavascriptMVC
 
Ajax3
Ajax3Ajax3
Ajax3
 
Serverless archtiectures
Serverless archtiecturesServerless archtiectures
Serverless archtiectures
 
JavaScript front end performance optimizations
JavaScript front end performance optimizationsJavaScript front end performance optimizations
JavaScript front end performance optimizations
 
Using Java to implement SOAP Web Services: JAX-WS
Using Java to implement SOAP Web Services: JAX-WS�Using Java to implement SOAP Web Services: JAX-WS�
Using Java to implement SOAP Web Services: JAX-WS
 
Tutorial, Part 2: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
Tutorial, Part 2: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...Tutorial, Part 2: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
Tutorial, Part 2: SharePoint 101: Jump-Starting the Developer by Rob Windsor ...
 
Apache Wicket Web Framework
Apache Wicket Web FrameworkApache Wicket Web Framework
Apache Wicket Web Framework
 
Groovy & Grails eXchange 2012 vert.x presentation
Groovy & Grails eXchange 2012 vert.x presentationGroovy & Grails eXchange 2012 vert.x presentation
Groovy & Grails eXchange 2012 vert.x presentation
 
Advance Java Topics (J2EE)
Advance Java Topics (J2EE)Advance Java Topics (J2EE)
Advance Java Topics (J2EE)
 

Recently uploaded

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Recently uploaded (20)

Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 

Soa development using javascript

  • 1. SOA Development Using Javascript An alternative approach to web development Carl Domingue IBM Certified Solution Developer carl.domingue@dsixe.com http://dsixe-wpf.blogspot.com/
  • 2. SOA Development Using Javascript Typical web application: AJAX requests Browser HTML fragments from servlet. Asks servlet for HTML Data Servlet Web Service Invokes WS and creates Business logic and calls HTML for browser to data repositories Subsystem
  • 3. SOA Development Using Javascript Javascript web application: AJAX requests Browser Asks servlet for HTML data directly from web service, manipulate Invokes web services HTML using javascript. HTML with templates Data Servlet Web Service Creates HTML for Business logic and calls browser to data repositories Subsystem
  • 4. SOA Development Using Javascript Why do it this way? • Serving HTML from a back end server to a browser is an antiquated design that predates modern browsers • Cut out the middle man, more like developing traditional thick client applications • Simplify AJAX – dynamic portions of user interface are built entirely with javascript, not with servlet • Easier when implementing rich user interface which requires extensive manipulation of the DOM
  • 5. SOA Development Using Javascript Why do it this way? • Improved performance - load distributed on many clients instead of single server • Follows SOA approach • Presentation/UI layer – browser • Business logic – reusable web services • Data – database/subsystems • Short learning curve, most developers know some javascript • No need to render the whole page when user action is requested
  • 6. SOA Development Using Javascript Arguments for not using this approach • Performance - dojo is too big/slow • Dojo is already being used in WPS 7 and has been load tested with excellent results, little additional overhead is required • Dojo classes are about 1k after compression • No IDE for javascript • RAD offers extensive support for dojo, even custom classes • Javascript is not an ideal language for enterprise development, easy to turn code into an unmaintainable mess
  • 7. SOA Development Using Javascript Arguments for not using this approach • Security • Retrieve user id from web service using @Resource instead of request • Secure web service URL with group permissions at servlet level • Needs more thought • Browser incompatibilities • Use dojo when possible to isolate code • Traditional approach faces same issues
  • 8. SOA Development Using Javascript Java bean class package com.dsixe.evaluation.operations; public class Evaluation { private static int DAYS_TO_SUBMIT = 10; // ??? private String evaluationID = ""; private String teacherID; private String startDate; private String savedDate; private String completedDate; private String evaluatorName;
  • 9. SOA Development Using Javascript Javascript bean class dojo.provide(“com.dsixe.evaluation.operations.Evaluation"); dojo.require(“com.dsixe._BeanBase"); dojo.declare(“com.dsixe.evaluation.operations.Evaluation", com.dsixe._BeanBase, { // By default all fields are private _evaluationID : null, _teacherID : null, _startDate : null, Javascript generated with _savedDate : null, Fast Code eclipse plugin _completedDate : null, using custom template, _evaluatorName : null, minimal hand coding
  • 10. SOA Development Using Javascript UI.htm Controller.js Dojo Service proxy Custom code Generated javascript Generated javascript Generated javascript bean class bean class bean class
  • 11. SOA Development Using Javascript goGetSubjects(“600”, “02”, updateUISubjects); Controller goGetSubjects : function(schoolID, gradeID, callback){ var params = new dojox.wire.ml.XmlElement("getSubjects"); params.setPropertyValue("SchoolID", schoolID); params.setPropertyValue("GradeID", gradeID); var deferred = myService.getSubjects(params); Service proxy // ajax callback Javascript bean deferred.addCallback(function(xmlData){ class var info = new com.dsixe.commonListService.objects.subject.Subject(); var subjList = info.createFromXML(xmlData); callback(subjList); }); } function updateUISubjects(/* com.dsixe.commonListService.objects.subject.Subject */oSubjects){ var selector = dojo.byId("subject"); selector.options.length = 0; // wipe out list Controller for (var x=0; x < oSubjects.length; x++){ var opt = new Option(oSubjects[x].getDeptDesc(), oSubjects[x].getDeptCode()); selector.options[x] = opt; } }
  • 12. SOA Development Using Javascript Using ibm_soap dojo module <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:gcp="http://k12.gcps.ga.us/GCPSCommonListServices"> <soapenv:Header/> <soapenv:Body> <gcp:getSubjects> Raw XML from SoapUI <SchoolID>600</SchoolID> <GradeID>02</GradeID> </gcp:getSubjects> </soapenv:Body> </soapenv:Envelope> myService = new ibm_soap.rpc.SoapService(gcpsCommonService); myService.serviceUrl = "http://localhost:81/MyListServices_WS/MyListServices"; goGetSubjects : function(schoolID, gradeID, callback){ var params = new dojox.wire.ml.XmlElement("getSubjects"); Service proxy params.setPropertyValue("SchoolID", schoolID); params.setPropertyValue("GradeID", gradeID); var deferred = myService.getSubjects(params); // ajax callback deferred.addCallback(function(xmlData){ var info = new k12.gcps.commonListService.objects.subject.Subject(); var subjList = info.createFromXML(xmlData); Pass in XML callback(subjList); Array of Subject response }); } classes