I am writing a tool to integrate with a web service, I have a meth开发者_JAVA百科od which just builds an ImportExportSoapClient object which is used to call the API methods for the web service, but when I call one of the methods I am getting Cannot access a disposed object System.ServiceModel.Channels.ServiceChannel? anyone had a similar experience or could lend a hand?
You may be trying to use an already-closed CommunicationObject
(like a ChannelFactory
). When the object is in a Closed
or Closing
state, you get an ObjectDisposedException
.
MSDN Reference: http://msdn.microsoft.com/en-us/library/ms405496.aspx
I had this problem too, and it was because my client was trying to re-use an old connection that was hanging around from the previous time the client was run. The problem went away when I re-tried a minute or so later,
精彩评论