如何解决410错误:在.net核心中使用netsuite的soap服务时消失了
我正在尝试使用.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:// ..........”);
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。