webService请求类型转换问题
我有一个场景,我必须将数组列表传递给 WebService。
WebService:
[WebMethod]
public void GetCommission(List<BOLibrary.Flight.DTContract> Loc)
{
CommissionManager test = new CommissionManager();
}
客户端:
List<BOLibrary.Flight.DTContract> BoList = new List<BOLibrary.Flight.DTContract>();
BOLibrary.Flight.DTContract dtConboj = new BOLibrary.Flight.DTContract();
dtConboj.ValidatingCarrier = "AA";
DTContract[] loc1 = BoList .ToArray();
service.GetCommission(loc1);
当我尝试执行此操作时,我收到无法将 BOLibrary.Flight.DTContract
转换为 的异常DT合约
这是因为当 webservice 创建代理时考虑 Type(DTContract)
而不是 namespace(BOLibrary.Flight.DTContract)
我必须传递 BOLibrary.Flight.DTContract
类型的列表或数组列表。
请帮忙... 提前致谢...
I have a scenario where i have to pass the array list to the WebService.
WebService:
[WebMethod]
public void GetCommission(List<BOLibrary.Flight.DTContract> Loc)
{
CommissionManager test = new CommissionManager();
}
Client:
List<BOLibrary.Flight.DTContract> BoList = new List<BOLibrary.Flight.DTContract>();
BOLibrary.Flight.DTContract dtConboj = new BOLibrary.Flight.DTContract();
dtConboj.ValidatingCarrier = "AA";
DTContract[] loc1 = BoList .ToArray();
service.GetCommission(loc1);
when i am trying to do this i am getting the exception that cannot convert the BOLibrary.Flight.DTContract
to DTContract
This is because when webservice create proxey consider Type(DTContract)
not namespace(BOLibrary.Flight.DTContract)
and i have to pass the list or arraylist of BOLibrary.Flight.DTContract
Type.
please Help...
Thanks in Advance...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用:
GetCommission(DTContract[] Loc)
您尝试过装箱吗?
Use:
GetCommission(DTContract[] Loc)
Did you try boxing it?