我在做WEB SERVICE读取SAP数据时,遇到一个问题,WEB SERVICE所返回的DATASET在WEBFORM中可以正常使用,但在WINFORM中
报如下错误:

附件:
您所在的用户组无法下载或查看附件 [img]C:\Documents and Settings\Administrator\My Documents\My Pictures\error.bmp[/img]
相关代码段如下:
[WebMethod]
public DataSet HelloWorld()
{
string cs;
cs="ASHOST=SAP USER=DDIC PASSWD=19920706 CLIENT=0 SYSNR=0";
SAPProxy1 proxy=new SAPProxy1(cs);
BRFCKNA1Table tblcust=new BRFCKNA1Table();
proxy.Rfc_Customer_Get("","*",ref tblcust);
DataSet ds=new DataSet();
ds.Tables.Add(tblcust.ToADODataTable());
proxy.CommitWork();
return ds;
}
以上是WEBSERVICE中的方法
----------------------------------------------------------------------------------------------------------------------------
WebReference.Service1 ws=new WindowsApplication3.WebReference.Service1();
DataSet ds=new DataSet();
ds=ws.HelloWorld();
dataGrid1.DataSource=ds;
dataGrid1.Refresh();
以上是winform调用方法
----------------------------------------------------------------------------------------------------------------------------
private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面
DataSet ds=new DataSet();
Service1 ser=new Service1();
DataGrid1.DataSource=ser.HelloWorld();
DataGrid1.DataBind();
}
以上是是能够成功调用的WEBFORM
----------------------------------------------------------------------------------------------------------------------------
附中的两个XML文档一个是直接使用WEBSERVICE读取SQL数据库的(TEST),一个是调用SAP .NET CONNECTOR所返回的(helloword).
附件:
相关XML.rar