Problem with a service

I have an Xdata server application (roughly based on the web music sample) which has an Auth Server which actions an Interfaced service (that works nicely), an API server which just uses Aurelius (that works nicely) and a third server called ResServer. 


I have a service interface and implementation created with the wizard.

\whenever I call the service from the client app (FMX) using 

FClientRes.Service<IResourceSvc>.GetHeadShot(UserId);

The XData Server throws an Access Violation exception:

---------------------------
Error
---------------------------
XData server request error.
Status code: 500
Error Code: AccessViolation
Access violation at address 00000000005AA3CF in module 'VCL_Buzz_XServer.exe'. Read of address FFFFFFFFFFFFFFFF.
---------------------------

Any ideas what I am doing wrong?

Thanks
  

You should try to debug server-side and see what erro line and call stack appear when that AV happens. What is the implementation of GetHeadShot method. Probably something in that function is causing the AV.

Ok, I'll try but not having much luck - it doesn't get to the method.

But are you able to get the full call stack and line where the error happens? 

Is there a way to turn off the exception handling? I have MadExcept installed but the XData server swallows the exception and pushes it back to the client.


I have stepped through as best I can and it fails in System.Rtti on the Invoke call (obviously the issue is before this).

You should change your project options and enable "Use debug DCUs" option under Delphi Compiler | Compiler options.

You should also effectively debug the server instead of trusting MadExcept, this way you will see the real exception and the real call stack at the moment of the error.

The call from the app is XData.Server.Module:  line 975 


The actual exception is raised on line System.Rtti: 10110

Result := System.Rtti.Invoke(code, argList, CallingConvention, ReturnType.Handle)

Ok, I'm not sure what I did there. I added a simple function to the interface to return a string, which worked. and then the call fro the image worked. No time to investigate at the moment - so will probably never be, unless it happens again