cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

API Errors

nborrerojr.
12-Amethyst

API Errors

We have Integrity 10.9 and I am using the managed API with C# to create a custom client app targeting API 4.16. I am using multiple connections to download project data from the server to the client app. Previously I was using a single connection but it takes too long to download large projects. Now that I have multiple connections going, I am running into a few issues.

 

I have the API output to a log using:

    APIFactory.MKSInitialize(logFileName, LogType.Error, LogPriority.High);

 

I don’t know if this happened with a single connection because I wasn’t using the log feature before, but now, in the log I am seeing this error around 100 times:

                Mon May 01 12:05:18 2017 (..\mksValueImpl.c:228):<ERROR> Insufficient buffer size.

And this error about 5 – 10 times:

Mon May 01 12:05:19 2017 (..\mksValueImpl.c:181):<ERROR> Insufficient buffer size.

 

This doesn’t seem to directly correlate to the main problem I’m having which is that Visual Studio breaks at:

      IResponse r = cr.Execute(cmd);

It doesn’t give me any more information though. Also, I can just hit continue and it’ll keep going without throwing an exception. I don’t know if the data is successfully retrieved or not. Also, there doesn’t seem to be any consistency as to what type of item it’s retrieving when this happens. Here are screenshots from when it breaks:

err1.jpg err2.jpg

Since I am now using multiple connections, I think it may be possible that the way I’m initializing the connection is not quite right. For each object that connects to the server, this is call when it’s created:

 

if (!APIFactory.IsInitialized)

    APIFactory.MKSInitialize(logFileName, LogType.Debug, LogPriority.High);                   

ip = APIFactory.CreateIntegrationPoint(hostServer, hostPort, Secure, 4, 16);

s = ip.CreateSession(userName, userPassword);

 

I am using 4 API connections so that means that this code is called 4 times. Could this be causing a problem?

Is there a different way I should be initializing my connecting objects when using more than one connection at a time?

1 REPLY 1

I forgot to mention that it doesn't always break. Sometimes it will download all project data successfully without hitting a break point. The logs still show errors though.

Announcements


Top Tags