Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

410 Error : Gone while consuming soap services of netsuite in .net core

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?

like image 621
Prasanna Avatar asked Oct 15 '25 15:10

Prasanna


1 Answers

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://..........");

like image 194
Bruno Ferreira Avatar answered Oct 17 '25 20:10

Bruno Ferreira