Reputation: 8237
I have a wcf WebService with a method which takes LogLevel type (part of Nlog) as a parameter, the LogLevel is build in type comes with a framework for logging called NLog, Problem is WCF doesnt know how to marshal the loglevel parameter i guess cause its not decorated with DataContract.
is there is any way i can marshal LogLevel through the webservice ?
Note im trying not to wrap it in a custom class.
Upvotes: 1
Views: 424
Reputation: 3786
You can't transport the entire LogLevel instance. But you can use the string name instead. Call your method with the property value loglevelInstance.Name and recreate a LogLevel instance at the server side using LogLevel.FromName(theString).
Upvotes: 2
Reputation: 65441
It is could by due to the LogLevel being an enum. Convert it to a text, send it over and then convert it back on the client side.
Upvotes: 1