SlideShare une entreprise Scribd logo
1  sur  20
Developing on the AloAshbei Platform A technical session with the AloAshbei registered developers. 17th July, 2010
Who Am I? 2 Abu AshrafMasnun Business Student at KU PHP & Python Developer
3 Contained REST APIs Common Mistakes Integration  Possibilities Mobilizing the Web
4 REST APIs User makes a request to the REST API. User receives JSON response. Related SOAP API  is called on the server. A HTTP POST call is all you need. Doesn’t require you to play with WSDL files. Implement with almost any programming language.
5 How to use REST APIs? 1. Get the URL for a specific API. 2. Gather the required parameters. 3. Make a HTTP POST call to the URL. 4. Parse the JSON response. Let’s see! Can this be any simpler ?
6 REST APIs Code Sample <?php <?php$a['registrationID'] = "masnun";  $a['password'] = "******";   $a['sourceMsisdn'] = '8801711******';   $a['destinationMsisdn'] = '8801711******';  $a['smsPort'] = 7424;  $a['msgType'] = 4;  $a['charge'] = 2.00; $a['chargedParty'] = '8801711******';   $a['contentArea'] = 'gpgp_psms';  $a['msgContent'] = 'Hello GP API!'; $ch = curl_init("http://masnun.com/aloashbei/sms/send"); curl_setopt($ch, CURLOPT_POST, 1); $data = ""; foreach($a as $k => $v)  { $data.= "$k=$v&"; } curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $result = curl_exec($ch); var_dump($result); ?>
<?php 7 Parsing JSON Response <?php$dataObject = json_decode($result); echo $dataObject->SendSMSResponse->status; ?>
8 Detailed Docs on REST APIs For documentation and API specific code samples: http://masnun.com/aloashbei/
9 Common Mistakes While Working with the APIs 1.  Not editing the WSDL file. 2.  Missing out one or more parameter. 3.  Wrong Request Name. 4.   Miss-matching parameters. 5.   Others. Look into the docs.  Use the Wiki or Forums. And how to resolve them?
10 Integrations Python PHP SoapClient REST APIs
11 Integration : PHP <?php$soap = new SoapClient("http://localhost/gp/wsdl/WebService_GP_ADP_BizTalk_LBS_Orchestration.asmx");  $a['registrationID'] = "masnun"; $a['msisdn'] = '8801711******'; $a['password'] = “******"; try {     var_dump( $soap->requestLocation( array ("LBSRequest" => $a) ) ); } catch (Exception $e) {      var_dump($e->getMessage());   } ?>
12 Integration : Python Python aims to combine "remarkable power with very clear syntax" Wikipedia PyQT Django / Google App Engine GUI Apps Web Apps
13 Python & REST APIs import urllib, json req = { 		"registrationID":"masnun", 		"password":“******", 		"msisdn":"8801711******" 	} url = "http://masnun.com/aloashbei/location/get" input = urllib.urlopen(url,urllib.urlencode(req)).read() data = json.loads(input) print data['LBSResponse']['Status'] print data['LBSResponse']['Latitude'] print data['LBSResponse']['Longitude']
14 Python & REST APIs: Output C:sersaSnunesktop>rest.py OK 23.780268 90.407782 C:sersaSnunesktop>
15 Google App Engine ,[object Object]
 Persistent storage with queries, sorting and transactions.
 Automatic scaling and load balancing.
 APIs for authenticating users and sending email using Google Accounts.
 A fully featured local development environment that simulates Google App Engine on your computer.
Scheduled tasks for triggering events at specified times and regular intervalsFREE

Contenu connexe

Tendances

Assurer - a pluggable server testing/monitoring framework
Assurer - a pluggable server testing/monitoring frameworkAssurer - a pluggable server testing/monitoring framework
Assurer - a pluggable server testing/monitoring framework
Gosuke Miyashita
 

Tendances (16)

Silex and Twig (PHP Dorset talk)
Silex and Twig (PHP Dorset talk)Silex and Twig (PHP Dorset talk)
Silex and Twig (PHP Dorset talk)
 
How not to develop with Plone
How not to develop with PloneHow not to develop with Plone
How not to develop with Plone
 
Rails 101
Rails 101Rails 101
Rails 101
 
INTERFACE by apidays_Automating style guides for REST, gRPC, or GraphQL by Ph...
INTERFACE by apidays_Automating style guides for REST, gRPC, or GraphQL by Ph...INTERFACE by apidays_Automating style guides for REST, gRPC, or GraphQL by Ph...
INTERFACE by apidays_Automating style guides for REST, gRPC, or GraphQL by Ph...
 
Key features PHP 5.3 - 5.6
Key features PHP 5.3 - 5.6Key features PHP 5.3 - 5.6
Key features PHP 5.3 - 5.6
 
Introduction to PHP
Introduction to PHPIntroduction to PHP
Introduction to PHP
 
Assurer - a pluggable server testing/monitoring framework
Assurer - a pluggable server testing/monitoring frameworkAssurer - a pluggable server testing/monitoring framework
Assurer - a pluggable server testing/monitoring framework
 
Create a web-app with Cgi Appplication
Create a web-app with Cgi AppplicationCreate a web-app with Cgi Appplication
Create a web-app with Cgi Appplication
 
REST with Her (and let Her take care of the REST)
REST with Her (and let Her take care of the REST)REST with Her (and let Her take care of the REST)
REST with Her (and let Her take care of the REST)
 
Magento - a Zend Framework Application
Magento - a Zend Framework ApplicationMagento - a Zend Framework Application
Magento - a Zend Framework Application
 
Application Diagnosis with Zend Server Tracing
Application Diagnosis with Zend Server TracingApplication Diagnosis with Zend Server Tracing
Application Diagnosis with Zend Server Tracing
 
The 90-Day Startup with Google AppEngine for Java
The 90-Day Startup with Google AppEngine for JavaThe 90-Day Startup with Google AppEngine for Java
The 90-Day Startup with Google AppEngine for Java
 
Matt Greenwood & Scott Draves - The Polyglot Beaker Notebook
Matt Greenwood & Scott Draves - The Polyglot Beaker NotebookMatt Greenwood & Scott Draves - The Polyglot Beaker Notebook
Matt Greenwood & Scott Draves - The Polyglot Beaker Notebook
 
Python RESTful webservices with Python: Flask and Django solutions
Python RESTful webservices with Python: Flask and Django solutionsPython RESTful webservices with Python: Flask and Django solutions
Python RESTful webservices with Python: Flask and Django solutions
 
The Basics Of Page Creation
The Basics Of Page CreationThe Basics Of Page Creation
The Basics Of Page Creation
 
Extending burp with python
Extending burp with pythonExtending burp with python
Extending burp with python
 

Similaire à Developing on the aloashbei platform

P H P Part I I, By Kian
P H P  Part  I I,  By  KianP H P  Part  I I,  By  Kian
P H P Part I I, By Kian
phelios
 
Php Asp Net Interoperability Rc Jao
Php Asp Net Interoperability Rc JaoPhp Asp Net Interoperability Rc Jao
Php Asp Net Interoperability Rc Jao
jedt
 
Cakefest 2010: API Development
Cakefest 2010: API DevelopmentCakefest 2010: API Development
Cakefest 2010: API Development
Andrew Curioso
 
Rails Presentation (Anton Dmitriyev)
Rails Presentation (Anton Dmitriyev)Rails Presentation (Anton Dmitriyev)
Rails Presentation (Anton Dmitriyev)
True-Vision
 

Similaire à Developing on the aloashbei platform (20)

P H P Part I I, By Kian
P H P  Part  I I,  By  KianP H P  Part  I I,  By  Kian
P H P Part I I, By Kian
 
Develop webservice in PHP
Develop webservice in PHPDevelop webservice in PHP
Develop webservice in PHP
 
Introduction to PHP
Introduction to PHPIntroduction to PHP
Introduction to PHP
 
Php mysql ppt
Php mysql pptPhp mysql ppt
Php mysql ppt
 
Phpwebdevelping
PhpwebdevelpingPhpwebdevelping
Phpwebdevelping
 
Going crazy with Node.JS and CakePHP
Going crazy with Node.JS and CakePHPGoing crazy with Node.JS and CakePHP
Going crazy with Node.JS and CakePHP
 
สปริงเฟรมเวิร์ค4.1
สปริงเฟรมเวิร์ค4.1สปริงเฟรมเวิร์ค4.1
สปริงเฟรมเวิร์ค4.1
 
working with PHP & DB's
working with PHP & DB'sworking with PHP & DB's
working with PHP & DB's
 
Phpwebdev
PhpwebdevPhpwebdev
Phpwebdev
 
REST API for your WP7 App
REST API for your WP7 AppREST API for your WP7 App
REST API for your WP7 App
 
The new features of PHP 7 - Enrico Zimuel - Codemotion Milan 2016
The new features of PHP 7 - Enrico Zimuel - Codemotion Milan 2016The new features of PHP 7 - Enrico Zimuel - Codemotion Milan 2016
The new features of PHP 7 - Enrico Zimuel - Codemotion Milan 2016
 
The new features of PHP 7
The new features of PHP 7The new features of PHP 7
The new features of PHP 7
 
Php Asp Net Interoperability Rc Jao
Php Asp Net Interoperability Rc JaoPhp Asp Net Interoperability Rc Jao
Php Asp Net Interoperability Rc Jao
 
Workshop KrakYourNet2016 - Web applications hacking Ruby on Rails example
Workshop KrakYourNet2016 - Web applications hacking Ruby on Rails example Workshop KrakYourNet2016 - Web applications hacking Ruby on Rails example
Workshop KrakYourNet2016 - Web applications hacking Ruby on Rails example
 
Php7 HHVM and co
Php7 HHVM and coPhp7 HHVM and co
Php7 HHVM and co
 
Cakefest 2010: API Development
Cakefest 2010: API DevelopmentCakefest 2010: API Development
Cakefest 2010: API Development
 
Create a res tful services api in php.
Create a res tful services api in php.Create a res tful services api in php.
Create a res tful services api in php.
 
Web Scraping with PHP
Web Scraping with PHPWeb Scraping with PHP
Web Scraping with PHP
 
Crafting APIs
Crafting APIsCrafting APIs
Crafting APIs
 
Rails Presentation (Anton Dmitriyev)
Rails Presentation (Anton Dmitriyev)Rails Presentation (Anton Dmitriyev)
Rails Presentation (Anton Dmitriyev)
 

Dernier

TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc
 
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
FIDO Alliance
 

Dernier (20)

TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
 
The Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and InsightThe Zero-ETL Approach: Enhancing Data Agility and Insight
The Zero-ETL Approach: Enhancing Data Agility and Insight
 
Simplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxSimplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptx
 
The Ultimate Prompt Engineering Guide for Generative AI: Get the Most Out of ...
The Ultimate Prompt Engineering Guide for Generative AI: Get the Most Out of ...The Ultimate Prompt Engineering Guide for Generative AI: Get the Most Out of ...
The Ultimate Prompt Engineering Guide for Generative AI: Get the Most Out of ...
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
ERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage Intacct
 
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
 
2024 May Patch Tuesday
2024 May Patch Tuesday2024 May Patch Tuesday
2024 May Patch Tuesday
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...Hyatt driving innovation and exceptional customer experiences with FIDO passw...
Hyatt driving innovation and exceptional customer experiences with FIDO passw...
 
Intro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxIntro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptx
 
Portal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russePortal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russe
 
Choreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software EngineeringChoreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software Engineering
 
JavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate GuideJavaScript Usage Statistics 2024 - The Ultimate Guide
JavaScript Usage Statistics 2024 - The Ultimate Guide
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
 
Overview of Hyperledger Foundation
Overview of Hyperledger FoundationOverview of Hyperledger Foundation
Overview of Hyperledger Foundation
 
Less Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data PlatformLess Is More: Utilizing Ballerina to Architect a Cloud Data Platform
Less Is More: Utilizing Ballerina to Architect a Cloud Data Platform
 

Developing on the aloashbei platform

  • 1. Developing on the AloAshbei Platform A technical session with the AloAshbei registered developers. 17th July, 2010
  • 2. Who Am I? 2 Abu AshrafMasnun Business Student at KU PHP & Python Developer
  • 3. 3 Contained REST APIs Common Mistakes Integration Possibilities Mobilizing the Web
  • 4. 4 REST APIs User makes a request to the REST API. User receives JSON response. Related SOAP API is called on the server. A HTTP POST call is all you need. Doesn’t require you to play with WSDL files. Implement with almost any programming language.
  • 5. 5 How to use REST APIs? 1. Get the URL for a specific API. 2. Gather the required parameters. 3. Make a HTTP POST call to the URL. 4. Parse the JSON response. Let’s see! Can this be any simpler ?
  • 6. 6 REST APIs Code Sample <?php <?php$a['registrationID'] = "masnun"; $a['password'] = "******"; $a['sourceMsisdn'] = '8801711******'; $a['destinationMsisdn'] = '8801711******'; $a['smsPort'] = 7424; $a['msgType'] = 4; $a['charge'] = 2.00; $a['chargedParty'] = '8801711******'; $a['contentArea'] = 'gpgp_psms'; $a['msgContent'] = 'Hello GP API!'; $ch = curl_init("http://masnun.com/aloashbei/sms/send"); curl_setopt($ch, CURLOPT_POST, 1); $data = ""; foreach($a as $k => $v) { $data.= "$k=$v&"; } curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $result = curl_exec($ch); var_dump($result); ?>
  • 7. <?php 7 Parsing JSON Response <?php$dataObject = json_decode($result); echo $dataObject->SendSMSResponse->status; ?>
  • 8. 8 Detailed Docs on REST APIs For documentation and API specific code samples: http://masnun.com/aloashbei/
  • 9. 9 Common Mistakes While Working with the APIs 1. Not editing the WSDL file. 2. Missing out one or more parameter. 3. Wrong Request Name. 4. Miss-matching parameters. 5. Others. Look into the docs. Use the Wiki or Forums. And how to resolve them?
  • 10. 10 Integrations Python PHP SoapClient REST APIs
  • 11. 11 Integration : PHP <?php$soap = new SoapClient("http://localhost/gp/wsdl/WebService_GP_ADP_BizTalk_LBS_Orchestration.asmx"); $a['registrationID'] = "masnun"; $a['msisdn'] = '8801711******'; $a['password'] = “******"; try {     var_dump( $soap->requestLocation( array ("LBSRequest" => $a) ) ); } catch (Exception $e) {      var_dump($e->getMessage());   } ?>
  • 12. 12 Integration : Python Python aims to combine "remarkable power with very clear syntax" Wikipedia PyQT Django / Google App Engine GUI Apps Web Apps
  • 13. 13 Python & REST APIs import urllib, json req = { "registrationID":"masnun", "password":“******", "msisdn":"8801711******" } url = "http://masnun.com/aloashbei/location/get" input = urllib.urlopen(url,urllib.urlencode(req)).read() data = json.loads(input) print data['LBSResponse']['Status'] print data['LBSResponse']['Latitude'] print data['LBSResponse']['Longitude']
  • 14. 14 Python & REST APIs: Output C:sersaSnunesktop>rest.py OK 23.780268 90.407782 C:sersaSnunesktop>
  • 15.
  • 16. Persistent storage with queries, sorting and transactions.
  • 17. Automatic scaling and load balancing.
  • 18. APIs for authenticating users and sending email using Google Accounts.
  • 19. A fully featured local development environment that simulates Google App Engine on your computer.
  • 20. Scheduled tasks for triggering events at specified times and regular intervalsFREE
  • 21. 16 Mobilizing The Web Why mobilize your web applications?
  • 22. 17 Common Challenges in Mobile Web App Development
  • 23. 18 Possibilities on the Mobile Web Messaging/Social Applications. Online Mobile Games. News and Information. Remote control over devices. Content Sharing Services. Possibilities are endless. Let your imagination drive you!