Project

General

Profile

Wiki » History » Revision 23

Revision 22 (Soh Keong, 05/30/2012 06:00 PM) → Revision 23/25 (Soh Keong, 05/30/2012 06:01 PM)

h1. Wiki 


 h2. Development 

 <pre> 
 URL: http://192.168.2.68:8080/russiaTest/ 
 </pre> 

 h2. ems.get.locations 

 Arguments:  
 <pre> 
 1. type: cities, regions, countries or russia 
 2. plain: true or false 
 sample URL: http://emspost.ru/api/rest/?method=ems.get.locations&type=cities&plain=true 
 </pre> 
 Example method call from russia_ems.jar : 
 <pre> 
   my.com.eCosway.service.RussiaEMSPost post = new my.com.eCosway.service.impl.RussiaEMSPostImpl(); 
   my.com.eCosway.model.LocationResp res = post.getLocations(EMSCommonConstants.CITIES); 
 </pre> 
 !getLocation.png! 

 h2. ems.calculate 

 
 Arguments: 
 <pre> 
 1. from(mandatory except for international shipping): a point of departure 
 2. to(Required): point of destination 
 3. weight(mandatory): the weight of the cargo 
 4. type(mandatory for international delivery): the type of international departure: "doc" - documents (up to 2 kg), "att" - merchandise 
 </pre> 
 sample URL: http://emspost.ru/api/rest/?method=ems.calculate&from=city--abakan&to=city--anadyr&weight=10&type=att 

 Example method call from russia_ems.jar : 
 <pre> 
   my.com.eCosway.service.RussiaEMSPost post = new my.com.eCosway.service.impl.RussiaEMSPostImpl(); 
   my.com.eCosway.model.CalculateResp = post.getPriceAndTerm("city--abakan", "city--anadyr", 10,EMSCommonConstants.TYPE_OF_INTERNATIONAL_DEPARTURE_ATT);  
 </pre> 
 !calculate.png! 

 h2. Step By Step 

 <pre> 
 1. Checkout 'russia_ems_post' code from CVS. 
 2. export it to 'russia_ems.jar'. 
 3. Checkout 'russiaTest' code from CVS. 
 4. To get locations list, refer my.com.eCosway.servlet.CitiServlet 
 5. To get calculation, refer my.com.eCosway.servlet.CalculateServlet 
 </pre> 

 h2. CVS 

 <pre> 
 +Jar source code (russia_ems_post)+ 
 Host: 192.168.2.11 
 Repository path: d:/source/ecoswayNew/russia_ems_post 

 +Test page source (russiaTest)+ 
 Host: 192.168.2.11 
 Repository path: d:/source/ecoswayNew/russiaTest 
 </pre> 

 h2. Jar file 

 <pre> 
 - commons-logging-1.1.1.jar 
 - ezmorph-0.8.1.jar 
 - json-lib-0.9.jar 
 - json-rpc-1.0.jar 
 - russia_ems.jar 
 </pre>