我在使用已过期文档的第三方API时遇到问题,所以我试图弄清楚为什么这一片@#$!不工作。并通过@#$!我的意思是“代码”,当然:)C#错误(使用接口方法):非静态字段,方法或属性需要对象引用
所以据我所知WAPISoap是一个公共接口,我已经通过在visual studio中添加一个web引用获得。
我也知道Describe()方法接受两个参数,一个字符串和一个凭证类型的对象,它返回一个字符串。任何帮助将不胜感激:)
这里就是我有这么远:
using WAPIClient;
using System;
using Project1.WsWWDAPI;
namespace WAPIClient
{
class ResellerAPI
{
public void CallDescribe()
{
String sReturnXml;
Credential m_Crededential = new Project1.WsWWDAPI.Credential();
m_Crededential.Account = "account";
m_Crededential.Password = "password";
String sCLTRID = System.Guid.NewGuid().ToString();
sReturnXml = WAPISoap.Describe(sCLTRID, m_Crededential);
Console.WriteLine(sReturnXml);
}
static void Main(string[] args)
{
ResellerAPI reseller = new ResellerAPI();
reseller.CallDescribe();
}
}
}
什么线是错误的?带有Describe()的行? –
是的,错误是当我尝试调用方法WAPISoap.Describe(sCLTRID,m_Crededential); – ezra