问题描述
我正在尝试使用.net core 2.2中netsuite的soap Web服务。尝试调用reference.cs中提供的方法时,该方法引发错误:“远程服务器返回了意外的响应:(410)已消失。”
这是我尝试过的:
public async Task<AdarzaService2.getListResponse> Get()
{
AdarzaService2.Passport passport = new Passport();
AdarzaService2.TokenPassport tokenPassport = new TokenPassport();
AdarzaService2.ApplicationInfo applicationInfo = new ApplicationInfo();
AdarzaService2.PartnerInfo partnerInfo = new PartnerInfo();
AdarzaService2.Preferences preferences = new Preferences();
AdarzaService2.BaseRef[] baseRef = new BaseRef[1];
NetSuitePortTypeClient netSuitePortTypeClient = new NetSuitePortTypeClient();
passport.account = this.configuration["AccountId"];
passport.email = this.configuration["Email"];
passport.role = new RecordRef
{
name = this.configuration["Role"]
};
tokenPassport.account = this.configuration["AccountId"];
tokenPassport.consumerKey = this.configuration["ConsumerKey"];
tokenPassport.token = this.configuration["TokenId"];
applicationInfo.applicationId = this.configuration["ApplicationId"];
partnerInfo.partnerId = "";
//baseref[0].name = "";
var data = await netSuitePortTypeClient.getListAsync(passport,tokenPassport,applicationInfo,partnerInfo,preferences,baseRef);
return data;
}
谁能告诉我是什么原因引起的?
解决方法
我找到了这个问题的答案。该服务需要未指定的终结点目标。您可以在构造方法上设置端点。
NetSuitePortTypeClient netSuitePortTypeClient =新 NetSuitePortTypeClient(NetSuitePortTypeClient.EndpointConfiguration.NetSuitePort, “ http:// ..........”);