Swift Client - Intf errors

Mark,

there attached testcase works ok for me — .NET Server, Swift client done in both Elements and Xcode. Can you compare this to your server, and try if yo can “make it fail”?

Testcase15665.zip (2.0 MB)

Great, that was just what I needed.

My client code was (too) simply:

	let request = service.dataProviderService.beginLogin("serial", "1", "1")
	let result = service.dataProviderService.endLogin(request, &userId, &errorMessage)

I was expecting beginLogin or endLogin to block until request returned. Looking at your example, this is clearly not the case.

Here’s your code (for the benefit of others reading this topic):

	ServerAccess.sharedInstance.dataProviderService.beginLogin("serial", "1", "1")
	{
		request in
		//
		var userID: Int32 = 0
		var Error: String!
		let result = ServerAccess.sharedInstance.dataProviderService.endLogin(request, &userID, &Error)
		//
		print("result \(result)")
		print("userID \(userID)")
		print("error \(Error)")
	}

Please forgive my lack of Swift experience, and thanks for your help. I will continue to test to ensure that all is well calling the other service methods.

Regards,
Mark

ah! that explains it! maybe we need an extra check in end* to make sure the call is finished.

the idea is that you use the regular methods (login) if you need to do “old stye” sync/blocking calls, and the async pairs (beginLogin/endLogin) if you want to run async. You can either use the callback, as in my example, or use the ROAsyncRequest returned from begib* to wait/check for completion,

Fixed, in the next build, this will give a cleaner exception, when end* is being called and the request is not finished yet.

1 Like