Developing on the aloashbei platform
Upcoming SlideShare
Loading in...5
×
 

Developing on the aloashbei platform

on

  • 1,370 views

My slides at the AloAshbei developers meet on 17th July, 2010.

My slides at the AloAshbei developers meet on 17th July, 2010.

Statistics

Views

Total Views
1,370
Views on SlideShare
1,370
Embed Views
0

Actions

Likes
0
Downloads
10
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Developing on the aloashbei platform Presentation Transcript

  • 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:UsersmaSnunDesktop>rest.py
    OK
    23.780268
    90.407782
    C:UsersmaSnunDesktop>
  • 15. 15
    Google App Engine
    • Dynamic web serving, with full support for common web technologies
    • 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 intervals
    FREE
  • 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!
  • 24. 19
    Any Queries?
  • 25. 20
    Thank You!