Welcome Guest Search | Active Topics | Members | Log In | Register

WCF serialization problem Options · View
arathorn_tr
Posted: Friday, June 29, 2012 2:34:05 PM
Rank: Newbie Coder
Groups: Member

Joined: 6/29/2012
Posts: 4
Points: 12
Location: turkey
Hi ;

I have been using your technology for 1 month. Everything went well. I'm able to publish my wcf services from iis with net-tcp and get these services from my flex client and everything works great and so fast.But after one case i realized that weborb cannot obey the wcf rules. I m defining some properties with data member.Like

[DataContract]
public class Class A

[DataMember]
public string Name
{
get { return mAdi; }
set { mAdi = value; }
}

public string Surname
{
get { return mAdi; }
set { mAdi = value; }
}

When I publish this class i need to get only "Name" property. I'm not defining data member signutare but I also get surname property. Is there any way to restrict these properties with some rules from webConfig or something else.Its an urgent information for me. Thanks...

Mark Piller
Posted: Tuesday, July 24, 2012 11:10:18 AM

Rank: Administration
Groups: Administration

Joined: 8/21/2006
Posts: 1,607
Points: 4,082
Location: Frisco, TX
Hi,

You can exclude properties using the PropertyExclusion attribute. See the documentation for details:
http://www.themidnightcoders.com/fileadmin/docs/dotnet/v5/property_exclusion.htm

Regards,
Mark

Mark Piller
Midnight Coders, Inc.
twitter: midnightcoder
blog: blog.themidnightcoders.com
website: www.themidnightcoders.com
arathorn_tr
Posted: Tuesday, July 24, 2012 11:34:06 AM
Rank: Newbie Coder
Groups: Member

Joined: 6/29/2012
Posts: 4
Points: 12
Location: turkey
What if we have already written entire framework just obeying the rules of wcf and using it nature signatures. Do we really have to refactor all of our codes and add your signature and also add your dll into our core framework. If we dont want to add any external dll to our core framework is it impossible to use your product?? By the way , if you support wcf,why do you ignore the native signature of wcf and push your consumer to use different signature? Thanks

Onur
Mark Piller
Posted: Tuesday, July 24, 2012 11:37:53 AM

Rank: Administration
Groups: Administration

Joined: 8/21/2006
Posts: 1,607
Points: 4,082
Location: Frisco, TX
Onur,

You do not need to rewrite your signatures, all you need to do is to add an attribute.

WebORB exposes your class not only as a WCF service, but also as a plain .NET class. Our attribute takes care of property exclusion in both cases.

Also, if you do not define the "Surname" property on the client, it will never show up even you do not exclude it explicitly.

Mark

Mark Piller
Midnight Coders, Inc.
twitter: midnightcoder
blog: blog.themidnightcoders.com
website: www.themidnightcoders.com
arathorn_tr
Posted: Tuesday, July 24, 2012 11:47:17 AM
Rank: Newbie Coder
Groups: Member

Joined: 6/29/2012
Posts: 4
Points: 12
Location: turkey
Hi Mark,

Thanks for your reply but could you please explain this sentence more specific .

Also, if you do not define the "Surname" property on the client, it will never show up even you do not exclude it explicitly. ?
Mark Piller
Posted: Tuesday, July 24, 2012 12:30:26 PM

Rank: Administration
Groups: Administration

Joined: 8/21/2006
Posts: 1,607
Points: 4,082
Location: Frisco, TX
Your class A has two representations, it is defined on the server-side as a .NET "Class A", it also has a representation in flex as an ActionScript class (which I assume has the same name). The structure of the class (the fields and properties) they define should be the same, however, the ActionScript side does not need to have a field or property ("public function set XXX") for all the corresponding server-side properties. That means if your AS class does not define the "Surname" property, it will never be initialized with a value when WebORB returns an instance of A to the client.

Hope it makes it clearer.

Regards,
Mark

Mark Piller
Midnight Coders, Inc.
twitter: midnightcoder
blog: blog.themidnightcoders.com
website: www.themidnightcoders.com
arathorn_tr
Posted: Tuesday, July 24, 2012 12:39:16 PM
Rank: Newbie Coder
Groups: Member

Joined: 6/29/2012
Posts: 4
Points: 12
Location: turkey
Thanks Mark

I'm gonna try your explanation hopefully it would help us.I'll let you know...

Onur
Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Main Forum RSS : RSS

YAFVision Theme Created by Jaben Cargman (Tiny Gecko)
Powered by Yet Another Forum.net version 1.9.1.8 (NET v2.0) - 3/29/2008
Copyright © 2003-2008 Yet Another Forum.net. All rights reserved.
This page was generated in 0.143 seconds.