自己写的webservice 调用后运行说未将对象引用设置到对象的实例 求解 已经确定是webservice这边的问题了 60
publicclassticketTypeDTO{privateintbAutoSellField;privateintbPrintRfidField;privatein...
public class ticketTypeDTO
{
private int bAutoSellField;
private int bPrintRfidField;
private int bRetailField;
private int bRfidField;
private int fieldIdField;
private string fieldNameField;
private string movieNameField;
private string perKindNameField;
private int priceField;
private int ticketIdField;
private string ticketNameField;
public int BAutoSell
{
get
{
return this.bAutoSellField;
}
set
{
this.bAutoSellField = value;
}
}
//……略去其它的GET{}SET{}
}
[WebMethod(Description = "获得票种信息")]
public ticketTypeDTO[] getAllTicketType()
{ ticketTypeDTO[] GTTR = new ticketTypeDTO[2];
GTTR[0].fieldName = "巨幕场馆";
GTTR[0].fieldId = 775;
GTTR[0].ticketId = 21;
GTTR[0].ticketName = "巨幕电影";
GTTR[0].BPrintRfid = 1;
GTTR[0].perKindName = "学生票";
GTTR[0].price = 20;
GTTR[0].movieName = "源代码";
GTTR[0].BAutoSell = 1;
GTTR[0].BRetail = 1;
GTTR[0].BRfid = 0;
GTTR[1].fieldName = "3D场馆";
GTTR[1].fieldId = 774;
GTTR[1].ticketId = 22;
GTTR[1].ticketName = "3D电影";
GTTR[1].BPrintRfid = 1;
GTTR[1].perKindName = "学生票";
GTTR[1].price = 20;
GTTR[1].movieName = "变形金刚3";
GTTR[1].BAutoSell = 1;
GTTR[1].BRetail = 1;
GTTR[1].BRfid = 0;
return GTTR;}
现在直接点进webservice点方法,然后调用会500错误……求问题出在哪里
算了,我纠结了一下午自己解决了 展开
{
private int bAutoSellField;
private int bPrintRfidField;
private int bRetailField;
private int bRfidField;
private int fieldIdField;
private string fieldNameField;
private string movieNameField;
private string perKindNameField;
private int priceField;
private int ticketIdField;
private string ticketNameField;
public int BAutoSell
{
get
{
return this.bAutoSellField;
}
set
{
this.bAutoSellField = value;
}
}
//……略去其它的GET{}SET{}
}
[WebMethod(Description = "获得票种信息")]
public ticketTypeDTO[] getAllTicketType()
{ ticketTypeDTO[] GTTR = new ticketTypeDTO[2];
GTTR[0].fieldName = "巨幕场馆";
GTTR[0].fieldId = 775;
GTTR[0].ticketId = 21;
GTTR[0].ticketName = "巨幕电影";
GTTR[0].BPrintRfid = 1;
GTTR[0].perKindName = "学生票";
GTTR[0].price = 20;
GTTR[0].movieName = "源代码";
GTTR[0].BAutoSell = 1;
GTTR[0].BRetail = 1;
GTTR[0].BRfid = 0;
GTTR[1].fieldName = "3D场馆";
GTTR[1].fieldId = 774;
GTTR[1].ticketId = 22;
GTTR[1].ticketName = "3D电影";
GTTR[1].BPrintRfid = 1;
GTTR[1].perKindName = "学生票";
GTTR[1].price = 20;
GTTR[1].movieName = "变形金刚3";
GTTR[1].BAutoSell = 1;
GTTR[1].BRetail = 1;
GTTR[1].BRfid = 0;
return GTTR;}
现在直接点进webservice点方法,然后调用会500错误……求问题出在哪里
算了,我纠结了一下午自己解决了 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询