Project

General

Profile

Wiki » History » Version 24

Soh Keong, 01/14/2013 10:27 AM

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