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
446 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
Comment Utility
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
Comment Utility
Did this solve your problem?
0
 

Author Closing Comment

by:ICDB_ED
Comment Utility
Yes it did.  Sorry for the delay
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Here I am going to explain creating proxies at runtime for WCF Service. So basically we use to generate proxies using Add Service Reference and then giving the Url of the WCF service then generate proxy files at client side. Ok, what if something ge…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now