ObjectDisposedException after uploading image via Dime

D

Doug Sherzan

After I upload an image to my webservice using a dime attachment I receive
ObjectDisposedException on any subsequent calls to any method on the web
service. I'm not disposing of any objects and I can download a dime
attatchment from the web service and still continue to call methods. The
exception is always thrown from the Reference.vb method. Any ideas would be
greatly Appreciated.

I'm using VS.Net 2003 (Framework 1.1) & WSE 1.0 SP1

Code:
strRet = MySvc.GetTestMsg() 'This method works fine

Dim m As New IO.MemoryStream

Me.PictureBox1.Image.Save(m, System.Drawing.Imaging.ImageFormat.Jpeg)

Dim dm As New Microsoft.Web.Services.Dime.DimeAttachment("image/jpg",
Microsoft.Web.Services.Dime.TypeFormatEnum.MediaType, m)

Me.MySvc.RequestSoapContext.Attachments.Add(dm)

Me.MySvc.UploadImage() 'This method works fine

strRet = MySvc.GetTestMsg() 'The method throws a ObjectDisposedException
exception
 
D

Doug

Found the problem:

I needed to call Me.MySvc.RequestSoapContext.Attachments.clear() before
accessing the web service again.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top