quintin Posted October 27, 2014 Report Posted October 27, 2014 Hello, I am very much new to using WCF programming I am having an issue while I am trying to return a field for one one of my webservice . That field or that element has a group of information like lets say LDSWebServices.MAVService.ItemsCollectionType.PersonalInformation Address = response.GetValue<string>(LDSWebServices.MAVService.ItemsCollectionType.PersonalInformation) this returns multiple information like Name, Age, Height, Sex, and Address and i want to get only his address for all my other calls i have it like regular call LDSWebServices.MAVService.ItemsCollectionType.AccountNumber accountnumber = response.GetValue<string(LDSWebServices.MAVService.ItemsCollectionType.AccountNumber) which directly returns the account number, I tried to save that personal Information into a list which i am not able to save, when i am doing that its not storing any information. I know this is like a very simple thing But i am unfortunately stuck at this step. Any help would be very much highly appreciated.Please let me know if you need more information i can provide
dotnetrockz Posted October 27, 2014 Report Posted October 27, 2014 my questions will be what was that field declaration in the data contract like? is it a list<t>? since ur sayinmg personal information is a collection of data (name,address etc)....the wya ur reading the response is wrong....
Osama Bin Gandhi Posted October 27, 2014 Report Posted October 27, 2014 LDSWebServices.MAVService.ItemsCollectionType.AccountNumber accountnumber = response.GetValue<string(LDSWebServices.MAVService.ItemsCollectionType.AccountNumber) <string ki > missing sSa_j@il
quintin Posted October 27, 2014 Author Report Posted October 27, 2014 my questions will be what was that field declaration in the data contract like? is it a list<t>? since ur sayinmg personal information is a collection of data (name,address etc)....the wya ur reading the response is wrong.... I think it's a collection , dhani techkuni Andulo nunchi address ni oka local variable lo Save cheyali
quintin Posted October 27, 2014 Author Report Posted October 27, 2014 LDSWebServices.MAVService.ItemsCollectionType.AccountNumber accountnumber = response.GetValue<string(LDSWebServices.MAVService.ItemsCollectionType.AccountNumber) <string ki > missing sSa_j@il[font='Helvetica Neue'] [/font] adhi typo bhayaa
Osama Bin Gandhi Posted October 27, 2014 Report Posted October 27, 2014 Code copy pasting lo typo undadu anukoni vesa... emanna exception ostunda, not able to save ante emptry string return avtunda?? adhi typo bhayaa
quintin Posted October 27, 2014 Author Report Posted October 27, 2014 Exception rataledu akkada oka field nunchi group of information undi bhaya Andulo manaki oka value kavali
puli_keka Posted October 27, 2014 Report Posted October 27, 2014 if its a class and you are getting List<PersonalInfo> or IEnumerable<PersonalInfo> you have to get that list or just the class , then extract the value.. GetValue<string> kudaradhu
quintin Posted October 27, 2014 Author Report Posted October 27, 2014 if its a class and you are getting List<PersonalInfo> or IEnumerable<PersonalInfo> you have to get that list or just the class , then extract the value.. GetValue<string> kudaradhu yeah adhi kuda tey chesa Kani raledu
quintin Posted October 27, 2014 Author Report Posted October 27, 2014 http://stackoverflow.com/questions/26595724/how-to-store-multiple-information-returned-from-webservice?noredirect=1#comment41806424_26595724
Osama Bin Gandhi Posted October 27, 2014 Report Posted October 27, 2014 //if its a class you cant do for interface LDSWebServices.MAVService.ItemsCollectionType.PersonalInformation Personal= LDSWebServices.MAVService.ItemsCollectionType.PersonalInformation(); List<String> getAddress= new List<String>(); getAddress = Personal.Address (address paremeter emanna unte) ila emanna cheyocha?
quintin Posted October 27, 2014 Author Report Posted October 27, 2014 //if its a class you cant do for interface LDSWebServices.MAVService.ItemsCollectionType.PersonalInformationPersonal= LDSWebServices.MAVService.ItemsCollectionType.PersonalInformation();List<String> getAddress= new List<String>();getAddress = Personal.Address (address paremeter emanna unte)ila emanna cheyocha? Personal.address ante ravatledu
dotnetrockz Posted October 27, 2014 Report Posted October 27, 2014 lets say ur personal information field is decalred like this in ur data contract [DataMember] public IList<PersonalInformation> InformationList { get; set; } u shud be able to retrieve the information from thuis list like List<PersonalInformation> PersonalInformationList = Model.InformationList .ToList(); and u can loop thru the list<> and assign the address value to a string
quintin Posted October 27, 2014 Author Report Posted October 27, 2014 We are using wsdls bhaya reference lo ila undi [system.xml.serialization.xmleumattribute(":personalinformation")], Personalinformation
ChampakDas Posted October 27, 2014 Report Posted October 27, 2014 copied from SOF bold: how is this possible? List<string> PI = new List<string>()string address = ""LDSWebServices.MAVService.ItemsCollectionType.PersonalInformation;PI = response.GetValue<List<string>>(LDSWebServices.MAVService.ItemsCollectionType.PersonalInformation);PI.Address = address;
Recommended Posts