I first setup a simple .net client that works talking to Relativity at 7099. I found that one of my queries was getting a message size limit was reached while trying to decompress the message: 5242880. So I went into the Admin tool and from the Network Settings and I change both the MaxDecompressedMessageSize and the MaxMessageSize to 52428800 from 5242880 and saved it. I verified that its was saved in the C:\ProgramData\RemObjects Software\Relativity\Relativity.config. I also Stopped and restarted the relativity server. When I ran it again I still get the same error message showing the old value of 5242880.
So now I was thinking that it just not taking that config file and loading some default so I opened a web browser and went to the relativity main page: http://localhost:7099 and it shows me the channel type Simple Http Channel (TLS protected). I then went into the admin tool and changed the channel type to superhttp at 8099 and saved it and refreshed the browser and it showed SuperHttp Channel (TLS protected). So I know that it is taking the changes. I also verified these changes in the Relativity.config as I did above.
I then pointed my web browser to a secure https://localhost:7098 and it worked showing the changes in default http info page. It also worked at https://localhost:8099 showing the changes in the default info page.
I also went back to my client right clicked and update the Table Definition Classes to superhttps://MYPCNAME:8099/bin and ran my client app but I still get the same error message and it shows the value of 5242880 which is the original default value not the 52428800. I also tried unchecking EnforceMessageSize and I unchecked UseCompression but I still get that error.
This is the query I an running. Pretty much the boilerplate that the tool generates except with a where and order by clause.
public void LoadFromServer(string lastname)
{
this.AddToLog(“Downloading data from the server.”);
this.remoteDataAdapter.CancelChanges();
IQueryable<myTable> clientsQuery = from c in this.remoteDataAdapter.GetTable <myTable>() where c.LastName.Contains (lastname) orderby c.LastName select c;
this.Context.myTable = clientsQuery.ToList();
this.AddToLog("Data has been downloaded from the server.");
}
I am running c# with DA Link, Relativity v10.0.0.1463 and the same version for DA and RO. .Net Runtime is v4.0.30319.42000.
Ah. It seems you forgot to do one more very important thing: to adjust client-side settings as well. . Assuming you are using the default client project template you need to open the DataModule component in designer and adjust properties of message and clientChannel components.
Error happened: An exception occurred on the server: Session could not be found.
And now if I change is back I still get this message of “Error happened: An exception occurred on the server: Session could not be found.”
I then created a new project with the defaults that goes to http://mypc:7099/bin and it just works. Now I make a backup of this test project.
I then change clientChannel in the DataModules.cs to https://mypc:7098/bin and it gives “Error Happened: The remote certificate is invalid according to the validation procedure.”
I then go back and change the clientChannel in the DataModules.cs to http://mypc:7099/bin and try what worked before and it now fails with the message of “Error happened: An exception occurred on the server: Session could not be found.” I even tried stopping and restarting Relativity and the same error. I then go back to the backup I just made and copy over the now broken one and run it and it just works.
This makes no sense to me as I am only changing the TargetUrl on the ClientChannel and once it is broken it no longer works unless I restore it. I tried to just delete the bin and obj folders on the project but that didn’t fix it. What else is being written to when you change that in the ide as it does not seem to be something with Relativity.
FYI: I am using the “Generate Cert” from the admin tool to do the TSL.
I also did the same test with only changing the message MaxMessageSize and the MaxDecompressionMessageSize and leaving the URL to just http://mypc:7099/bin and the same issue happens. What I mean is I copied the good project, run it and it gives data. I then change on the client the message Max values and then it gives the Session could not be found error. So the error has nothing to do with SSL/TSL or anything like that.
I have since put back the backup project and this time instead of using the visual studio ui to change the vales of MaxDecompressedMessageSize and the MaxMessageSize to 52428800 I opened DataModule.Designer.cs in a text editor and added those values. I then opened the project and it worked with no issues with the larger transfer size. It appears this is breaking in both Visual Studio 2017 & 2019 when the control writes out the DataModule.Designer.cs.
After I looked through what was written out I seen that it added a Login needed but that was what was not happening. I added a login to the code before I call the data service call and now the sample works using the visual studio ui and changing the property values. So whatever is the base (generic) template that is made from the project wizard will have this issue whenever someone generates a DA project and then runs the code to see it work but once they change any value they will be stuck trying to figure out why it was working before when I it just failing because a logon was now needed and not happening. They will just need to go to the clientChannel events and assign the ClientChannel_OnLoginNeeded. Hope this post helps anyone who runs into this.