Solved

Silverlight - Domain Context Submit Changes  crashes my app

Posted on 2011-09-12
8
919 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
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 
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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

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:…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
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…

735 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