为了让应用更快接入,这里提供了.NET SDK。
本SDK采用的是开源协议New BSD协议,应用开发者可以任意使用此SDK包库文件。使用时,请遵守BSD开源协议的规定。
本SDK使用环境:
开发环境:Visual Studio 2015
框架环境:.NET FRAMEWORK V4+
.net SDK下载
调用:
var api = new HuodairenSDK.Api("Your api key", "Your api secret");
api.GetContainer("运单号,如:MSCU1234567");
返回:
public class ContainerOutput
{
//是否成功
public bool success { get; set; }
//跟踪信息:如isopen=true,则返回的是要打开的链接,否则返回详细的跟踪信息。
public string msg { get; set; }
//是否在新窗口打开
public bool isopen { get; set; }
}
2.支持查询的船公司
调用:
var api = new HuodairenSDK.Api("Your api key", "Your api secret");
api.GetIsTraceShippingCompanys("limit");
返回:
public class SimpleShippingCompany
{
//编码
public string Code { get; set; }
//中文名
public string CnName { get; set; }
//中文全名
public string CnFullName { get; set; }
//英文名
public string EnName { get; set; }
public string EnNameReferred { get; set; }
//有图片(图片调用方式:http://www.ufsoo.com/attachments/shipping/small/{Code}.png)
public bool IsImage { get; set; }
//需要在新窗口查看跟踪信息
public bool IsEnableTrace { get; set; }
}
调用:
var api = new HuodairenSDK.Api("Your api key", "Your api secret");
api.GetAircargo("运单号,如:99912345678 或 999-12345678");
返回List:
public class ContainerOutput
{
//是否成功
public bool success { get; set; }
//跟踪信息:如isopen=true,则返回的是要打开的链接,否则返回详细的跟踪信息。
public string msg { get; set; }
//是否在新窗口打开
public bool isopen { get; set; }
}
2.支持查询的航空公司
调用:
var api = new HuodairenSDK.Api("Your api key", "Your api secret");
api.GetIsTraceAirCompanys("limit");
返回List:
public class SimpleAirCompany
{
// 航空公司二字码
public string Code { get; set; }
// 启用状态
public bool IsEnable { get; set; }
// 航空公司中文名称
public string AirCmpCnName { get; set; }
// 航空公司英语名称
public string AirCmpEnName { get; set; }
// 是否启用图片(图片调用方式:http://www.ufsoo.com/attachments/shipping/small/{Code}.png)
public bool IsImage { get; set; }
// 搜索关键字
public string SearchKeyWord { get; set; }
// 空运运单前缀
public string PreFixCode { get; set; }
//是否需要在新窗口查看查询结果
public bool IsEnableTrace { get; set; }
}
调用:
var api = new HuodairenSDK.Api("Your api key", "Your api secret");
api.GetAirPortList("中文名称/英文名称/三字码/四字码");
返回:
public class ApiOuput
{
//是否异常
public bool error { get; set; }
//异常代码
public Errcode errcode { get; set; }
//异常消息
public string message { get; set; }
//返回对象
public List<FindAirPortCodeAndExpand> result { get; set; }
}
public class FindAirPortCodeAndExpand
{
// 机场代码
public string Code { get; set; }
// 机场中文名
public string CnName { get; set; }
// 机场英文名
public string EnName { get; set; }
// 机场中文国家名
public string CnNation { get; set; }
// 机场英文名国家
public string EnNation { get; set; }
// 机场所属国家
public string Nation { get; set; }
// 机场所属城市
public string City { get; set; }
// 国际民用航空组织代码
public string IcaoCode { get; set; }
// 机场所属国家中文名
public string ExpCnNation { get; set; }
// 机场所属城市中文名
public string CnCity { get; set; }
// 机场所属大洲
public string Continent { get; set; }
// 机场英文名
public string AirportEnName { get; set; }
// 机场中文名
public string AirportCnName { get; set; }
// 机场所属时区
public string GMT { get; set; }
}
2.机场详情
调用:
var api = new HuodairenSDK.Api("Your api key", "Your api secret");
api.GetAirPort("机场代码Code");
返回:
public class ApiOuput
{
//是否异常
public bool error { get; set; }
//异常代码
public Errcode errcode { get; set; }
//异常消息
public string message { get; set; }
//返回对象
public AirPortOutput result { get; set; }
}
public class AirPortOutput
{
// 机场信息
public AirPortCodeAndExpand AirPortAndExpand { get; set; }
}
public class AirPortCodeAndExpand
{
// 机场代码
public string Code { get; set; }
// 机场中文名
public string CnName { get; set; }
public string CnNameJp { get; set; }
public string CnNamePy { get; set; }
// 机场英文名
public string EnName { get; set; }
// 机场中文国家名
public string CnNation { get; set; }
// 机场英文名国家
public string EnNation { get; set; }
// 航线
public string FreightRoutes { get; set; }
// 备注
public string Remark { get; set; }
// 机场所属国家
public string Nation { get; set; }
// 机场所属城市
public string City { get; set; }
// 国际民用航空组织代码
public string IcaoCode { get; set; }
// 机场所属国家中文名
public string ExpCnNation { get; set; }
// 机场所属城市中文名
public string CnCity { get; set; }
// 机场所属英文大洲名称
public string Continent { get; set; }
// 机场所属中文大洲名称
public string CnContinent { get; set; }
// 机场英文名
public string AirportEnName { get; set; }
// 机场中文名
public string AirportCnName { get; set; }
// 机场所在地经度
public string Longitude { get; set; }
// 机场所在地纬度
public string Latitude { get; set; }
// 机场所在海拨
public string Alatitude { get; set; }
// 机场地址
public string AirPortAddress { get; set; }
// 机场跑道介绍
public string AirportRunway { get; set; }
// 机场等级
public string AirportLevel { get; set; }
// 机场交通
public string AirportTraffic { get; set; }
// 航站平面图片
public string TerminalPlan { get; set; }
// 机场起飞航空公司二字码
public string DepartAirCmpCodes { get; set; }
// 机场起飞航空公司英文名称
public string DepartAirCmpEnName { get; set; }
// 直飞机场三字码信息
public string DirectAirportCodes { get; set; }
// 直飞机场英文名称
public string DirectAirportEnNames { get; set; }
// 机场介绍
public string Introduction { get; set; }
// 机场官网
public string AirPortWebSite { get; set; }
// 机场所属时区
public string GMT { get; set; }
// 机场电话
public string AirportTelePhone { get; set; }
// 是否启用
public bool IsEnable { get; set; }
// 机场搜索扩展名
public string AliasName { get; set; }
// 是否启用图片
public bool IsImage { get; set; }
}
调用:
var api = new HuodairenSDK.Api("Your api key", "Your api secret");
api.GetAirLineList("中文名称/英文名称/二字码/三字码");
返回:
public class ApiOuput
{
//是否异常
public bool error { get; set; }
//异常代码
public Errcode errcode { get; set; }
//异常消息
public string message { get; set; }
//返回对象
public List<AirCompany> result { get; set; }
}
public class AirCompany
{
// 航空公司二字码
public string Code { get; set; }
// 航空公司中文名称
public string AirCmpCnName { get; set; }
// 航空公司英文名称
public string AirCmpEnName { get; set; }
// 机场所属国家
public string Nation { get; set; }
// 机场所属国家中文名
public string CnNation { get; set; }
// 机场所属城市
public string City { get; set; }
// 机场所属城市中文名
public string CnCity { get; set; }
// 机场所属英文大洲名称
public string Continent { get; set; }
// 机场所属中文大洲名称
public string CnContinent { get; set; }
// 航空公司LOGO
public string AirCmpLogo { get; set; }
// 国际民用航空组织代码
public string ICAOCode { get; set; }
// 总部所在地
public string HeadQuarter { get; set; }
// 总部所在中文地址
public string CnHeadQuarter { get; set; }
// 机队数量
public int Fleets { get; set; }
// 目的机场数
public int DestinationCityCount { get; set; }
// 公司建立时间
public string BuildingTime { get; set; }
//公司经营理念
public string BusinessPhilosophy { get; set; }
// 所属航空联盟英文名称
public string AirlineAlliance { get; set; }
// 所属航空联盟中文名称
public string CnAirlineAlliance { get; set; }
// 枢纽机场三字码列表
public string HubAirportCodes { get; set; }
// 分支机构二字码列表
public string BranchCodes { get; set; }
// 航空公司官网
public string AirCmpWebSite { get; set; }
// 航空公司呼号
public string AirCmpCallsign { get; set; }
// 航空公司联系电话
public string AirCmpTelePhone { get; set; }
// 航空公司介绍
public string Introduction { get; set; }
// 航空公司别名
public string AliasName { get; set; }
// 纬度
public string Latitude { get; set; }
// 经度
public string Longitude { get; set; }
// 是否有图
public bool IsImage { get; set; }
// 国家数字代码
public string PreFixCode { get; set; }
// 是否启用货物跟踪功能
public bool IsTrace { get; set; }
// 货物跟踪官网
public string CargoWebSite { get; set; }
// 是否能在本网站跟踪货物
public bool IsEnableTrace { get; set; }
}
2.航空公司详情
调用:
var api = new HuodairenSDK.Api("Your api key", "Your api secret");
api.GetAirLine("航空公司Code");
返回:
public class ApiOuput
{
//是否异常
public bool error { get; set; }
//异常代码
public Errcode errcode { get; set; }
//异常消息
public string message { get; set; }
//返回对象
public AirLineOutput result { get; set; }
}
public class AirLineOutput
{
// 航空公司
public AirCompany AirLine { get; set; }
}
调用:
var api = new HuodairenSDK.Api("Your api key", "Your api secret");
api.GetShippingList("中文名称/英文名称/英文缩写");
返回:
public class ApiOuput
{
//是否异常
public bool error { get; set; }
//异常代码
public Errcode errcode { get; set; }
//异常消息
public string message { get; set; }
//返回对象
public List<ShippingCompany> result { get; set; }
}
public class ShippingCompany
{
public string Code { get; set; }
public string CnName { get; set; }
public string CnFullName { get; set; }
public string CnNamePy { get; set; }
public string EnName { get; set; }
public string EnNameReferred { get; set; }
//船公司介绍
public string Introduction { get; set; }
//船公司网址
public string WebSite { get; set; }
//船公司别名
public string AliasName { get; set; }
//英文国家
public string EnNation { get; set; }
//中文国家
public string CnNation { get; set; }
//所属英文大洲
public string EnContinent { get; set; }
//所属中文大洲
public string CnContinent { get; set; }
//中文地址
public string CnAddress { get; set; }
//英文地址
public string EnAddress { get; set; }
///纬度
public string Latitude { get; set; }
//经度
public string Longitude { get; set; }
//联系电话
public string TelePhone { get; set; }
//是否启用图片
public bool IsImage { get; set; }
//船公司货柜查询前缀
public string PreFixCode { get; set; }
//是否启用货物跟踪
public bool IsTrace { get; set; }
//船公司货柜查询网址
public string CargoWebSite { get; set; }
//是否能在本网站跟踪货物
public bool IsEnableTrace { get; set; }
}
2.船公司详情
调用:
var api = new HuodairenSDK.Api("Your api key", "Your api secret");
api.GetShipping("船公司Code");
返回:
public class ApiOuput
{
//是否异常
public bool error { get; set; }
//异常代码
public Errcode errcode { get; set; }
//异常消息
public string message { get; set; }
//返回对象
public ShippingOutput result { get; set; }
}
public class ShippingOutput
{
// 航空公司
public ShippingCompany ShippingCompany { get; set; }
}
调用:
var api = new HuodairenSDK.Api("Your api key", "Your api secret");
api.GetPortList("中文名/英文名称/五字码");
返回:
public class ApiOuput
{
//是否异常
public bool error { get; set; }
//异常代码
public Errcode errcode { get; set; }
//异常消息
public string message { get; set; }
//返回对象
public List<SeaPortCodeExpand> result { get; set; }
}
public class SeaPortCodeExpand
{
//海港英文名
public string SeaPortEnName { get; set; }
//海港中文名
public string SeaPortCnName { get; set; }
//所属城市英文名
public string EnCity { get; set; }
//所属城市中文名
public string CnCity { get; set; }
//所属国英文名
public string EnNation { get; set; }
//所属国家英文名
public string CnNation { get; set; }
//所属大洲英文名
public string EnContinent { get; set; }
//所属大洲中文名
public string CnContinent { get; set; }
//英文航线
public string EnLine { get; set; }
//中文航线
public string CnLine { get; set; }
//海港国际编号
public string SeaPortCode { get; set; }
//所属国家代码
public string NationCode { get; set; }
//纬度
public string Latitude { get; set; }
//经度
public string Longitude { get; set; }
//所属时区
public string UTC { get; set; }
//海港介绍
public string Introduction { get; set; }
//所属港务局英文名
public string EnPortAuthority { get; set; }
//所属港务局中文名
public string CnPortAuthority { get; set; }
//港口英文地址
public string EnAddress { get; set; }
//港口英文地址
public string CnAddress { get; set; }
//联系电话
public string TelePhone { get; set; }
//传真
public string Fax { get; set; }
//800电话
public string Number800 { get; set; }
//网址
public string WebSite { get; set; }
//港口英文类型
public string SeaPortEnType { get; set; }
//港口中文类型
public string SeaPortCnType { get; set; }
//港口中文尺寸
public string SeaPortEnSize { get; set; }
//港口英文尺寸
public string SeaPortCnSize { get; set; }
//港口船只最大吃水深度
public string MaxDraft { get; set; }
//是否为第一进港港口
public bool IsFirstPortEntry { get; set; }
//是否需要提供进港时间
public bool IsETAMessage { get; set; }
//海港英文公告
public string EnPublication { get; set; }
//海港中文公告
public string CnPublication { get; set; }
//航海图
public string NauticalCharts { get; set; }
//是否提供医疗设施
public bool IsMedicalFacilities { get; set; }
//港口尺寸特征英文
public string EnPortSize { get; set; }
//港口尺寸特征中文
public string CnPortSize { get; set; }
//海港保护措施英文
public string EnAsylum { get; set; }
//海港保护措施中文
public string CnAsylum { get; set; }
//最大进港船只尺寸英文
public string EnMaxVesselSize { get; set; }
//最大进港船只尺寸中文
public string CnMaxVesselSize { get; set; }
//港口类型特征英文
public string EnPortCategory { get; set; }
//港口类型特征中文
public string CnPortCategory { get; set; }
//港口是否有转弯区
public bool IsTurningArea { get; set; }
//港口是否提供良好的地勤服务
public bool IsGoodGrounding { get; set; }
//遇潮汐是否限入
public bool IsLimitTidal { get; set; }
//是否限制高度
public bool IsLimitHeight { get; set; }
//是否限制体积
public bool IsLimitSwell { get; set; }
//是否有其它限制
public bool IsLimitOther { get; set; }
//航道深度英文
public string EnChannelDepth { get; set; }
//航道深度中文
public string CnChannelDepth { get; set; }
//货运码头水深英文
public string EnCargoPierDepth { get; set; }
//货运码头水深中文
public string CnCargoPierDepth { get; set; }
//平均潮水深度英文
public string EnMeanTide { get; set; }
//平均潮水深度中文
public string CnMeanTide { get; set; }
//停泊区水深度英文
public string EnMooringDepth { get; set; }
//停泊区水深度中文
public string CnMooringDepth { get; set; }
// 油站所在区水深度英文
public string EnOilTerminalDepth { get; set; }
//油站所在区水深度中文
public string CnOilTerminalDepth { get; set; }
//是否提供引航
public bool IsPilot { get; set; }
//引航是否需付费
public bool IsAvailablePilot { get; set; }
//是否提供必要引航
public bool IsAppositePilot { get; set; }
//是否由当地提供引航协助
public bool IsLocalAssistPilot { get; set; }
//是否提供拖船服务
public bool IsAssistTug { get; set; }
//是否提供打捞服务
public bool IsTugSalvage { get; set; }
//是否需要提供无疫通行证
public bool IsPratique { get; set; }
//是否需要其它检疫证
public bool IsQuarantineOther { get; set; }
//是否需要提供除鼠证书
public bool IsDeratizationCertificate { get; set; }
//是否提供通讯电话服务
public bool IsTelephone { get; set; }
//是否提供无线电服务
public bool IsRadio { get; set; }
//是否提供空运服务
public bool IsAirfreight { get; set; }
//是否提供电报服务
public bool IsTelegraph { get; set; }
//是否提供无线电话服务
public bool IsRadiotelephone { get; set; }
//是否提供铁路服务
public bool IsRailway { get; set; }
//是否有装卸码头
public bool IsWharfStevedoring { get; set; }
//是否能在地中海泊船
public bool IsMedMoor { get; set; }
//是否提供冰块
public bool IsProvideIce { get; set; }
//是否提供船锚
public bool IsProvideAnchor { get; set; }
//是否提供泊船位
public bool IsBeach { get; set; }
//是否配备100吨以上升降机
public bool IsLiftMore100 { get; set; }
//是否配备50-100吨升降机
public bool IsLift50To100 { get; set; }
//是否配备25-49吨升降机
public bool IsLift25To49 { get; set; }
//是否配备25吨以下升降机
public bool IsLift0To24 { get; set; }
//是否配备固定式起重机
public bool IsFixedCranes { get; set; }
//是否配备移动式起重机
public bool IsMobileCranes { get; set; }
//是否配备浮式起重机
public bool IsFloatingCranes { get; set; }
//是否提供泊船服务
public bool IsMooring { get; set; }
//是否提供船泊维修服务
public bool IsApplianceRepair { get; set; }
//是否提供蒸汽机维修
public bool IsSteam { get; set; }
//电子设备维修
public bool IsElectricityRepair { get; set; }
//是否提供电器设备维修
public bool IsElectricity { get; set; }
//是否提供导航设备维修
public bool IsGPRS { get; set; }
//是否提供食物供应
public bool IsFoodSupply { get; set; }
//是否提供燃油
public bool IsFuelSupply { get; set; }
//是否提供泊船码头
public bool IsPierSupply { get; set; }
//是否提供淡水
public bool IsWaterSupply { get; set; }
//是否提供柴油
public bool IsDieselSupply { get; set; }
//是否提供发动机
public bool IsEngineSupply { get; set; }
//维修船坞大小英文
public string EnShipRepair { get; set; }
//维修船坞大小中文
public string CnShipRepair { get; set; }
//海洋铁路尺寸英文
public string EnOceanRailwaySize { get; set; }
//海洋铁路尺寸中文
public string CnOceanRailwaySize { get; set; }
//消磁船坞英文
public string EnDegauss { get; set; }
//消磁船坞中文
public string CnDegauss { get; set; }
//主维修船坞尺寸英文
public string EnMainDockSize { get; set; }
//主维修船坞尺寸中文
public string CnMainDockSize { get; set; }
//港口别称
public string AliasName { get; set; }
//是否提供垃圾处理服务
public bool IsWaste { get; set; }
//是否提供污水处理服务
public bool IsNoBallast { get; set; }
//是否启用图片
public bool IsImage { get; set; }
}
2.港口详情
调用:
var api = new HuodairenSDK.Api("Your api key", "Your api secret");
api.GetPort("港口英文名SeaPortEnName");
返回:
public class ApiOuput
{
//是否异常
public bool error { get; set; }
//异常代码
public Errcode errcode { get; set; }
//异常消息
public string message { get; set; }
//返回对象
public PortOutput result { get; set; }
}
public class PortOutput
{
// 港口详情
public SeaPortCodeExpand SeaPort { get; set; }
}
调用:
var api = new HuodairenSDK.Api("Your api key", "Your api secret");
api.GetAllCurrency();
返回:
public class ApiOuput
{
//是否异常
public bool error { get; set; }
//异常代码
public Errcode errcode { get; set; }
//异常消息
public string message { get; set; }
//返回对象
public List<string[]> result { get; set; }
}
2.货币汇率查询
调用:
var api = new HuodairenSDK.Api("Your api key", "Your api secret");
api.GetCurrencyConvert(decimal amount, string fromCurrency, string toCurrency);
返回:
public class ApiOuput
{
//是否异常
public bool error { get; set; }
//异常代码
public Errcode errcode { get; set; }
//异常消息
public string message { get; set; }
//返回对象(转换后的实际汇率)
public ConvertOutput result { get; set; }
}
public class ConvertOutput
{
public decimal Amount { get; set; }
public decimal Rate { get; set; }
}
3.货币汇率数据
调用:
var api = new HuodairenSDK.Api("Your api key", "Your api secret");
api.GetAllCurrencyRate();
返回:
public class ApiOuput
{
//是否异常
public bool error { get; set; }
//异常代码
public Errcode errcode { get; set; }
//异常消息
public string message { get; set; }
//返回对象
public List<RateOuput> result { get; set; }
}
public class RateOuput
{
public string Currency { get; set; }
public string CurrencyEnName { get; set; }
public string CurrencyCnName { get; set; }
public decimal Rate { get; set; }
}