Solved

Silverlight - Domain Context Submit Changes  crashes my app

Posted on 2011-09-12
8
911 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
Comment Utility
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
Comment Utility
Debugging the service would be the easiest part, but I guess it's not your service?!
0
 
LVL 1

Author Comment

by:JElster
Comment Utility
Hi..
I tried to uncheck the 'bypass'.. nothing happened
0
 
LVL 1

Author Comment

by:JElster
Comment Utility
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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 6

Expert Comment

by:jonaska
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and 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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

763 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

12 Experts available now in Live!

Get 1:1 Help Now