Jarred Capellman Putting 1s and 0s to work since 1995

8Jan/120

Mono + WCF Service (added as a 2.0 service) + Entity Model Object = Fail

Found a bug in either mono or WCF, not sure which one. But if you go to add a Web Reference in Mono Develop (2.8.5) and have an Entity Model Object as a parameter for an object some of the properties will be null. Debugging had me scratching my head as the object was populated prior to sending to the WCF Service. I hadn't tried it as a Native WCF Service in Mono Develop because I've had prior problems with that route.

The solution I came up with was create a serializable object in your WCF Service that wraps the object like so:


[Serializable]
public class BenchResult {
public string CPUName;
....
}

Then in your application your reference will contain (in my case a BenchResult object) the object you defined and upon populating and passing it to your WCF Service all of the data will be populated. Nearly 2 hours gone down the drain on that issue, hopefully it helps someone else.

Posted by Jarred Capellman on Sunday 8th of January 2012 03:44:09 PM

Comments (0) Trackbacks (0)

No comments yet.


Leave a comment

(required)


*

No trackbacks yet.