我用C#写了一个连接SAP的webservice,在VS2010调试成功,发布到IIS调试就失败了。
“SAPbobsCOM”这是SAP提供的组件,[WebMethod]publicstringselectOCRD(stringdbName){stringstr="";D...
“SAPbobsCOM”这是SAP提供的组件,
[WebMethod]
public string selectOCRD(string dbName)
{
string str = "";
DBSplPool.InitializeCompany(dbName);
if (DBSplPool.lRetCode != 0)
{
str = DBSplPool.lRetCode.ToString();
}
else
{
SAPbobsCOM.BusinessPartners BusinessPartners;
SAPbobsCOM.Recordset oRecordSet;
BusinessPartners = (SAPbobsCOM.BusinessPartners)DBSplPool.oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oBusinessPartners);
oRecordSet = (SAPbobsCOM.Recordset)DBSplPool.oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset);
oRecordSet.DoQuery("select CardCode,CardName from OCRD where CardCode='01'");
BusinessPartners.Browser.Recordset = oRecordSet;
str = BusinessPartners.CardCode + ":" + BusinessPartners.CardName + ":" + BusinessPartners.CardType;
}
DBSplPool.oCompany.Disconnect();
return str;
}
这是webservice接口方法
平台已经设置为X86
没有报错,
DBSplPool.InitializeCompany(dbName);
就这个地方连不上,
DBSplPool.InitializeCompany这个方法是登陆SAP用的
我的程序是运行了半个月后突然连不上的 展开
[WebMethod]
public string selectOCRD(string dbName)
{
string str = "";
DBSplPool.InitializeCompany(dbName);
if (DBSplPool.lRetCode != 0)
{
str = DBSplPool.lRetCode.ToString();
}
else
{
SAPbobsCOM.BusinessPartners BusinessPartners;
SAPbobsCOM.Recordset oRecordSet;
BusinessPartners = (SAPbobsCOM.BusinessPartners)DBSplPool.oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oBusinessPartners);
oRecordSet = (SAPbobsCOM.Recordset)DBSplPool.oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset);
oRecordSet.DoQuery("select CardCode,CardName from OCRD where CardCode='01'");
BusinessPartners.Browser.Recordset = oRecordSet;
str = BusinessPartners.CardCode + ":" + BusinessPartners.CardName + ":" + BusinessPartners.CardType;
}
DBSplPool.oCompany.Disconnect();
return str;
}
这是webservice接口方法
平台已经设置为X86
没有报错,
DBSplPool.InitializeCompany(dbName);
就这个地方连不上,
DBSplPool.InitializeCompany这个方法是登陆SAP用的
我的程序是运行了半个月后突然连不上的 展开
若以下回答无法解决问题,邀请你更新回答
2个回答
展开全部
错误呢,大哥,另外你自己附加到进程调试过没有?
追问
附加到进程调试 是什么意思? 我是C#新手
追答
到你部署的机器上打开VS,调试菜单下面有个附加到进程,找到W3wp 然后就调试,看看哪里出错了
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
失败后报的啥错?
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询