Send image to wcf service

Sebulba

New member
Joined
Aug 7, 2008
Messages
3
Programming Experience
5-10
Hi

I have a wcf-service on my webserver. It works like a photoblogg, so I can send some info and a picture that will update my webpage. It worked ok when I used a webservice. But after iI rewrote my service to wcf I have problem sending my image to the server. My client is a windows mobile 6 application.

i declare my serverice

VB.NET:
dim ws as wsBlogg.Blogg

then i declare a variable to send to the service

VB.NET:
dim dataRow as ws.tblBlogg

in there i have a field for the image declared as a image.

i have the image in a picturebox in my image so i can either send the info from the picture box or read the imagefile.

I have tried the following code with no luck:

VB.NET:
                Dim imgStream As MemoryStream = New MemoryStream
                pb1.Image.Save(imgStream, System.Drawing.Imaging.ImageFormat.Jpeg)
                tbl.Picture1.Bytes = imgStream.ToArray
                tbl.Picture1Name = txtPicture1.Text

I have also tried to read from the image file but i get same problem. I get a nullreferece error.

If i remove the .byte from tblPicture1 then it says that a 1dimensional array of bytes cannot be converted to binary.

Any one have a suggestion on what i should do?

Plz help
/Sebulba
 

Latest posts

Back
Top