• Operational Research Web Services
    • LIMOS 2012 : Webservices' Development
    • LOGO LIMOS

    •    Homepage   
    •    Svg2png   
    •    Jobshop   
    •    GPS for pedestrian   
    •    Job shop time lags   
    •    VRP   
    •    Community-based GPS    
    •    Bin packing    
  • WS for pedestrian   |   Core developper   |   Server application   |   API reference   |   client application : Java   |   client application : Mobile

    • Web services for pedestrian itinerary 
    • Limitations:
                The maximum number of procedures which are executed simultaneously on the server for the same IP is 2.
                The maximal number of simultaneous users is limited to 10 (10 different IP addresses)        
                The maximal number of calls is limited to 5000 per day for each key        

                [ Obtain a web service api key for developper ]        

    • Core developper  
    • photo de Benjamin
      Benjamin

      Email :
      Benjamin.Vincent@etudiant.univ-bpclermont.fr
      Polytech'Clermont Ferrand student
      Blaise Pascal University
      Campus des Cézeaux, 63173 Aubière CEDEX
    •  
     
    • Web service : Netbeans + GlassFish
     

    • Java Web Service link :

    • http://orws2.isima.fr/Recuperation_donnee/Recuperation_donnee?WSDL


    • Web Service :
    • Download Java Web Service

    • Web service : API Reference
     


    • Function 1 : [String result] Demarrer_Guidage (double latitude_1, double longitude_1, double latitude_2, double longitude_2, String clef)
      description :
          Function to send the request calculation itinerary between two points GPS given in parameters.

      input :
          latitude_1 : GPS latitude of the start point.
          longitude_1 : GPS longitude of the start point.
          latitude_2 : GPS latitude of the end point.
          longitude_2 : GPS longitude of the end point.
          clef : Key of the api.

      output:
          result :
            #1# : "Task accepted : in progress…"
            #2# : "Task declined : too many connections, try later"
            #3# : "No available result"
            #4# : "Task in progress…"
            #5# : "Invalid key"
            #6# : "Error on the server side"
            otherwise : "Unknown error"
    • Function 2 : [String result] TesterEtatDemande(String clef)
      description :
          Function to check the state of the Demarrer_Guidage() call

      input :
          clef : Key of the api.

      output:
          result :
            #1# : "Task accepted : in progress…"
            #2# : "Task declined : too many connections, try later"
            #3# : "No available result"
            #4# : "Task in progress…"
            #5# : "Invalid key"
            #6# : "Error on the server side"
            otherwise : "Unknown error"
    • Function 3 : [String result] RecupererResultatGuidage(String clef)
      description :
          Function to obtain the result of the Demarrer_Guidage() call. Return the itinerary as a list of the GPS points if the calculate is finished, otherwise return a code when an error has occurred

      input :
          clef : Key of the api.

      output:
          result :
            #1# : "Task accepted : in progress…"
            #2# : "Task declined : too many connections, try later"
            #3# : "No available result"
            #4# : "Task in progress…"
            #5# : "Invalid key"
            #6# : "Error on the server side"
            otherwise : "Unknown error"
    • Function 4 : [String message] lireCodeRetour(String code)
      description :
          Function to get the description of the code.

      input :
          code : code returned by a web fonction

      output:
          message : description of the code




    • Client 1 : Java application
     


    • Source code is available here : Download
      photo_creation


     
    • How to create a Java client in 5 minutes ?

    • Start Netbeans and create a new Java application
      photo_creation

      Take one minute to achieve a main window which could be similar to the next window :
      photo_creation

      Add to the projet a reference to the web service. Use for example the following address :
      http://orws2.isima.fr/Recuperation_donnee/Recuperation_donnee?WSDL

      The web service reference must be visible now in the project.
      photo_creation

      The code Java implementation to manage the button-clicked event is divided into 3 steps :

      Step 1
      Create a reference to the Soap server :

              webservice.WebServiceJobShop_Service service = new webservice.WebServiceJobShop_Service();
              webservice.WebServiceJobShop port = service.getWebServiceJobShopPort();
      


      Step 2
      Start to calculate the itinerary :

              double lati1 = 45.758451, longi1 = 3.105476;
              double lati2 = 45.776234, longi2 = 3.091571;
              String key = "7780458c95b922qbda15";
              String rlt =  port.demarrerGuidage(lati1, longi1, lati2, longi2, key);
              jTextArea1.setText(jTextArea1.getText() + "resultat = " + rlt+"\n");
      


      Step 3
      Obtain the result :

              do{
                      rlt =  port.recupererResultatGuidage(key);
                      try{ 
                              Thread.sleep(1000);
                      }catch(Exception E){
                              break;
                      };   
              }while (rlt.contains("#4#"));
              jTextArea1.setText(jTextArea1.getText() + "resultat = " + rlt+"\n");
      


      The full code to manage the button-clicked event


              webservice.WebServiceJobShop_Service service = new webservice.WebServiceJobShop_Service();
              webservice.WebServiceJobShop port = service.getWebServiceJobShopPort();
      
              double lati1 = 45.758451, longi1 = 3.105476;
              double lati2 = 45.776234, longi2 = 3.091571;
              String key = "7780458c95b922qbda15";
              String rlt =  port.demarrerGuidage(lati1, longi1, lati2, longi2, key);
              jTextArea1.setText(jTextArea1.getText() + "resultat = " + rlt+"\n");
              
              do{
                      rlt =  port.recupererResultatGuidage(key);
                      try{ 
                              Thread.sleep(1000);
                      }catch(Exception E){
                              break;
                      };   
              }while (rlt.contains("#4#"));
              jTextArea1.setText(jTextArea1.getText() + "resultat = " + rlt+"\n");
      




    • Client 2 : mobile application (Android)
     

    • This is an example of mobile client application which uses the Web Service for pedestrian Itinerary.



      APK file : Download
      Source code : Download

      P.S.: The device needs to be running at least Android 3.0 (API level: 11) to use this application.

     
    • Appplication : User Manuel

    • The web page in html format is available here....
       
      • Number of visitors : 3612
      |
        Last update : 30 may 2013