| Line 34... |
Line 34... |
| 34 |
Order oneOrder = orders.get(0);
|
34 |
Order oneOrder = orders.get(0);
|
| 35 |
Party consignee = getConsigneeParty(oneOrder);
|
35 |
Party consignee = getConsigneeParty(oneOrder);
|
| 36 |
Party shipper = getTestShipper();
|
36 |
Party shipper = getTestShipper();
|
| 37 |
shipper.setReference1(oneOrder.getLogisticsTransactionId());
|
37 |
shipper.setReference1(oneOrder.getLogisticsTransactionId());
|
| 38 |
Shipment shp = getShipment(new ShipmentInfo(orders), consignee, shipper);
|
38 |
Shipment shp = getShipment(new ShipmentInfo(orders), consignee, shipper);
|
| - |
|
39 |
shp.setThirdParty(getThirdParty());
|
| 39 |
return getAwb(shp);
|
40 |
return getAwb(shp);
|
| 40 |
} catch (Exception e) {
|
41 |
} catch (Exception e) {
|
| 41 |
e.printStackTrace();
|
42 |
e.printStackTrace();
|
| 42 |
throw e;
|
43 |
throw e;
|
| 43 |
}
|
44 |
}
|
| Line 46... |
Line 47... |
| 46 |
private Shipment getShipment(ShipmentInfo shipmentInfo, Party consignee, Party shipper) {
|
47 |
private Shipment getShipment(ShipmentInfo shipmentInfo, Party consignee, Party shipper) {
|
| 47 |
Shipment shp = new Shipment();
|
48 |
Shipment shp = new Shipment();
|
| 48 |
ShipmentDetails details = new ShipmentDetails();
|
49 |
ShipmentDetails details = new ShipmentDetails();
|
| 49 |
details.setProductGroup("DOM");
|
50 |
details.setProductGroup("DOM");
|
| 50 |
details.setProductType("CDA");
|
51 |
details.setProductType("CDA");
|
| - |
|
52 |
//For thirdParty
|
| 51 |
details.setPaymentType("P");
|
53 |
details.setPaymentType("3");
|
| - |
|
54 |
//details.setPaymentType("P");
|
| 52 |
details.setChargeableWeight(new Weight("KG", shipmentInfo.getTotalWeightInKg()));
|
55 |
details.setChargeableWeight(new Weight("KG", shipmentInfo.getTotalWeightInKg()));
|
| 53 |
details.setActualWeight(new Weight("KG", shipmentInfo.getTotalWeightInKg()));
|
56 |
details.setActualWeight(new Weight("KG", shipmentInfo.getTotalWeightInKg()));
|
| 54 |
details.setDescriptionOfGoods("Electronics");
|
57 |
details.setDescriptionOfGoods("Electronics");
|
| 55 |
details.setGoodsOriginCountry("IN");
|
58 |
details.setGoodsOriginCountry("IN");
|
| 56 |
if(shipmentInfo.isCashOnDelivery()){
|
59 |
if(shipmentInfo.isCashOnDelivery()){
|
| Line 61... |
Line 64... |
| 61 |
details.setNumberOfPieces(shipmentInfo.getTotalPcs());
|
64 |
details.setNumberOfPieces(shipmentInfo.getTotalPcs());
|
| 62 |
|
65 |
|
| 63 |
shp.setDetails(details);
|
66 |
shp.setDetails(details);
|
| 64 |
shp.setShipper(shipper);
|
67 |
shp.setShipper(shipper);
|
| 65 |
shp.setConsignee(consignee);
|
68 |
shp.setConsignee(consignee);
|
| 66 |
shp.setPickupLocation("Gurgaon");
|
69 |
shp.setPickupLocation("Delhi");
|
| 67 |
shp.setShippingDateTime(Calendar.getInstance());
|
70 |
shp.setShippingDateTime(Calendar.getInstance());
|
| 68 |
Calendar dueDate = Calendar.getInstance();
|
71 |
Calendar dueDate = Calendar.getInstance();
|
| 69 |
dueDate.add(Calendar.DATE, 4);
|
72 |
dueDate.add(Calendar.DATE, 4);
|
| 70 |
shp.setDueDate(dueDate);
|
73 |
shp.setDueDate(dueDate);
|
| 71 |
|
74 |
|
| Line 94... |
Line 97... |
| 94 |
consignee.setContact(contact);
|
97 |
consignee.setContact(contact);
|
| 95 |
|
98 |
|
| 96 |
return consignee;
|
99 |
return consignee;
|
| 97 |
}
|
100 |
}
|
| 98 |
|
101 |
|
| - |
|
102 |
private Party getThirdParty() {
|
| - |
|
103 |
Party thirdParty = new Party();
|
| - |
|
104 |
|
| - |
|
105 |
thirdParty.setAccountNumber("IDA10002");
|
| - |
|
106 |
|
| - |
|
107 |
Address thirdPartyAddress = new Address();
|
| - |
|
108 |
thirdPartyAddress.setCountryCode("IN");
|
| - |
|
109 |
thirdPartyAddress.setLine1("S Global Knowledge Park");
|
| - |
|
110 |
thirdPartyAddress.setLine2("19A & 19B, Sector-125");
|
| - |
|
111 |
thirdPartyAddress.setPostCode("201301");
|
| - |
|
112 |
thirdPartyAddress.setStateOrProvinceCode("Uttar Pradesh");
|
| - |
|
113 |
thirdPartyAddress.setCity("Noida");
|
| - |
|
114 |
|
| - |
|
115 |
Contact sc = new Contact();
|
| - |
|
116 |
sc.setEmailAddress("deena.nath@profitmandi.com");
|
| - |
|
117 |
sc.setCellPhone("9311608716");
|
| - |
|
118 |
sc.setCompanyName("New Spice Solutions Private Limited");
|
| - |
|
119 |
sc.setPersonName("Deenanath Gupta");
|
| - |
|
120 |
sc.setPhoneNumber1("9311608716");
|
| - |
|
121 |
|
| - |
|
122 |
thirdParty.setPartyAddress(thirdPartyAddress);
|
| - |
|
123 |
thirdParty.setContact(sc);
|
| - |
|
124 |
|
| - |
|
125 |
|
| - |
|
126 |
return thirdParty;
|
| - |
|
127 |
}
|
| - |
|
128 |
|
| 99 |
private String getAwb(Shipment shipment) throws Exception{
|
129 |
private String getAwb(Shipment shipment) throws Exception{
|
| 100 |
Service_1_0_Service aramexService = new Service_1_0_ServiceLocator();
|
130 |
Service_1_0_Service aramexService = new Service_1_0_ServiceLocator();
|
| 101 |
Service_1_0_PortType service = aramexService.getBasicHttpBinding_Service_1_0();
|
131 |
Service_1_0_PortType service = aramexService.getBasicHttpBinding_Service_1_0();
|
| 102 |
ShipmentCreationRequest parameters = new ShipmentCreationRequest();
|
132 |
ShipmentCreationRequest parameters = new ShipmentCreationRequest();
|
| 103 |
ArrayOfShipment shipments = new ArrayOfShipment();
|
133 |
ArrayOfShipment shipments = new ArrayOfShipment();
|
| Line 133... |
Line 163... |
| 133 |
private static ClientInfo getLiveClientInfo() {
|
163 |
private static ClientInfo getLiveClientInfo() {
|
| 134 |
ClientInfo clientInfo = new ClientInfo();
|
164 |
ClientInfo clientInfo = new ClientInfo();
|
| 135 |
clientInfo.setAccountCountryCode("IN");
|
165 |
clientInfo.setAccountCountryCode("IN");
|
| 136 |
clientInfo.setAccountNumber("IDA10002");
|
166 |
clientInfo.setAccountNumber("IDA10002");
|
| 137 |
clientInfo.setVersion("v1.0");
|
167 |
clientInfo.setVersion("v1.0");
|
| 138 |
clientInfo.setAccountEntity("DEL");
|
168 |
clientInfo.setAccountEntity("IDA");
|
| 139 |
clientInfo.setUserName("deena.nath@profitmandi.com");
|
169 |
clientInfo.setUserName("deena.nath@profitmandi.com");
|
| 140 |
clientInfo.setPassword("Profitmandi@123");
|
170 |
clientInfo.setPassword("Profitmandi@123");
|
| 141 |
clientInfo.setAccountPin("554654");
|
171 |
clientInfo.setAccountPin("554654");
|
| 142 |
return clientInfo;
|
172 |
return clientInfo;
|
| 143 |
}
|
173 |
}
|
| Line 154... |
Line 184... |
| 154 |
return clientInfo;
|
184 |
return clientInfo;
|
| 155 |
}*/
|
185 |
}*/
|
| 156 |
|
186 |
|
| 157 |
private Party getTestShipper() {
|
187 |
private Party getTestShipper() {
|
| 158 |
Party shipper = new Party();
|
188 |
Party shipper = new Party();
|
| 159 |
shipper.setAccountNumber("IDA10002");
|
- |
|
| 160 |
Contact sc = new Contact();
|
189 |
Contact sc = new Contact();
|
| 161 |
sc.setEmailAddress("deena.nath@profitmandi.com");
|
190 |
sc.setEmailAddress("deena.nath@profitmandi.com");
|
| 162 |
sc.setCellPhone("9311608716");
|
191 |
sc.setCellPhone("9311608716");
|
| 163 |
sc.setCompanyName("New Spice Solutions Private Limited");
|
192 |
sc.setCompanyName("New Spice Solutions Private Limited");
|
| 164 |
sc.setPersonName("Deenanath Gupta");
|
193 |
sc.setPersonName("Deenanath Gupta");
|
| 165 |
sc.setPhoneNumber1("9311608716");
|
194 |
sc.setPhoneNumber1("9311608716");
|
| 166 |
shipper.setContact(sc);
|
195 |
shipper.setContact(sc);
|
| 167 |
Address shipperAddress = new Address();
|
196 |
Address shipperAddress = new Address();
|
| 168 |
shipperAddress.setLine1("Khasra No-322, Second Floor");
|
197 |
shipperAddress.setLine1("Khasra No-322, Second Floor");
|
| 169 |
shipperAddress.setLine2("Opp. Purani Tel Mil, Neb Sarai");
|
198 |
shipperAddress.setLine2("Opp. Purani Tel Mil, Neb Sarai");
|
| 170 |
shipperAddress.setCity("New Delhi");
|
- |
|
| 171 |
shipperAddress.setCountryCode("IN");
|
199 |
shipperAddress.setCountryCode("IN");
|
| 172 |
shipperAddress.setPostCode("110068");
|
200 |
shipperAddress.setPostCode("110068");
|
| 173 |
shipper.setPartyAddress(shipperAddress);
|
201 |
shipper.setPartyAddress(shipperAddress);
|
| - |
|
202 |
//ccountNumber("IDA10002");
|
| 174 |
return shipper;
|
203 |
return shipper;
|
| 175 |
}
|
204 |
}
|
| 176 |
|
205 |
|
| 177 |
public static void main(String[] args) {
|
206 |
public static void main(String[] args) {
|
| 178 |
List<Order> orders = new ArrayList<Order>();
|
207 |
List<Order> orders = new ArrayList<Order>();
|