objects of following class need passed arguments wcf web service:
public class context { public static readonly string auth_code = "auth_code"; public static readonly string request_tag = "request_tag"; private readonly idictionary<string, string> _context = new dictionary<string, string>(); public void addproperty(string key, string value) { _context.add(key, value); } public string getproperty(string name) { return _context[name]; } }
i tagged class [datacontract] , auth_code, request_tag , _context fields [datamember]. class defined along web service on server side.
when try instantiate object of class can pass parameter while calling web service client, observe following:
- auth_code , request_tag not visible.
- _context visbile though privte member
- addproperty getproperty methods not visible
can please explain above behavior?
also, need access addproperty method populate object before calling web service. how achieve this?
note : first experience wcf. if straying off standard practices towards achieving such behavior, please advise.
- the datamemberattribute attribute ignored if applied static members.
- member accessibility levels (internal, private, protected, or public) not affect data contract in way.
- data contract supports state, not behaviour. methods not affect on data contract.
the behaviour of data contacts described in following msdn link: http://msdn.microsoft.com/en-us/library/ms733127.aspx