Project

General

Profile

Wiki » History » Version 23

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