Solved

How do I get ASP.Net Web Service Serialization to work correctly with inherited and implented data entities in Web Services

Posted on 2009-05-12
3
450 Views
Last Modified: 2013-11-08
Application Architecture: 3 Tiered with Data Entities

1. .svc Web Service
2. DAL
3. Web Application

  I have a web application that "calls" for data on the DAL.  The DAL queries the database and puts that data into a data entity via a custom build "data mapper."  The web application receives that data entity and processes it appropriately.  However the some of the data entity's properties are null.  Our custom data mapper, DAL and Stored procedures (oracle db) are working correctly and returning data as designed.  And the data entity is correctly designed as showed below.  The data entity inherites another class properties and implements an interface.  The data entity has no methods only data properties.  As shown below  alpha inherits childA and implements childB.  The problem is childB properties are not being set.
using System.Runtime.Serialization.
...
 
[Data Contract]
Public class alpha: childA, childB
{
...
}
 
[Data Contract]
Public class childA
{
  [Data Member]
  public string name{set;get;}
  [Data Member]
  public int age{set;get;}
}
 
 
 
[Data Contract]
public interface childB
{
  [Data Member]
  public int weight{set;get;}
  [Data Member]
  public int height{set;get;}
}

Open in new window

0
Comment
Question by:ICDB_ED
  • 2
3 Comments
 
LVL 7

Expert Comment

by:deadlyDev
ID: 24516337
You need to apply the data member attributes to the properties in alpha, and not the interface
0
 
LVL 7

Accepted Solution

by:
deadlyDev earned 250 total points
ID: 24525511
Did this solve your problem?
0
 

Author Closing Comment

by:ICDB_ED
ID: 31580824
Yes it did.  Sorry for the delay
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question