If the data you want to return in the service is of XML format, then both strong-typed list or simply xml text/string based format are ok. Using XML string will require less data object serialization effort at the service side and with .NET framework based
client, you can easily get the XML string parsed through LINQ to XML classes.
BTW, for transfering XML(or XHTML) markup data, I'd strongly recommend that you define the data parameter or return value as XElement or XmlElement type. Those types are better for transfer XML markup data since the WCF or webservice runtime will transfer
them as raw XML string format. If you directly use a String parameter, the webservice/WCF runtime will perform escaping on some of charaters in it.
gopikrsna
Member
190 Points
234 Posts
WCF doubt: String Vs List
May 07, 2012 09:42 AM|LINK
We are having a WCF service , which will communicate to another WCF service.
From our service we are pushing data to Client WCF service.
We are sending data in string format (like xml data , but in string format).
Doubts: Which is a better from the below:
Sending data in string format or List format.
Which gives better performance.
ReenuGouse
Participant
1395 Points
385 Posts
Re: WCF doubt: String Vs List
May 07, 2012 10:12 AM|LINK
Gopi,
using string format is much comfortable.
if u r using SQL server and using XML data type then string format will be comfortable.
gopikrsna
Member
190 Points
234 Posts
Re: WCF doubt: String Vs List
May 07, 2012 11:17 AM|LINK
Thanks for replying!
How abt performance ?
Steven Cheng...
Contributor
4199 Points
548 Posts
Microsoft
Moderator
Re: WCF doubt: String Vs List
May 08, 2012 02:20 AM|LINK
Hi gopikrsna,
If the data you want to return in the service is of XML format, then both strong-typed list or simply xml text/string based format are ok. Using XML string will require less data object serialization effort at the service side and with .NET framework based client, you can easily get the XML string parsed through LINQ to XML classes.
BTW, for transfering XML(or XHTML) markup data, I'd strongly recommend that you define the data parameter or return value as XElement or XmlElement type. Those types are better for transfer XML markup data since the WCF or webservice runtime will transfer them as raw XML string format. If you directly use a String parameter, the webservice/WCF runtime will perform escaping on some of charaters in it.
Feedback to us
Microsoft One Code Framework