我已经出现在我的web服务和即使我心中已经有一个看看这个空问题上的文章这个错误,我无法找到如何解决这个错误
这是我的代码:
SendInvUpdate.InvServices.UpdateRatePackagesRequest urq = new SendInvUpdate.InvServices.UpdateRatePackagesRequest();
SendInvUpdate.InvServices.UpdateRatePackagesOperationResponse ors = new SendInvUpdate.InvServices.UpdateRatePackagesOperationResponse();
protected void Page_Load(object sender, EventArgs e)
{
Int64 HID = 819942;
Int64 HRID = 154482;
SendInvUpdate.InvServices.UpdateRatePackagesRequest request = new SendInvUpdate.InvServices.UpdateRatePackagesRequest();
ChannelManagerAccount account = new ChannelManagerAccount();
request.HotelId = HID;
int avail = 4;
DateTime frodte = Convert.ToDateTime("2012-04-12");
DateTime todte = Convert.ToDateTime("2012-04-30");
int NoofRatePackages = 3;
UpdateRatePackageRequest[] RatePackages = new UpdateRatePackageRequest[NoofRatePackages];
string res;
request.RatePackages = new UpdateRatePackageRequest[NoofRatePackages];
request.RatePackages = RatePackages;
UpdateRatePackageRequest rp = new UpdateRatePackageRequest();
for (int i = 0; i < NoofRatePackages; i++)
{
rp.RatePackageId = HRID;
RateDetails[] Rates = new RateDetails[NoofRatePackages];
rp.Rates = new RateDetails[NoofRatePackages];
rp.Rates = Rates;
RateDetails rd = new RateDetails();
for (int j = 0; j < NoofRatePackages; j++)
{
rd.Availability = avail;
rd.AvailabilityApplicationType = SendInvUpdate.InvServices.AvailabilityApplicationType.SET;
rd.FromDate = frodte;
rd.ToDate = todte;
}
}
SendInvUpdate.InvServices.InventoryServiceClient icc = new SendInvUpdate.InvServices.InventoryServiceClient();
// ( *Line where the error appears*)
ors = icc.UpdateRatePackages(request);
res = ors.Results.ToString();
}
我知道它有什么做的RateDetails阵列和初始化的RateDetails到的请求即时的价值,但我不知道怎样还是怎样与关于这一点。 在调试模式下看着RP的值时,存在用于rp.Rates [0]没有值,rp.Rates [1],rp.Rates [2]也RatePackages [0],RatePackages [1],RatePackages [2]是也为空,所以我有一个强烈的感觉,多数民众赞成在我的问题是,但我没有关于如何解决的线索。
将是任何类型的有识之士到我已经错了感谢!