500 Internal Server Error

3 REPLIES
Contributing Partner Buda56
7 Posts
Contributing Partner
Buda56
Contributing Partner

7Posts

0Kudos

2Solutions

Accepted Solution Solved Solution

Re: 500 Internal Server Error

Hi,

    This is now resolved and I can now return a list of employees, the correction of the PublicServer URI resolved the issue.

 

It would also apppear that the employee query qutomatically delimits the number of records returned to 400, I had to apply a filter to get it to return all the records in one hit.

 

Regards.

Peter

Contributing Partner Buda56
7 Posts
Contributing Partner
Buda56
Contributing Partner

7Posts

0Kudos

2Solutions

Re: 500 Internal Server Error

Ok further evewn more to this, I have managed to resolve the issue with the URL. It required modification of the config file (MYOB.AccountRight.API.Windows.ServiceHost.exe.config) on the Server hosting the Company File.

 

Had to modify the "PublicAddressServer" value (changed from LocalHost to the ServerName, I also then stopped and restarted the "MYOBAPIService" service.

 

I can now happily browse the file from my Workstations browser and it shows the correct URI links for Drill Down, although all this has been done I still cannot return a list of employees either by Browsing or through code. If I use a sample file it works correclty via browsing or through code. Comming to the conclusion that there is an issue with the MYOB Company file (We had issues when we first converted it to 2017, we had to send it to MYOB for them to repair then upgrade it).

 

Any help information would be gratly appreciated.

Regards.

Peter

Contributing Partner Buda56
7 Posts
Contributing Partner
Buda56
Contributing Partner

7Posts

0Kudos

2Solutions

Re: 500 Internal Server Error

Ok more to this..

 

I am specifying the APIConfig as "http://Fileserver:8080/accountright"

 

This is returning a list of Files that I can connect to, on further investigation I notice that the URI on the file is pointing to localhost ("http://localhost:8080/AccountRight/834c3fbd-eccf-4ccc-97f5-73e3c3990f0f").

 I can only make the assumption it is trying to connect to my local pc (localhost) and not the server that is hosting the company file?

How do I change the URI for the company file?

Any help would be greatly appreciated.

 

Regards.

Peter

 

Contributing Partner Buda56
7 Posts
Contributing Partner
Buda56
Contributing Partner

7Posts

0Kudos

2Solutions

Solved: Go to Solution

500 Internal Server Error

Hi,

    I am getting the above error when trying to return a list of employees from MYOB, I am using Desktop Services and connecting to a file on our Network.

 

It all seems to work okay until I try to pull a list of employees. I have added my code below.

 

using MYOB.AccountRight.SDK;
using MYOB.AccountRight.SDK.Services;
using MYOB.AccountRight.SDK.Contracts;
using MYOB.AccountRight.SDK.Services.Contact;

 

        private void btnImportMYOB_Click(object sender, EventArgs e)
        {
            var config = new ApiConfiguration("http://Fileserver:8080/accountright");
            var cfService = new CompanyFileService(config);
            var companyFiles = cfService.GetRange();
            var companyFile = companyFiles.FirstOrDefault(x => new Version(x.ProductVersion) == new Version("2017.1"));
            var credentials = new CompanyFileCredentials("Administrator", "");
            var employeeService = new EmployeeService(config);
            var employees = employeeService.GetRange(companyFile, null, credentials); //<-- Fails here with the 500 Error.
        }

 

Hope someone can point me in the right direction.

 

Thanks

Peter

 

Didn't find your answer here?
Try using advanced search to find a post more easily Advanced Search
or
Get the conversation started and make a new post Start a Post