Hi. I'm trying to solve a very strange problem. I have a windows forms
application that makes calls to a web service. When the web service method is
invoked, it is executed without exceptions on the web service side. When this
method returns, the application exits without exceptions. It simply closes
with error 0 (success).
Other methods of the webservice are called before this problematic method
without problems.
Another strange behaviour: if I am debugging the application, it ends on the
initialization when I call the problematic webservice method. But if I run
the executable itself (without debugging), the application starts (the
problematic method works) but it fails on another webservice method invoked
on a button click.
The windows forms application looks like this:
public void Main()
{
try
{
webService.NormalMethod1();
webService.NormalMethod2();
webService.ProblematicMethod1(); //returns a DataSet with one table
and one row
}
catch(Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
private void button_Click(object sender, EventArgs e)
{
try
{
webService.NormalMethod3();
webService.ProblematicMethod2(); //returns a string
}
catch(Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
As I said, if I am debugging, after the webService.ProblematicMethod1()
method is called the application ends. If I run the executable itself
webService.ProblematicMethod1() works and when the button is clicked,
webService.ProblematicMethod2() makes the application terminate. In both
cases, the catch block is never reached (the MessageBox is never shown). I've
created a event handler for the Application.ThreadException event but it is
never invoked.
The windows application also communicates with mobile devices through
ActiveSync. The described problem only occurs when devices running Windows
Mobile 5.0 are connected. It works fine with older devices. In my point of
view, the PDA should not affect the windows application since what's involved
in this piece of code is only the web service.
I don't know what to do and I need to solve this problem as soon as
possible. Any suggestions will be greatly appreciated.
Thanks
|