Tuesday, 3 September 2013

How to debug WCF dataservice

How to debug WCF dataservice

I have a written dataservice for my windowsphone application and i'm
trying to savechanges to this dataservice. To do this i call
BeginSaveChanges:
Context.AddToMeasurements(temp);
Context.BeginSaveChanges(SaveChangesOptions.Batch,
SaveChangesComplete, Context);
The callback of this function returns an error when EndSaveChanges is called.
private void SaveChangesComplete(IAsyncResult result)
{
// use a dispatcher to make sure the async void
// returns on the right tread.
Deployment.Current.Dispatcher.BeginInvoke(() =>
{
DataServiceResponse WriteOperationResponse = null;
Context = result.AsyncState as MeasurementEntities;
try
{
WriteOperationResponse = Context.EndSaveChanges(result);
Debug.WriteLine("Batch State:");
Debug.WriteLine(WriteOperationResponse.BatchStatusCode);
}
catch (DataServiceRequestException ex)
{
Debug.WriteLine(ex.Message);
}
catch (InvalidOperationException ex)
{
Debug.WriteLine(ex.Message);
}
});
}
The Error the endsavechanges returns:
An exception of type
'System.Data.Services.Client.DataServiceClientException' occurred in
Microsoft.Data.Services.Client.WP80.DLL and wasn't handled before a
managed/native boundary
An exception of type
'System.Data.Services.Client.DataServiceRequestException' occurred in
Microsoft.Data.Services.Client.WP80.DLL and wasn't handled before a
managed/native boundary
A first chance exception of type
'System.Data.Services.Client.DataServiceRequestException' occurred in
Microsoft.Data.Services.Client.WP80.DLL
An exception of type
'System.Data.Services.Client.DataServiceRequestException' occurred in
Microsoft.Data.Services.Client.WP80.DLL and wasn't handled before a
managed/native boundary
An error occurred while processing this request.
I would like to see some more detailed information about these errors, or
if someone knows what they mean that also would be appreiciated, but how
can I accomplish (more details on the dataservice) within visual studio?
ps, i have allready added:
config.UseVerboseErrors = true;
and
[ServiceBehavior(IncludeExceptionDetailInFaults = true)]
to my dataservice.
please help :)

No comments:

Post a Comment