Click here to Skip to main content
15,903,632 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: masterpage design in menu Pin
Abhishek Sur30-Nov-09 1:25
professionalAbhishek Sur30-Nov-09 1:25 
AnswerRe: masterpage design in menu Pin
sashidhar30-Nov-09 5:01
sashidhar30-Nov-09 5:01 
QuestionHow to pass '&' in the querystring with value Pin
Niraj00129-Nov-09 23:58
Niraj00129-Nov-09 23:58 
AnswerRe: How to pass '&' in the querystring with value Pin
Anurag Gandhi30-Nov-09 0:12
professionalAnurag Gandhi30-Nov-09 0:12 
GeneralRe: How to pass '&' in the querystring with value Pin
Abhijit Jana30-Nov-09 0:17
professionalAbhijit Jana30-Nov-09 0:17 
GeneralRe: How to pass '&' in the querystring with value Pin
Anurag Gandhi30-Nov-09 0:27
professionalAnurag Gandhi30-Nov-09 0:27 
AnswerRe: How to pass '&' in the querystring with value Pin
Abhijit Jana30-Nov-09 0:14
professionalAbhijit Jana30-Nov-09 0:14 
Question.NET Webservice XML serialization Pin
Aftab Sindhi29-Nov-09 23:46
Aftab Sindhi29-Nov-09 23:46 
Hi everybody,
I've a web service which has following classes:
NOTE: Some code, i.e. local variables etc, is removed for brevity.

[Serializable]
public class ResponseCode
{
	public string ErrorCode
	{
		return _errorCode;
	}
	public string ErrorDescription
	{
		get { return _errDescription; }
	}
}


[Serializable]
public class BaseResponse
{
	public ResponseCode Result
	{
		get { return _respCode; }
		set { _respCode = value; }
	}
	
}



public class AuthenticationResponse : BaseResponse
{
	public int Credit
	{
		get { return _credit; }
		set { _credit = value; }
	}
	public int UserID
	{
		get { return _userID; }
		set { _userID = value; }
	}

}

Now there is the web method, which performs the authentication and returns the AuthenticationResponse object as following:


On successfull authentication:

User ID: xxxx where xxxx is number
Credit: xxxx where xxxx is number
ErrorCode: 0 (zero means no any error)
ErrorDescription: OK


On failure:

User ID: 0 (zero)
Credit: 0 (zero)
ErrorCode: xxxx (different number for different reasons)
ErrorDescription: xxxx (different text for different reasons)


If you'll see the classes above expected returned XML should be something as following:

<AuthenticationResponse>
  <Result>
	<ErrorCode>1020300</ErrorCode>
	<ErrorDescription>Invalid username or password</ErrorDescription>
  </Result
  <Credit>0</Credit>
  <UserID>0</UserID>
</AuthenticationResponse>


But the returning result is as following:

<AuthenticationResponse>
  <Result />
  <Credit>0</Credit>
  <UserID>0</UserID>
</AuthenticationResponse>


In short, Result property belongs to the base class BaseResponse which is type of an other class ResponseCode. Hence property of base class is not serialized to XML.
How I can include the base class's property serialized to achieve the desired result?
In start BaseResponse was abstract class. I removed abstract keyword but no luck. I've played a lot with XmlIncludeAttribute also but problem still exists
Any body can point me to right direction?
Thanks in advance

Regards

Aftab Sindhi
.NET Application Developer
U.A.E

AnswerRe: .NET Webservice XML serialization Pin
Aftab Sindhi2-Dec-09 18:32
Aftab Sindhi2-Dec-09 18:32 
QuestionHow to develop own News section in C# ASP.Net 2.0 ?? Pin
Navin Pandit29-Nov-09 21:25
Navin Pandit29-Nov-09 21:25 
AnswerRe: How to develop own News section in C# ASP.Net 2.0 ?? Pin
Ashfield29-Nov-09 21:31
Ashfield29-Nov-09 21:31 
GeneralRe: How to develop own News section in C# ASP.Net 2.0 ?? Pin
Navin Pandit29-Nov-09 23:10
Navin Pandit29-Nov-09 23:10 
AnswerRe: How to develop own News section in C# ASP.Net 2.0 ?? Pin
Abhishek Sur29-Nov-09 21:44
professionalAbhishek Sur29-Nov-09 21:44 
GeneralRe: How to develop own News section in C# ASP.Net 2.0 ?? Pin
John Bracey29-Nov-09 22:00
John Bracey29-Nov-09 22:00 
GeneralRe: How to develop own News section in C# ASP.Net 2.0 ?? Pin
Abhishek Sur29-Nov-09 22:41
professionalAbhishek Sur29-Nov-09 22:41 
GeneralRe: How to develop own News section in C# ASP.Net 2.0 ?? Pin
Navin Pandit29-Nov-09 23:11
Navin Pandit29-Nov-09 23:11 
GeneralRe: How to develop own News section in C# ASP.Net 2.0 ?? Pin
Abhishek Sur29-Nov-09 23:27
professionalAbhishek Sur29-Nov-09 23:27 
GeneralRe: How to develop own News section in C# ASP.Net 2.0 ?? Pin
Navin Pandit29-Nov-09 23:32
Navin Pandit29-Nov-09 23:32 
GeneralRe: How to develop own News section in C# ASP.Net 2.0 ?? Pin
Abhishek Sur30-Nov-09 1:22
professionalAbhishek Sur30-Nov-09 1:22 
AnswerRe: How to develop own News section in C# ASP.Net 2.0 ?? Pin
Abhijit Jana29-Nov-09 22:24
professionalAbhijit Jana29-Nov-09 22:24 
GeneralRe: How to develop own News section in C# ASP.Net 2.0 ?? Pin
Navin Pandit29-Nov-09 22:49
Navin Pandit29-Nov-09 22:49 
Questionneed idea with coding for "forgot password" in asp.net Pin
Amit Spadez29-Nov-09 20:49
professionalAmit Spadez29-Nov-09 20:49 
AnswerRe: need idea with coding for "forgot password" in asp.net Pin
Abhishek Sur29-Nov-09 20:52
professionalAbhishek Sur29-Nov-09 20:52 
AnswerRe: need idea with coding for "forgot password" in asp.net Pin
saini arun29-Nov-09 21:07
saini arun29-Nov-09 21:07 
GeneralRe: need idea with coding for "forgot password" in asp.net Pin
Amit Spadez29-Nov-09 22:10
professionalAmit Spadez29-Nov-09 22:10 

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.