Click here to Skip to main content
15,887,952 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to set alignments of form controls dynamically. Pin
priyamtheone29-Sep-10 3:26
priyamtheone29-Sep-10 3:26 
Questioncustom control problem in design time Pin
reza assar24-Sep-10 23:27
reza assar24-Sep-10 23:27 
AnswerRe: custom control problem in design time Pin
reza assar25-Sep-10 2:24
reza assar25-Sep-10 2:24 
AnswerRe: custom control problem in design time Pin
Gonzalo Cao26-Sep-10 22:36
Gonzalo Cao26-Sep-10 22:36 
GeneralRe: custom control problem in design time Pin
reza assar28-Sep-10 22:59
reza assar28-Sep-10 22:59 
QuestionLinkedIn using C# Pin
Jassim Rahma24-Sep-10 13:31
Jassim Rahma24-Sep-10 13:31 
AnswerRe: LinkedIn using C# Pin
Mycroft Holmes24-Sep-10 15:35
professionalMycroft Holmes24-Sep-10 15:35 
QuestionWebService not returning Color Pin
Luc Pattyn24-Sep-10 10:26
sitebuilderLuc Pattyn24-Sep-10 10:26 
Hi,

I'm experimenting with a Web Service, using .NET 2.0 and IIS7. This is the entire Web Service source (demo1.asmx):
<%@ WebService Language="C#" Class="Demo1ns.Demo1class" %>

using System;
using System.Web.Services;

namespace Demo1ns {

	[WebService (Name="Demo1", Description="Test color result")]
	public class Demo1class {
		
		[WebMethod (Description="Get a size")]
		public System.Drawing.Size GetSize() {
			return new System.Drawing.Size(12,34);
		}
		
		[WebMethod (Description="Get a color")]
		public System.Drawing.Color GetColor() {
			return System.Drawing.Color.Yellow;
                        //return System.Drawing.Color.FromArgb(0,1,2);
		}
	}
}


Browsing to http://localhost/services/Demo1.asmx I get the web page presenting both methods. Invoking the first works fine as it returns:
<Size>
  <Width>12</Width>
  <Height>34</Height>
</Size>


However the GetColor method (both variants) fails and simply returns:
<Color/>


whatever I try, a Color is never returned.
So why is it handling Size and not Color, both are pretty much similar structs. How does one fix this?

Smile | :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.


AnswerRe: WebService not returning Color Pin
PIEBALDconsult24-Sep-10 12:19
mvePIEBALDconsult24-Sep-10 12:19 
GeneralRe: WebService not returning Color [modified] Pin
Luc Pattyn24-Sep-10 12:32
sitebuilderLuc Pattyn24-Sep-10 12:32 
GeneralRe: WebService not returning Color Pin
PIEBALDconsult24-Sep-10 13:28
mvePIEBALDconsult24-Sep-10 13:28 
GeneralRe: WebService not returning Color Pin
Luc Pattyn24-Sep-10 14:27
sitebuilderLuc Pattyn24-Sep-10 14:27 
GeneralRe: WebService not returning Color Pin
PIEBALDconsult24-Sep-10 22:07
mvePIEBALDconsult24-Sep-10 22:07 
GeneralRe: WebService not returning Color Pin
Luc Pattyn25-Sep-10 4:55
sitebuilderLuc Pattyn25-Sep-10 4:55 
GeneralRe: WebService not returning Color Pin
Keith Barrow25-Sep-10 1:34
professionalKeith Barrow25-Sep-10 1:34 
GeneralRe: WebService not returning Color [modified] Pin
PIEBALDconsult25-Sep-10 4:19
mvePIEBALDconsult25-Sep-10 4:19 
GeneralRe: WebService not returning Color Pin
Luc Pattyn25-Sep-10 4:49
sitebuilderLuc Pattyn25-Sep-10 4:49 
GeneralRe: WebService not returning Color Pin
PIEBALDconsult25-Sep-10 6:58
mvePIEBALDconsult25-Sep-10 6:58 
GeneralRe: WebService not returning Color Pin
Luc Pattyn25-Sep-10 7:39
sitebuilderLuc Pattyn25-Sep-10 7:39 
GeneralRe: WebService not returning Color Pin
PIEBALDconsult25-Sep-10 9:18
mvePIEBALDconsult25-Sep-10 9:18 
GeneralRe: WebService not returning Color Pin
Luc Pattyn25-Sep-10 9:34
sitebuilderLuc Pattyn25-Sep-10 9:34 
GeneralRe: WebService not returning Color Pin
PIEBALDconsult25-Sep-10 9:52
mvePIEBALDconsult25-Sep-10 9:52 
GeneralRe: WebService not returning Color Pin
Luc Pattyn25-Sep-10 9:54
sitebuilderLuc Pattyn25-Sep-10 9:54 
GeneralRe: WebService not returning Color Pin
PIEBALDconsult25-Sep-10 12:46
mvePIEBALDconsult25-Sep-10 12:46 
GeneralRe: WebService not returning Color Pin
Luc Pattyn25-Sep-10 13:03
sitebuilderLuc Pattyn25-Sep-10 13:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.