Subversion Repositories SmartDukaan

Rev

Rev 20640 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 20640 Rev 22598
Line 34... Line 34...
34
		Version = v1.0
34
		Version = v1.0
35
		*/
35
		*/
36
		Service_1_0_Service aramexService = new Service_1_0_ServiceLocator();
36
		Service_1_0_Service aramexService = new Service_1_0_ServiceLocator();
37
		Service_1_0_PortType service = aramexService.getBasicHttpBinding_Service_1_0();
37
		Service_1_0_PortType service = aramexService.getBasicHttpBinding_Service_1_0();
38
		ShipmentCreationRequest parameters = new ShipmentCreationRequest();
38
		ShipmentCreationRequest parameters = new ShipmentCreationRequest();
39
		ArrayOfShipment shipments = new ArrayOfShipment();
-
 
40
		Shipment [] shipArray = new Shipment[1];
39
		Shipment [] shipArray = new Shipment[1];
41
		Shipment shpmnt = new Shipment();
40
		Shipment shpmnt = new Shipment();
42
		Party consignee = new Party();
41
		Party consignee = new Party();
43
		
42
		
44
		Contact contact = new Contact();
43
		Contact contact = new Contact();
Line 87... Line 86...
87
		details.setNumberOfPieces(1);
86
		details.setNumberOfPieces(1);
88
		shpmnt.setDetails(details);
87
		shpmnt.setDetails(details);
89
		//shpmnt.sr
88
		//shpmnt.sr
90
		
89
		
91
		shipArray[0]=shpmnt;
90
		shipArray[0]=shpmnt;
92
		shipments.setShipment(shipArray);
-
 
93
		
91
		
94
		LabelInfo labelInfo = new LabelInfo();
92
		LabelInfo labelInfo = new LabelInfo();
95
		labelInfo.setReportID(9729);
93
		labelInfo.setReportID(9729);
96
		labelInfo.setReportType("URL");
94
		labelInfo.setReportType("URL");
97
 
95
 
98
		parameters.setLabelInfo(labelInfo);
96
		parameters.setLabelInfo(labelInfo);
99
		parameters.setClientInfo(getTestClientInfo());
97
		parameters.setClientInfo(getTestClientInfo());
100
		parameters.setShipments(shipments);
98
		parameters.setShipments(shipArray);
101
		
99
		
102
		
100
		
103
		ShipmentCreationResponse scr = service.createShipments(parameters);
101
		ShipmentCreationResponse scr = service.createShipments(parameters);
104
		if(scr.getHasErrors() && (scr.getNotifications() == null ||scr.getShipments().getProcessedShipment(0)==null)) {
102
		if(scr.getHasErrors() && (scr.getNotifications() == null ||scr.getShipments()[0]==null)) {
105
			System.out.println("Some error " +  scr.getNotifications().getNotification());
103
			System.out.println("Some error " +  scr.getNotifications()[0]);
106
			return;
104
			return;
107
		}
105
		}
108
		ProcessedShipment ps = scr.getShipments().getProcessedShipment(0);
106
		ProcessedShipment ps = scr.getShipments()[0];
109
		System.out.println(ps.getID());
107
		System.out.println(ps.getID());
110
		
108
		
111
	}
109
	}
112
	
110
	
113
	private static Party getTestShipper() {
111
	private static Party getTestShipper() {