[Last Call] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 452
  • Last Modified:

C# - Calling Web Service Invoke

Hey guys,

I have an issue that is going on that is driving me pretty much to insanity :).  I have a windows forms based application that stays up running and each night at a certain form timer event it kicks off some processing then after the processing is done I call an async web method that does processing of course.    Almost 50% of the time the web service method ends up stopping and not completing all it's processing.  However, if I manually click the invoke button on the asmx page, it never stops or fails.   I changed all the timeouts to like 'infinite' I tried both sync and async etc. to no avail and I end up babysitting this app every night seeing if it ran.  

My next try was going to be to take the web service method call out of the windows forms application, place it into a console application and scheduling it.  I am trying to mimic exactly what I do when I invoke it manually which really should be what I am doing when calling the method.  Any suggestions or ideas why this would be happening?   It seems like because windows forms is maybe not a certain apartment mode like single or MTA I think it's called may be why this is happening.
1 Solution
Shahan AyyubSenior Software Engineer - iOSCommented:
Can you please check in your code that you have no break points and then update web reference in your windows application.

Also try to write some test messages in a file during the process, so that you may have a track where it takes time.
Are there any timeout error or any other errors when it is called from timer ?

Since it is working from button there shouldn't be any problem in web service. can we see your timer code calling web service ?

Was there any diff. in creating proxies when you call from a button and timer ?

Featured Post


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now