Project

General

Profile

Wiki » History » Version 21

Soh Keong, 04/16/2012 02:25 PM

1 1 Soh Keong
h1. Wiki
2
3
4 2 Soh Keong
*Development*
5
<pre>
6 6 Soh Keong
URL: http://192.168.2.68:8080/russiaTest/
7 2 Soh Keong
</pre>
8
9 6 Soh Keong
*ems.get.locations*
10 2 Soh Keong
<pre>
11 6 Soh Keong
Arguments: 
12
1. type: cities, regions, countries or russia
13
2. plain: true or false
14 8 Soh Keong
sample URL: http://emspost.ru/api/rest/?method=ems.get.locations&type=cities&plain=true
15 1 Soh Keong
16 15 Soh Keong
Example method call from russia_ems.jar :
17 6 Soh Keong
  my.com.eCosway.service.RussiaEMSPost post = new my.com.eCosway.service.impl.RussiaEMSPostImpl();
18 14 Soh Keong
  my.com.eCosway.model.LocationResp res = post.getLocations(EMSCommonConstants.CITIES);
19 6 Soh Keong
</pre>
20 21 Soh Keong
!getLocation.png!
21 2 Soh Keong
22 6 Soh Keong
*ems.calculate*
23
<pre>
24 7 Soh Keong
Arguments:
25
1. from(mandatory except for international shipping): a point of departure
26
2. to(Required): point of destination
27
3. weight(mandatory): the weight of the cargo
28 1 Soh Keong
4. type(mandatory for international delivery): the type of international departure: "doc" - documents (up to 2 kg), "att" - merchandise
29 8 Soh Keong
sample URL: http://emspost.ru/api/rest/?method=ems.calculate&from=city--abakan&to=city--anadyr&weight=10&type=att
30
31 15 Soh Keong
Example method call from russia_ems.jar :
32 8 Soh Keong
  my.com.eCosway.service.RussiaEMSPost post = new my.com.eCosway.service.impl.RussiaEMSPostImpl();
33 17 Soh Keong
  my.com.eCosway.model.CalculateResp = post.getPriceAndTerm("city--abakan", "city--anadyr", 10,EMSCommonConstants.TYPE_OF_INTERNATIONAL_DEPARTURE_ATT); 
34 19 Soh Keong
</pre>
35 20 Soh Keong
!calculate.png!
36 1 Soh Keong
37 17 Soh Keong
*Step By Step*
38
<pre>
39
1. Checkout 'russia_ems_post' code from CVS.
40
2. export it to 'russia_ems.jar'.
41
3. Checkout 'russiaTest' code from CVS.
42
4. To get locations list, refer my.com.eCosway.servlet.CitiServlet
43
5. To get calculation, refer my.com.eCosway.servlet.CalculateServlet
44
</pre>
45
46 1 Soh Keong
*CVS*
47 15 Soh Keong
<pre>
48 17 Soh Keong
+Jar source code (russia_ems_post)+
49 1 Soh Keong
Host: 192.168.2.11
50 15 Soh Keong
Repository path: d:/source/ecoswayNew/russia_ems_post
51
52 17 Soh Keong
+Test page source (russiaTest)+
53 15 Soh Keong
Host: 192.168.2.11
54
Repository path: d:/source/ecoswayNew/russiaTest
55 12 Soh Keong
</pre>
56 11 Soh Keong
57
*Jar file*
58
<pre>
59
- commons-logging-1.1.1.jar
60 1 Soh Keong
- ezmorph-0.8.1.jar
61 11 Soh Keong
- json-lib-0.9.jar
62
- json-rpc-1.0.jar
63 15 Soh Keong
- russia_ems.jar
64 11 Soh Keong
</pre>