Waybill way = new Waybill();
string[] array = new string[] { "BE710200102AU" };
way.BillNo = "987-89888888";
way.ArrivalTime = DateTime.Now.AddDays(3);
way.EMCDateTime = DateTime.Now.AddDays(2);
way.EMBDateTime = DateTime.Now.AddDays(1);
way.IncludeTax = true;
way.InputWeight = 10;
way.IsHongKong = false;
way.OutwardOECode = "AEDXBA";
way.ExpressNo = array;
string filePath=AppDomain.CurrentDomain.BaseDirectory + "/json.txt";
way.WaybillFile ="99999$#$" +FileToBase64Str(filePath);
B2COrderServiceClient abc = new B2COrderServiceClient();
ResultMessage sreturn = abc.AddB2CWayBill(way, “user*****”, “Pwd*****”, “key*****”);
if (sreturn.IsSuccess)
{
stringsuccess= sreturn. Data;
}
else
{
string errorMessage = sreturn.Message;
}
com.wms.B2C.client.Waybill way=new com.wms.B2C.client.Waybill();
string[] array = new string[] { "BE710200102AU" };
way.BillNo = "987-89888888";
way.ArrivalTime = DateTime.Now.AddDays(3);
way.EMCDateTime = DateTime.Now.AddDays(2);
way.EMBDateTime = DateTime.Now.AddDays(1);
way.IncludeTax = true;
way.InputWeight = 10;
way.IsHongKong = false;
way.OutwardOECode = "AEDXBA";
way.ExpressNo = array;
String imgFile = "D:/456.jpg";
InputStream in = new FileInputStream(imgFile);
byte[] data = null;
data = new byte[in.available()];
in.read(data);
in.close();
BASE64Encoder encoder = new BASE64Encoder();
String strBase64=encoder.encode(data);
way.WaybillFile ="99999$#$" +strBase64;
com.wms.B2C.client.IB2COrderService query=(com.wms.B2C.client.IB2COrderService) getWSObject("http://b2ctestservice.ekjshop.com/B2COrderService.svc?wsdl");
com.wms.B2C.client.ServiceResult result=query.AddB2CWayBill(way, "user*****", "Pwd*****", "key*****");
System.out.println(result.getIsSuccess());
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}