Examples on how to use Fire with C# Oxygen to iOS to a Relativity server

Hello

Are there any examples on how to use Fire with rem C# Oxygen to iOS to a simple Relativity server? In .net it generates the data module and I just add to that. Is there a sample of remobject DataModule on remobject c# that I can load with Fire? I tried to use my .net output in the Fire IDE with rem C# but it comes back with so many unknown name spaces and trying to match them up from one platform the another is not straight forward. I found the PCTrade xcode sample but that is the language that I am avoiding.

Thanks any help/direction you can provide,

Howie

The best starting point is to use the “Tools|Remoting SDK & Data Abstract|Connect to Relativity Server” menu to connect your existing app to your server. This will add the necessary DA referenes and generate some helper code to get you connected.

i hope this sample will help you get started, as well.

Yes, that won’t work. the Data Abstract API is tailored for each platform, and thus is significantly different on Cocoa than it is in .NET (not in DA concepts, but in what classes and methods are called and how they are designed). The .NET code won’t just easily run or be adjusted for Cocoa. (See some of my replies in this thread for why that is, right now).

Thank you Marc, I will give this a try. When I downloaded the ios dataabastracts and it is an image. I open the image but I dont see and installer. Is thgere an installer I should be running? I then copied it to the desktop and ran the admin server and schema modeler and they work :). The examples are in xcode and need to referenced. Is there and article or thread on how to reference the new da (header not found) just so I can see the code and then I can try to convert it to work with my project?

Thanks,

Howie

Hello marc,

Your sample is just what i was looking however it keeps erroring with CrossBox error ProcessXibs: Execution of “ibtool” failed with error code 1 and never deploys to the simulator.

It also had another error which said the return was not integer but use NSInteger. I changed that and it satisfied the error but the Crossbox error does not make sense as I can just go file new and create a new project and that project deploys to the ios simulator without error so the Crossbox must be working. How do you troubleshoot when the error doesn’t point to code with the Fire IDE? Is this an xcode issue and I have to change some of my setting in xcode?

Thanks,

Howie

Yeah, i noticed that too. the sample is a bit old, and it turns out Xcode dropped support for storyboards marked as supporting iOS 6 or older. I’ll fix the sample before we publish its but ia some thats not a showstopper for you getting started, right?

i can end you a newer version of the sample tomorrow, when it’s done. In the mean time, just do “Edit in Xcode” on the Main.storyboard, and in the pane on the right change the “Builds for” setting from “unknown iOS version” to a valid version, to fix the Xcode error.

yeah, that too is caused by newer SDKs getting more stricter there.

Thank you marc, I went into xcode and changed all of the forms to ios 10 or later and that fixed that error now it builds and deployed to the simulator. Yea I got something on an iPhone!

I think I found a bug in the Fire IDE. When adding a relativity client you should add a strong type and then the dataclass which is what I originally was looking for to get myself going. What I found is when you try to generate the strong data type it just hangs on “getting schema” and if you right click and generate dataclass it does nothing. It does not prompt or make anything from within fire.

After I got the sample to deploy it fails on the login.

Below is the error list from Fire. I changed the sample data of PCTrade relativity to be a static login with user “Test” and password of “Test” so it matched your sample. I also changed the url to point to my relativity server. Here is the output of the error. Can you tell from this what might be failing? Is it because it is a trail of the cocoa ? It does say I have 28 days left. I am a .net suite user and I was going to upgrade to all platforms so I could do this ios projects. I just wanted to make sure i could get the basics of logging in a user and getting the data and then updating it. My data will work the same way as the sample as I already do in m existing .net project however that is in vb.

~> Process DASampleApp started.
2017-10-14 17:01:10.070895-0500 DASampleApp[19203:543541]
2017-10-14 17:01:10.071089-0500 DASampleApp[19203:543541] ################################################################################
2017-10-14 17:01:10.071184-0500 DASampleApp[19203:543541] ################################################################################
2017-10-14 17:01:10.071285-0500 DASampleApp[19203:543541] ################################################################################
2017-10-14 17:01:10.071375-0500 DASampleApp[19203:543541] ########## ##########
2017-10-14 17:01:10.071504-0500 DASampleApp[19203:543541] ########## This application was built with a TRIAL version of ##########
2017-10-14 17:01:10.071593-0500 DASampleApp[19203:543541] ########## RemObjects SDK for Cocoa or Data Abstract for Cocoa. ##########
2017-10-14 17:01:10.071673-0500 DASampleApp[19203:543541] ########## ##########
2017-10-14 17:01:10.071768-0500 DASampleApp[19203:543541] ########## The TRIAL version may be used for evaluation purposes ##########
2017-10-14 17:01:10.071897-0500 DASampleApp[19203:543541] ########## only, and applications created with it may not be ##########
2017-10-14 17:01:10.071955-0500 DASampleApp[19203:543541] ########## deployed, distributed or sold. ##########
2017-10-14 17:01:10.072028-0500 DASampleApp[19203:543541] ########## ##########
2017-10-14 17:01:10.072189-0500 DASampleApp[19203:543541] ########## For more information, visit http://remobjects.com ##########
2017-10-14 17:01:10.072384-0500 DASampleApp[19203:543541] ########## ##########
2017-10-14 17:01:10.072584-0500 DASampleApp[19203:543541] ################################################################################
2017-10-14 17:01:10.072760-0500 DASampleApp[19203:543541] ################################################################################
2017-10-14 17:01:10.072960-0500 DASampleApp[19203:543541] ################################################################################
2017-10-14 17:01:10.073169-0500 DASampleApp[19203:543541]
2017-10-14 17:01:10.282696-0500 DASampleApp[19203:543541] SecTaskLoadEntitlements failed error=22 cs_flags=200, pid=19203
2017-10-14 17:01:10.282911-0500 DASampleApp[19203:543541] SecTaskCopyDebugDescription: DASampleApp[19203]/0#-1 LF=0
2017-10-14 17:01:10.606587-0500 DASampleApp[19203:543839] SecTaskLoadEntitlements failed error=22 cs_flags=200, pid=19203
2017-10-14 17:01:10.606829-0500 DASampleApp[19203:543839] SecTaskCopyDebugDescription: DASampleApp[19203]/0#-1 LF=0
!> Exception of type ROException on thread 4C5F
!> Message: An exception occurred on the server: BinMessage: Unexpected end of stream.
!> Exception of type ROException on thread 4C5F
!> Message: An exception occurred on the server: BinMessage: Unexpected end of stream.
!> (
!> 0 CoreFoundation 0x00000001111621cb __exceptionPreprocess + 171
!> 1 libobjc.A.dylib 0x000000010dc2ef41 objc_exception_throw + 48
!> 2 DASampleApp 0x000000010da23475 -[ROMessage readFromNSData:] + 0
!> 3 DASampleApp 0x000000010da1373e -[ROHTTPClientChannel intDispatch:responseMessage:] + 196
!> 4 DASampleApp 0x000000010da0fb5d -[ROClientChannel dispatch:] + 400
!> 5 DASampleApp 0x000000010da63a73 -[SimpleLoginService_Proxy Login:::] + 344
!> 6 DASampleApp 0x000000010da46cc1 -[DARemoteDataAdapter loginWithUsername:password:] + 114
!> 7 DASampleApp 0x000000010d9f7c0f -[__DASampleApp_DataAccess remoteDataAdapterNeedsLogin:] + 79
!> 8 DASampleApp 0x000000010da10094 __73-[ROClientChannel internalPerformAsynchronousLoginNeededForAsyncRequest:]_block_invoke_2 + 208
!> 9 libdispatch.dylib 0x000000011198a273 _dispatch_call_block_and_release + 12
!> 10 libdispatch.dylib 0x000000011198b2b5 _dispatch_client_callout + 8
!> 11 libdispatch.dylib 0x000000011198ff2e _dispatch_queue_override_invoke + 887
!> 12 libdispatch.dylib 0x0000000111995a72 _dispatch_root_queue_drain + 568
!> 13 libdispatch.dylib 0x00000001119957dc _dispatch_worker_thread3 + 119
!> 14 libsystem_pthread.dylib 0x0000000111f175a2 _pthread_wqthread + 1299
!> 15 libsystem_pthread.dylib 0x0000000111f1707d start_wqthread + 13
!> )
!> Exception of type ROException on thread 4B35
!> Message: An exception occurred on the server: BinMessage: Unexpected end of stream.
!> (
!> 0 CoreFoundation 0x00000001111621cb __exceptionPreprocess + 171
!> 1 libobjc.A.dylib 0x000000010dc2ef41 objc_exception_throw + 48
!> 2 DASampleApp 0x000000010da23475 -[ROMessage readFromNSData:] + 0
!> 3 DASampleApp 0x000000010da1373e -[ROHTTPClientChannel intDispatch:responseMessage:] + 196
!> 4 DASampleApp 0x000000010da0fb5d -[ROClientChannel dispatch:] + 400
!> 5 DASampleApp 0x000000010da63a73 -[SimpleLoginService_Proxy Login:::] + 344
!> 6 DASampleApp 0x000000010da46cc1 -[DARemoteDataAdapter loginWithUsername:password:] + 114
!> 7 DASampleApp 0x000000010d9f7c0f -[__DASampleApp_DataAccess remoteDataAdapterNeedsLogin:] + 79
!> 8 DASampleApp 0x000000010da10094 __73-[ROClientChannel internalPerformAsynchronousLoginNeededForAsyncRequest:]_block_invoke_2 + 208
!> 9 libdispatch.dylib 0x000000011198a273 _dispatch_call_block_and_release + 12
!> 10 libdispatch.dylib 0x000000011198b2b5 _dispatch_client_callout + 8
!> 11 libdispatch.dylib 0x000000011198ff2e _dispatch_queue_override_invoke + 887
!> 12 libdispatch.dylib 0x0000000111995a72 _dispatch_root_queue_drain + 568
!> 13 libdispatch.dylib 0x00000001119957dc _dispatch_worker_thread3 + 119
!> 14 libsystem_pthread.dylib 0x0000000111f175a2 _pthread_wqthread + 1299
!> 15 libsystem_pthread.dylib 0x0000000111f1707d start_wqthread + 13
!> )

i’ll have a look tomorrow. the trial part would be as designed, if you currently only have a .NET sub. the “Unexpected end of stream.“ sounds like a possible network issue; that should not happen. i’ll keep you posted.

will look at this two bugs later today, thank you.

Is that when changed to talk to your own server, or talking to our sample server? the latter works fine for me, it connects and downloads a list of clients, out of the box.

Note that if you talk to a Relativity server, you will need to adjust the login to also specify a Domain and (if there’s more than one) Schema, e.g.:

method DataAccess.remoteDataAdapterNeedsLogin(aAdapter: not nullable DARemoteDataAdapter): Boolean;
begin
  result := fRDA.loginWithString('Username=Test;Password=Test;Domain=Test'); 
end;

Yeah, still a bit clueless as to why these would happen; i’ll have to check/defer this to the core RO/DA team on Monday. [@antonk, any idea? Almost sounds like malformed packet or a mismatch between what client and server API think the login call should look like?]

That said, since this happens for the login call, it also explains why you get “login failed”. Lets see of this goes away once you switch to loginWithString…

1 Like

(1) confirmed, the “Unexpected End of Stream” happens when using the wring login method against Relativity Server. I suppose tis is somewhat as designed, as the Login() method is called the same. but simply expects a different different parameters, for Relativity.

loginWithString is the server-agnostic way to go, and will work with both kinds of servers. I’ll adjust the example accordingly. I’ve also conformed that the sample works fine with Relativity Server when using the right login:

		private DataAccess() : base()
		{
			rda = new DARemoteDataAdapter withTargetURL(new NSURL withString("http://sample.remobjects.com:7099/bin"));  // changed the URL to our sample Relativity Server
			rda.@delegate = this;
			rda.username = "Test";
		}

		bool remoteDataAdapterNeedsLogin(DARemoteDataAdapter adapter)
		{
			//return rda.loginWithString("Username=Test;Password=Test");
			return rda.loginWithString("Username=Data;Password=Relativity;Domain=PCTrade Sample"); // changed the login string to include the right data
		}

(2) confirmed and fixed both of the Fire IDE issues (“Generate Data Access Class” not doing anything, and “Generate Strongly Typed Data Table Classes” hanging while retrieving the schema list). Unfortunately i ran into a different problem with the latter that will need more work/thought and possibly involvement from the RO/DA team to fix, over the next week — else i’d be sending you a new Fire build right now :(.

As a workaround, you should be able to simply open your Fire project in VS, rigger the generation of the strongly typed classes there, and then go back to Fire.

Update: fully fixed, i’ll upload a new Fire build to your Personal Downloads folder.

hth,
marc

DataAdapter calls a method that is defined as

Relativity Server exposes a similary named method with a completely different signature:

So Binary format exception here is completely expected. We need to discuss switching to the LoginEx method instead in the DARemoteDataAdapter class (with optional fallback ofc) because this method has the same signature across any DA-powered servers.

Thank you marc, I got my first simulator iphone app working! The loginWithString did the trick, I just needed to add ;Schema=PCTrade to the end of your sample and then I was able to connect and get data back. The other issue with the sample was simple, the LIKE %A’ did not bring back data so I switched it to 'A% and that worked. I also just removed the LIKE filter and it brought back all of the records. Now I can get started figuring out this new IDE Fire and DA SQL. Your sample had both SQL and parameter based SQL which will do most everything that I really need for my app.

Thank you for the workaround tip and all for your help, I will try that. I am excited to learn all of the this new stuff.

Howie

Cool!

i’ve also uploaded a new Fire build for you now, to Login | Portal | RemObjects Software. This should fix both of the IDE issues you reported.

I loaded the new build of Fire and it now generates strong table types and the very important DataClass! The template that generates Strong table (just using PCTrade) types marks all of the fields as public and that causes a compiler error E130 Type Expected and E375 One of This, identifier. Operator expected, got public. Based on that error I removed the public from all of the fields and that made the compiler happy.

I then tried your suggestion and did it from my pc in VS2017 and found the connect to data abstract from tools > remoting sdk > connect to data abstract does not start anything. It does for remoting sdk. I then made a new VS2015 and the connect to Data abstract does work in this interface. It also shows the same error as in Fire. Is the template correct or is it broken and I just need to delete all of the public declarations? I think deleting will solve the compiler but I will need the public field interface to use the dataclass! I do like the fact that I can take projects from the mac fire and just load them into VS on the pc. This is nice to go to VS for familiarity but I like the faster compile if I can just stay on on the Mac side.

Thanks,

Howie

sounds like a bug with the codegen; interface methods should not get a visibility (yet). i’ll have a look in the morning.

Reproduced and fixed, thanx.

I’ll log an issue for that for the RO/D team, as that’s out of my scope to fix. thanx for letting us know.

Yeah, that’s to be expected, both Fire and VS use the same code generator logic, so they’d generate the exact same (bad, in this case) code. My fix will cover both.

Just manually deleting the public is the right workaround, yes.

I do hope that in a very short time, you’ll come to think of Fire as the nicer place to work in, as well :wink:

Thanks, logged as bugs://78695

Coul you elaborate what exactly hppens here? You press the menu item and nothing happens at all, a window appears but it is white w/o any GUI elements or smth else?

Thanks in advance

Hello antonk,

The option is available in tools > Remote > Connect to DA. It was not greyed out or anything. When I click on that option nothing happens. I don’t see anything. If I click on the RODL option the wizard started for that option as normal. I then went to 2015 and did it from there and it worked as expected. The template it generates in 2015 also has an issue. In the reference it shows libDataAbstract not found and libDataAbstractSDK. They are .fx files. I generated a new Elements RemObject C# for Cocoa / iOS project using the PC Visual Studio 2015. I used the Master Detail Template. Once it Created I then added in the relativity as explained above. The generated project has the error so it can’t be put down to the ios simulator.

Howie

That sounds wrong, indeed. There is no such library (only libRemObjectsSDK), but you dont need that you have libDataAbstract, as that one is a superset). The template added that?

that one should be fund ok, assuming you have DA/Cocoa installed on your Windows machine.