| 20640 |
amit.gupta |
1 |
package com.bluedart.impl;
|
|
|
2 |
|
|
|
3 |
import com.bluedart.stub.Consignee;
|
|
|
4 |
import com.bluedart.stub.IWayBillGeneration;
|
|
|
5 |
import com.bluedart.stub.Services;
|
|
|
6 |
import com.bluedart.stub.Shipper;
|
|
|
7 |
import com.bluedart.stub.UserProfile;
|
|
|
8 |
import com.bluedart.stub.WayBillGeneration;
|
|
|
9 |
import com.bluedart.stub.WayBillGenerationLocator;
|
|
|
10 |
import com.bluedart.stub.WayBillGenerationRequest;
|
|
|
11 |
|
|
|
12 |
public class BluedartTest {
|
|
|
13 |
|
|
|
14 |
public static void main(String[] args) throws Exception{
|
|
|
15 |
WayBillGeneration wbg = new WayBillGenerationLocator();
|
|
|
16 |
IWayBillGeneration gen = wbg.getWSHttpBinding_IWayBillGeneration();
|
|
|
17 |
WayBillGenerationRequest request = new WayBillGenerationRequest();
|
|
|
18 |
Consignee consignee = new Consignee();
|
|
|
19 |
consignee.setConsigneeAddress1("Addr1");
|
|
|
20 |
consignee.setConsigneeMobile("9990381569");
|
|
|
21 |
consignee.setConsigneeName("Amit");
|
|
|
22 |
consignee.setConsigneeAddress2("Noida");
|
|
|
23 |
consignee.setConsigneeAddress2("Uttar Pradesh");
|
|
|
24 |
consignee.setConsigneePincode("100011");
|
|
|
25 |
request.setConsignee(consignee);
|
|
|
26 |
Shipper shipper = new Shipper();
|
|
|
27 |
shipper.setCustomerAddress1("Arrd1");
|
|
|
28 |
shipper.setCustomerName("Amit");
|
|
|
29 |
shipper.setCustomerEmailID("amit.gupta@shop2020.in");
|
|
|
30 |
request.setShipper(shipper);
|
|
|
31 |
Services s = new Services();
|
|
|
32 |
s.setDeclaredValue(1000d);
|
|
|
33 |
s.setInvoiceNo("121D");
|
|
|
34 |
s.setActualWeight(330d);
|
|
|
35 |
|
|
|
36 |
request.setServices(s);
|
|
|
37 |
String customercode="316326";
|
|
|
38 |
String password = "";
|
|
|
39 |
String isAdmin = "true";
|
|
|
40 |
String licenceKey="5f1740fdfb8196e7980faea7fe52dd0d";
|
|
|
41 |
String api_type="T";
|
|
|
42 |
String loginID = "FA316326";
|
|
|
43 |
String area="FAR";
|
|
|
44 |
String version = "1.3";
|
|
|
45 |
UserProfile profile = new UserProfile(api_type, area, customercode, isAdmin, licenceKey, loginID, password, version );
|
|
|
46 |
System.out.println(gen.generateWayBill(request, profile));
|
|
|
47 |
}
|
|
|
48 |
}
|