Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Atlas client-server binding issue (getter)

Reply
Thread Tools

Atlas client-server binding issue (getter)

 
 
Amie
Guest
Posts: n/a
 
      05-07-2007
Hi,

I have an atlas related question..

I have a web form that submits the information to a web service
method, and it's done thru Atlas by binding the web methods to client
functions.

It seems to be working fine, except for when the class has a property
with only getter (no setter), it freaks out, and returns the following
error:

new Sys.Net.MethodRequestError("The type \'Project\' does not have a
public property or field named

\'StartDateDisplay\'"," at
Microsoft.Web.Script.Serialization.ObjectConverter .AssignToPropertyOrField

(Object propertyValue, Object o, String memberName)\r\n at
Microsoft.Web.Script.Serialization.ObjectConverter

..ConvertDictionaryToObject(IDictionary`2 dictionary, Type type)\r\n
at Microsoft.Web.Script.Serialization

..ObjectConverter.ConvertObjectToTypeInternal(Obje ct o, Type type)\r
\n at Microsoft.Web.Script.Serialization

..ObjectConverter.ConvertObjectToType(Object o, Type type)\r\n at
Microsoft.Web.Services.WebServiceMethodData

..StrongTypeParameters(IDictionary`2 rawParams)\r\n at
Microsoft.Web.Services.WebServiceMethodData.CallMe thodFromRawParams

(Object target, IDictionary`2 parameters)\r\n at
Microsoft.Web.Services.RestHandler.ProcessRequest

(HttpContext context)","System.ArgumentException")

The Project class has a property called "StartDateDisplay" but it's a
getter. Is Atlas unable to map a client object to a server object if
the server class def contains a property with only getter? Is there a
workaround to this?

I have other classes with getter properties, so I'd like to get it
working as is without removing them.

Thanks in advance,
Amie

 
Reply With Quote
 
 
 
 
marss
Guest
Posts: n/a
 
      05-08-2007

Amie wrote:
> Hi,
>
> I have an atlas related question..
>
> I have a web form that submits the information to a web service
> method, and it's done thru Atlas by binding the web methods to client
> functions.
>
> It seems to be working fine, except for when the class has a property
> with only getter (no setter), it freaks out, and returns the following
> error:
>
> new Sys.Net.MethodRequestError("The type \'Project\' does not have a
> public property or field named
>
> \'StartDateDisplay\'"," at
> Microsoft.Web.Script.Serialization.ObjectConverter .AssignToPropertyOrField
>
> (Object propertyValue, Object o, String memberName)\r\n at
> Microsoft.Web.Script.Serialization.ObjectConverter
>


Hi, I guess a problem is not in Atlas. You trying to serialize an
object of the class which has a property that can not be serialized.
Try to explicitly exclude this property from the serialization.

[Serializable]
public class Project
{
public bool NormalProperty
{
get { ... }
set { ... }
}

[NonSerialized]
public string StartDateDisplay
{
get { ... }
}
}

 
Reply With Quote
 
 
 
 
Amie
Guest
Posts: n/a
 
      05-09-2007
Thanks for the response!

I couldn't attach the attribute [Nonserialized] for the property as
it's allowed for field declaration only.

I got around by having an empty setter.. Probably not a best solution,
but it works.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
issue when converting from Atlas to AJAX 1.0 Chris ASP .Net 0 02-11-2007 05:11 PM
Big ISSUE with ATLAS and XMLsript Raffaele Garofalo ASP .Net 0 12-04-2006 11:10 AM
GridView binding - how to stop initial binding Amit ASP .Net 6 10-24-2006 08:06 AM
Atlas Update Panel: javascript sequence issue =?Utf-8?B?cm9kY2hhcg==?= ASP .Net 2 10-02-2006 07:30 PM
Data Binding - using inline code vs. functions vs. straight binding Jordan ASP .Net 2 02-10-2004 08:32 PM



Advertisments