3

I am trying to consume the soap web services of netsuite in .net core 2.2. While trying to call a method provided in the reference.cs, the method throws error : : 'The remote server returned an unexpected response: (410) Gone.'

Here's what I have tried :

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;
        }

Can anyone tell me what is causing the issue?

Prasanna
  • 43
  • 8

1 Answers1

1

I found the answer to this issue. The service requires an endpoint target, that is not specified. You can set the endpoint on the constructor method.

NetSuitePortTypeClient netSuitePortTypeClient = new NetSuitePortTypeClient(NetSuitePortTypeClient.EndpointConfiguration.NetSuitePort, "http://..........");

Bruno Ferreira
  • 466
  • 7
  • 17
  • I could not find the end points of these services...I thought that these services had entities from which we can get the data...can u please tell me how did u find those end points? – Prasanna Sep 09 '20 at 09:55
  • This endpoints are provided by your netsuite service provider – Bruno Ferreira Sep 21 '20 at 13:53