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
451 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

While working on Silverlight and WCF application, I faced one issue where fault exception occurred at WCF operation contract is not getting propagated to Silverlight client. So after searching net I came to know that it was behavior by default for s…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

739 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