Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
| Search | Today's Posts | Mark Forums Read
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 12th, 2005, 01:56 AM
Friend of Wrox
Points: 2,376, Level: 20
Points: 2,376, Level: 20 Points: 2,376, Level: 20 Points: 2,376, Level: 20
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: , , Australia.
Posts: 596
Thanks: 1
Thanked 3 Times in 3 Posts
Default Image as web service parameter

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.
======================================
__________________
======================================
"They say, best men are molded out of faults,
And, for the most, become much more the better
For being a little bad."
--Shakespeare
======================================
 
Old December 12th, 2005, 11:50 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , .
Posts: 453
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via AIM to Ankur_Verma Send a message via MSN to Ankur_Verma
Default

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
 
Old December 12th, 2005, 12:06 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , .
Posts: 453
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via AIM to Ankur_Verma Send a message via MSN to Ankur_Verma
Default

If you are doing a usual image file transfer, then it shouldnt be an issue.

Check This link
http://msdn.microsoft.com/library/de...ml/wsedime.asp


Regards
Ankur Verma
 
Old December 12th, 2005, 10:17 PM
Friend of Wrox
Points: 2,376, Level: 20
Points: 2,376, Level: 20 Points: 2,376, Level: 20 Points: 2,376, Level: 20
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: , , Australia.
Posts: 596
Thanks: 1
Thanked 3 Times in 3 Posts
Default

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.
======================================
 
Old December 13th, 2005, 02:04 AM
Friend of Wrox
Points: 2,376, Level: 20
Points: 2,376, Level: 20 Points: 2,376, Level: 20 Points: 2,376, Level: 20
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: , , Australia.
Posts: 596
Thanks: 1
Thanked 3 Times in 3 Posts
Default

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.
======================================
 
Old December 13th, 2005, 06:11 AM
Friend of Wrox
Points: 2,376, Level: 20
Points: 2,376, Level: 20 Points: 2,376, Level: 20 Points: 2,376, Level: 20
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: , , Australia.
Posts: 596
Thanks: 1
Thanked 3 Times in 3 Posts
Default

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.
======================================




Similar Threads
Thread Thread Starter Forum Replies Last Post
Web Service Parameter - String vs SOAP attachment ndr1977 .NET Web Services 1 August 31st, 2009 02:02 AM
Web Service Consuming another web service CraigWhitfield EJB 0 January 10th, 2008 08:38 AM
Service Oriented Web Service aldwinenriquez .NET Web Services 2 September 15th, 2005 03:25 AM
web service parameter size androger .NET Web Services 2 November 19th, 2003 01:13 PM
Object as parameter in a web service method evandro.paula .NET Web Services 3 October 14th, 2003 02:20 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.