Unable to connect to Online via CompanyFileService

This thread is now closed to new comments.
Some of the links and information provided in this thread may no longer be available or relevant.
If you have a question please start a new post.
AndrewBauer
Partner
2 Posts
Partner

2Posts

1Kudos

0Solutions

Solved: Go to Solution

Unable to connect to Online via CompanyFileService

My application that has been running for over a year has all of a sudden stopped working. When I debug it, it seems that the CompanyFileService either isn't creating a WebRequestFactory correctly, isn't able to connect via it or is prematurely closing the connection. Below is a screenshot of the error I am receiving:

 

2019-02-11 09_56_05-.png

 

The code I am using is from an example I found in MYOB community:

try
{
    ShowSpinner();

    if (UseCloud)
    {
        _configuration = new ApiConfiguration(DeveloperKey, DeveloperSecret, "http://desktop");
        _oAuthKeyService = new OAuthKeyService();

        //Get tokens if not stored
        if (_oAuthKeyService.OAuthResponse == null)
        {
            var oauthService = new OAuthService(_configuration);
            _oAuthKeyService.OAuthResponse =
                oauthService.GetTokens(OAuthLogin.GetAuthorizationCode(_configuration));
        }

        // Load all files from cloud and local simultaneously
        var cfsCloud = new CompanyFileService(_configuration, null, _oAuthKeyService);
        cfsCloud.GetRange(OnComplete, OnError);
    }
    else
    {
        _configuration = new ApiConfiguration(LocalApiUrl);
        var cfsLocal = new CompanyFileService(_configuration);
        cfsLocal.GetRange(OnComplete, OnError);
    }
}
catch (Exception ex)
{
    MessageBox.Show(ex.Message);
}

The error occurs on:

cfsCloud.GetRange(OnComplete, OnError);

 

3 REPLIES 3
Triboss
Valued Partner
99 Posts
Valued Partner
Valued Partner

99Posts

6Kudos

15Solutions

Accepted Solution Solved

Re: Unable to connect to Online via CompanyFileService

Make sure you have upated the SDK and/or using a "secure" connection method.

See here for details:

https://community.myob.com/t5/MYOB-API-questions-and-answers/TLS-Security-Changes-Issues-connecting-...

Jacob_S
15 Posts
Former Staff
New Zealand
Former Staff

15Posts

0Kudos

3Solutions

Re: Unable to connect to Online via CompanyFileService

Hi @AndrewBauer

 

Thanks for reaching out. Last week we made some security changes to our API meaning we will no longer accept connections using the TLS1.0 security protocol. As @Triboss has said, you will need to update the SDK and ensure your integration is using TLS1.1 or greater. 

 

Here is a link to our blog post which has more information on this - http://myobapi.tumblr.com/post/177017431449/tls10-no-longer-supported

 

Thanks,
Jacob
MYOB API Team

Are you a developer? Check out http://developer.myob.com
Looking for an Add-on? Check out http://myob.com/addons/
MYOB API Support Centre - https://apisupport.myob.com

AndrewBauer
Partner
2 Posts
Partner

2Posts

1Kudos

0Solutions

Re: Unable to connect to Online via CompanyFileService

Thanks @Triboss and @Jacob_S I will update the SDK and see how I go.

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