Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Silverlight - Domain Context Submit Changes  crashes my app

Posted on 2011-09-12
8
Medium Priority
?
926 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
  • 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
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
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 1000 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 1000 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

Learn Veeam advantages over legacy backup

Every day, more and more legacy backup customers switch to Veeam. Technologies designed for the client-server era cannot restore any IT service running in the hybrid cloud within seconds. Learn top Veeam advantages over legacy backup and get Veeam for the price of your renewal

Question has a verified solution.

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

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…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
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…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…

877 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