Click here to Skip to main content
15,921,028 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

Service generating error if I pass XDocument as paramater.

Kindly help.

Regards,
Yogesh
Posted

1 solution

XDocument is not serializable, therefore you need to use an intermediary like a string or a surrogate class. An XDocument also isnt understandable by non-.Net Clients. You might just consider using a string and have the client rebuild the XDocument from the string.
 
Share this answer
 
Comments
yrishi 12-Mar-14 2:14am    
Thanks. any example with string option.
Nivedita_Parihar 12-Mar-14 2:38am    
you can pass XDocument content as string

For further reference you can check..
http://forums.asp.net/t/1770887.aspx?Passing+XDocument+as+message+content
yrishi 12-Mar-14 7:24am    
like objXdocument.ToString()??

if yes, how about at wcf end to make string to XDocument
Nivedita_Parihar 13-Mar-14 0:08am    
Try to do with this... XDocument.Parse(string)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900