| Line 140... |
Line 140... |
| 140 |
LabelInfo labelInfo = new LabelInfo();
|
140 |
LabelInfo labelInfo = new LabelInfo();
|
| 141 |
labelInfo.setReportID(9729);
|
141 |
labelInfo.setReportID(9729);
|
| 142 |
labelInfo.setReportType("URL");
|
142 |
labelInfo.setReportType("URL");
|
| 143 |
parameters.setLabelInfo(labelInfo);
|
143 |
parameters.setLabelInfo(labelInfo);
|
| 144 |
parameters.setClientInfo(getLiveClientInfo());
|
144 |
parameters.setClientInfo(getLiveClientInfo());
|
| 145 |
parameters.setShipments(shipments);
|
145 |
parameters.setShipments(shipArray);
|
| 146 |
|
146 |
|
| 147 |
System.out.println(parameters);
|
147 |
System.out.println(parameters);
|
| 148 |
ShipmentCreationResponse scr = service.createShipments(parameters);
|
148 |
ShipmentCreationResponse scr = service.createShipments(parameters);
|
| 149 |
if(scr.getHasErrors()){
|
149 |
if(scr.getHasErrors()){
|
| 150 |
if(scr.getNotifications() != null && scr.getNotifications().getNotification() != null){
|
150 |
if(scr.getNotifications() != null && scr.getNotifications()[0]!= null){
|
| 151 |
System.out.println("Some error " + scr.getNotifications().getNotification(0).getMessage());
|
151 |
System.out.println("Some error " + scr.getNotifications()[0].getMessage());
|
| 152 |
}
|
152 |
}
|
| 153 |
ProcessedShipment s = scr.getShipments().getProcessedShipment(0);
|
153 |
ProcessedShipment s = scr.getShipments()[0];
|
| 154 |
if (s!=null && s.getNotifications() != null && s.getNotifications().getNotification() != null) {
|
154 |
if (s!=null && s.getNotifications() != null && s.getNotifications()[0] != null) {
|
| 155 |
System.out.println("Some error in shipment" + s.getNotifications().getNotification(0).getMessage());
|
155 |
System.out.println("Some error in shipment" + s.getNotifications()[0].getMessage());
|
| 156 |
}
|
156 |
}
|
| 157 |
throw new Exception();
|
157 |
throw new Exception();
|
| 158 |
}
|
158 |
}
|
| 159 |
ProcessedShipment ps = scr.getShipments().getProcessedShipment(0);
|
159 |
ProcessedShipment ps = scr.getShipments()[0];
|
| 160 |
return ps.getID();
|
160 |
return ps.getID();
|
| 161 |
}
|
161 |
}
|
| 162 |
|
162 |
|
| 163 |
private static ClientInfo getLiveClientInfo() {
|
163 |
private static ClientInfo getLiveClientInfo() {
|
| 164 |
ClientInfo clientInfo = new ClientInfo();
|
164 |
ClientInfo clientInfo = new ClientInfo();
|