I am uploading the "trackingnumber" and "carrier information" to an order using the API interface. I use the "setshippingcarrierused()" and "setshipmenttrackingnumber()" methods in the "shipmenttrackingdetailstype" class in "GetordersCall", but the problem is that when I actually use these two methods, Null pointer exception is always returned, resulting in failure to upload relevant information to the order.Is there a problem with my program or API interface?
1、ShippingDetailsType shippingDetails=new ShippingDetailsType();
2、ShipmentTrackingDetailsType[] shipmentTrackingDetails2 =new ShipmentTrackingDetailsType[2];
3、shipmentTrackingDetails2[1].setShippingCarrierUsed("USPS");
4、shipmentTrackingDetails2[1].setShipmentTrackingNumber("9214490280018523788888");
5、shippingDetails.setShipmentTrackingDetails(shipmentTrackingDetails2);
6、orders[7].setShippingDetails(shippingDetails);
The above is my java code. Every time I run to step 3, an error will be reported. Is the error displayed? Null pointer exception!