Solved

Silverlight - Domain Context Submit Changes  crashes my app

Posted on 2011-09-12
8
923 Views
Last Modified: 2013-11-12
Hi..
I have a SL app using a domain context.. All my submit changes work great, except for one.
It does not throw an error and I can't catch any errors. I'm running on a local machine.

How can I find out the error.. or trap it.
I can't seem to get filddler to work on a local url
any ideas?
0
Comment
Question by:JElster
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
8 Comments
 
LVL 6

Expert Comment

by:jonaska
ID: 36527562
As you may already know fiddler works as a proxy server.
By default the most of your applicatins is using the default proxy settings which is configured under internet options. When you start fiddler it configures it for you.

As you state you're trying to call a local service and thats by default bypassing the proxy settings.

You can try to uncheck the "bypass proxy server for local addresses"
Under Internet options -> Connections -> LAN settings
0
 
LVL 6

Expert Comment

by:jonaska
ID: 36527565
Debugging the service would be the easiest part, but I guess it's not your service?!
0
 
LVL 1

Author Comment

by:JElster
ID: 36533059
Hi..
I tried to uncheck the 'bypass'.. nothing happened
0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
LVL 1

Author Comment

by:JElster
ID: 36533224
Also tried the machine name and port .. got a fiddler error.
It's using the Cassini web server...
Fiddler can't listen because it's used by the server
0
 
LVL 6

Expert Comment

by:jonaska
ID: 36534288
If you tries to access the wcf service from the webbrowser? Does that pass fiddler?
0
 
LVL 7

Accepted Solution

by:
vbigham earned 250 total points
ID: 36537869
It sounds like it is throwing an error, but maybe not where you would think.  Since all the operations are Async it won't throw the error until it round trips from the server.  If you want to check a submit operation for errors you'll need to add an event handler to the SubmitOperation's Completed event, or provide a callback for the SubmitChanges method.  You can then check if submitOp.HasError, and use submitOp.MarkErrorAsHandled() to stop the exception from crashing your app.  The exception object will be available in the submitOp.Error property.

For examples check the documentation at:
http://msdn.microsoft.com/en-us/library/ff422360(v=VS.91).aspx
0
 
LVL 1

Author Comment

by:JElster
ID: 36537940
Hi..
I do have an event onSubComplete... but it never hits it

     // Save
                    this.DS.SubmitChanges(OnSubmitCompleted_SendTag_Final, null);



   void OnSubmitCompleted_SendTag_Final(SubmitOperation so)
        {
            if (so.HasError)
            {
                MessageBox.Show(so.Error.InnerException.ToString(),"Save Error " + so.Error.Message , MessageBoxButton.OK);

                SendError("Sent Tag Save Data Error : " + so.Error.Message + " - " + so.Error.InnerException + " - " + so.Error.StackTrace);

            }

   
0
 
LVL 6

Assisted Solution

by:jonaska
jonaska earned 250 total points
ID: 36541156
The above code doesn't look like a usual wcf call. Could it be that the method SubmitChanges expects a handler for errors as the second parameter?

I usually do something like this:
public void GetData(Action<Data> onSuccess, Action<Exception> onError, int dataId){
    // Client    
    ServiceClient client = ServiceClientFactory.CreateClient(_appSettings);    
    // Eventhandler for getdata    
    client.GetDataCompleted += (s, args) =>    
    {       
        if (args.Error != null)            
            onError(args.Error);        
        else            
            onSuccess(args.Result);        
        client.CloseAsync();    
    };    
    // Make call for GetData    
    client.GetDataAsync(dataId);    
}

Open in new window

0

Featured Post

Quiz: What Do These Organizations Have In Common?

Hint: Their teams ended up taking quizzes, too.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

632 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question