Solved

Silverlight - Domain Context Submit Changes  crashes my app

Posted on 2011-09-12
8
914 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
 
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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Windows Service to Receive TCP Packets 4 121
Achieve json result 2 65
SQL Exceptions 3 37
I need help converting a bitmap to an image in VB.Net 1 11
After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
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 I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

910 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now