469,293 Members | 1,319 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,293 developers. It's quick & easy.

Getting System.ObjectDisposedException from a web service call

Hello all,
Environment - Winforms app calling into a webservice

Exception returned - "A first chance exception of
type 'System.ObjectDisposedException' occurred in
system.dll"
Additional information: Cannot access a disposed object
named "System.Net.Sockets.NetworkStream".

We are making a webmethod call that gets back a simple ID
[integer].

The generated proxy -
-------------------
[System.Web.Services.Protocols.SoapDocumentMethodAt tribute
("http://tempuri.org/GenerateEntityID",
RequestNamespace="http://tempuri.org/",
ResponseNamespace="http://tempuri.org/",
Use=System.Web.Services.Description.SoapBindingUse .Literal,

ParameterStyle=System.Web.Services.Protocols.SoapP arameterS
tyle.Wrapped)]
public void GenerateEntityID(string IdentityType,
int IdentityCount, ref int IdentityValue) {
object[] results = this.Invoke
("GenerateEntityID", new object[] {
IdentityType,
IdentityCount,
IdentityValue});
IdentityValue = ((int)(results[0]));
}
Consumer Code -
-----------------

LHWebService.Registration registration = new
LHWebService.Registration();
registration.PreAuthenticate = true;
registration.Credentials =
CredentialCache.DefaultCredentials;
registration.GenerateEntityID
(tableName,number,ref entityID);

Would appreciate any help to solve this problem

Regards
Naveen
Nov 21 '05 #1
0 2418

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by OldMacDonald | last post: by
3 posts views Thread by Grant Schenck | last post: by
reply views Thread by *shame-faced* via DotNetMonster.com | last post: by
33 posts views Thread by JamesB | last post: by
2 posts views Thread by Bernard Borsu | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by harlem98 | last post: by
1 post views Thread by Geralt96 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.