c# - Datetime value getting reset in wcf service on using as a web reference and not with using as a service reference -


i have wcf service operation follow:

    public void setnotifications(list<announcementdatacontract> announcements)     {         foreach(announcementdatacontract item in announcements)         {             ent.insertannouncements(item.anc_text, item.anc_date);         }     } 

when add wcf service webreference in mvc application , calls method follow:

       myservice.service1 proxy = new myservice.service1();        collection<myservice.announcementdatacontract> dc = new                                collection<myservice.announcementdatacontract>();         myservice.announcementdatacontract dc1 = new                       myservice.announcementdatacontract();         dc1.anc_date = system.datetime.now;         dc1.anc_text = "announcement1";         dc.add(dc1);         proxy.setnotifications(dc.toarray()); 

the value in each item "announcements" @ service operation reset , min datetime value not 1 have sent mvc application on calling operation.

but when add wcf service service reference in mvc application , calls operation, works fine , correct value of datetime obtained @ service.

i had same problem. because generated proxy code announcementdatacontract class creates property called anc_datespecified, has set true. case value types.


Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -