Subject: Image as web service parameter
Posted By: rodmcleay Post Date: 12/12/2005 12:56:33 AM
Hi all,
When I add an image as the parameter to a web service I get the following error.
System.Drawing.Imaging.ImageFormat cannot be serialized because it does not have a parametless constructor.

How can I send an Image to the server as a web service parameter?

Any assistance would be greatly appreciated.
Rod


======================================
They say, best men are molded out of faults,
And, for the most, become much more the better
For being a little bad.
======================================
Reply By: Ankur_Verma Reply Date: 12/12/2005 10:50:50 AM
1) The class indeed doenst have a paramterless constructor- a default contructor.
2) The class is sealed i.e. not inheritable, which blocks a few possiblities that could be explored.
3) The class is not serializable, so I'm not sure if you can use it as a parameter in a webmethod, at all, i.e.
IF you are using it in a webmethod.


Regards
Ankur Verma
Reply By: Ankur_Verma Reply Date: 12/12/2005 11:06:24 AM
If you are doing a usual image file transfer, then it shouldnt be an issue.

Check This link
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwse/html/wsedime.asp


Regards
Ankur Verma
Reply By: rodmcleay Reply Date: 12/12/2005 9:17:43 PM
Thanks Ankur,
I will look into that.
I guess it is just an image file transfer, I am sending a signature panel image from a pocket pc to the server.
Many Thanks,
Rod

======================================
They say, best men are molded out of faults,
And, for the most, become much more the better
For being a little bad.
======================================
Reply By: rodmcleay Reply Date: 12/13/2005 1:04:57 AM
Hi again Ankur,
I have been looking into various area to get the job done without too much success.
Is it possible to programmatically send an MMS from Pocket PC Phone edition using C#?
I am still looking into the dime solution but I am finding it hard to transfer the information I find to the device environment at the moment, due to my lack of experience in this area.
Many thanks,
Rod

======================================
They say, best men are molded out of faults,
And, for the most, become much more the better
For being a little bad.
======================================
Reply By: rodmcleay Reply Date: 12/13/2005 5:11:42 AM
I think I have solved my problem.
I have converted the image into a byte array and used that as the parameter for hte web service.
I haven't completed the web service component to test, but its looking better.
Thanks for your assistance.
Rod

======================================
They say, best men are molded out of faults,
And, for the most, become much more the better
For being a little bad.
======================================

Go to topic 37551

Return to index page 418
Return to index page 417
Return to index page 416
Return to index page 415
Return to index page 414
Return to index page 413
Return to index page 412
Return to index page 411
Return to index page 410
Return to index page 409