Hi all,
If error occurs in the WcfService the SL client throws a NullReferenceException.
Following the WcfProxy code at line number 645 is the code below:
try {
Csla.WcfPortal. WcfResponse response = null;
if (e.Error == null)
response = ConvertResponse(e.Result); var globalContext = (ContextDictionary)MobileFormatter.Deserialize(response.GlobalContext); ----> if e.Error != null response is always null
so the NullReferenceException is raised.
May I use the work around below?
var globalContext = response == null ? ApplicationContext.GlobalContext : (ContextDictionary)MobileFormatter.Deserialize(response.GlobalContext); Best regards, Fabiano Rezende
This is a known bug that will be fixed in the next release.
Same problem for me, my service was misconfigured:
In case this help someone else until the fix is released, I personally updated (take care to update all Create/Fetch/Update/Delete):
if (e.Error == null)
response = ConvertResponse(e.Result);
var globalContext = (ContextDictionary)MobileFormatter.Deserialize(response.GlobalContext);
into:
ContextDictionary globalContext = null;
if (e.Error == null) {
response = ConvertResponse(e.Result);
globalContext = (ContextDictionary)MobileFormatter.Deserialize(response.GlobalContext);
}
Fix is in svn now
Copyright (c) Marimer LLC