Project

General

Profile

Wiki » History » Version 22

Soh Keong, 05/30/2012 06:00 PM

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