Subversion Repositories SmartDukaan

Rev

Rev 22575 | Rev 22598 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 22575 Rev 22577
Line 2... Line 2...
2
 
2
 
3
import in.shop2020.model.v1.order.Order;
3
import in.shop2020.model.v1.order.Order;
4
 
4
 
5
import java.util.ArrayList;
5
import java.util.ArrayList;
6
import java.util.Calendar;
6
import java.util.Calendar;
-
 
7
import java.util.Date;
7
import java.util.List;
8
import java.util.List;
8
 
9
 
9
import javax.xml.ws.BindingProvider;
-
 
10
import javax.xml.ws.handler.Handler;
-
 
11
 
-
 
12
import com.aramex.stub.Address;
10
import com.aramex.stub.Address;
13
import com.aramex.stub.ArrayOfShipment;
11
import com.aramex.stub.ArrayOfShipment;
14
import com.aramex.stub.ClientInfo;
12
import com.aramex.stub.ClientInfo;
15
import com.aramex.stub.Contact;
13
import com.aramex.stub.Contact;
16
import com.aramex.stub.LabelInfo;
14
import com.aramex.stub.LabelInfo;
Line 129... Line 127...
129
	}
127
	}
130
	
128
	
131
	private String getAwb(Shipment shipment) throws Exception{
129
	private String getAwb(Shipment shipment) throws Exception{
132
		Service_1_0_Service aramexService = new Service_1_0_ServiceLocator();
130
		Service_1_0_Service aramexService = new Service_1_0_ServiceLocator();
133
		Service_1_0_PortType service = aramexService.getBasicHttpBinding_Service_1_0();
131
		Service_1_0_PortType service = aramexService.getBasicHttpBinding_Service_1_0();
134
		BindingProvider bindProv =(BindingProvider)service;
-
 
135
		java.util.List<Handler> handlers = bindProv.getBinding().getHandlerChain();
-
 
136
		handlers.add(new MyServiceLogHandler());
-
 
137
		bindProv.getBinding().setHandlerChain(handlers);
-
 
138
		ShipmentCreationRequest parameters = new ShipmentCreationRequest();
132
		ShipmentCreationRequest parameters = new ShipmentCreationRequest();
139
		ArrayOfShipment shipments = new ArrayOfShipment();
133
		ArrayOfShipment shipments = new ArrayOfShipment();
140
		Shipment [] shipArray = new Shipment[1];
134
		Shipment [] shipArray = new Shipment[1];
141
		
135
		
142
		
136
		
Line 148... Line 142...
148
		labelInfo.setReportType("URL");
142
		labelInfo.setReportType("URL");
149
		parameters.setLabelInfo(labelInfo);
143
		parameters.setLabelInfo(labelInfo);
150
		parameters.setClientInfo(getLiveClientInfo());
144
		parameters.setClientInfo(getLiveClientInfo());
151
		parameters.setShipments(shipments);
145
		parameters.setShipments(shipments);
152
		
146
		
153
		
147
		System.out.println(parameters);
154
		ShipmentCreationResponse scr = service.createShipments(parameters);
148
		ShipmentCreationResponse scr = service.createShipments(parameters);
155
		if(scr.getHasErrors()){
149
		if(scr.getHasErrors()){
156
			if(scr.getNotifications() != null && scr.getNotifications().getNotification() != null){
150
			if(scr.getNotifications() != null && scr.getNotifications().getNotification() != null){
157
				System.out.println("Some error " +  scr.getNotifications().getNotification(0).getMessage());
151
				System.out.println("Some error " +  scr.getNotifications().getNotification(0).getMessage());
158
			}
152
			}