[Mono-list] WCF service using JSON over Ajax possible on mono?

Jeff Bonhag jbonhag at SCA-CORP.COM
Sat Sep 20 16:00:45 UTC 2014


Hi Olli,

The biggest problem I had was getting the Web.config set up properly.
For each service you need to define an endpoint, a service behavior, and
an endpoint behavior -- .NET does a lot of this automatically so it can
be very confusing why your service doesn't work.

Here's a trivial WCF service that runs on Mono:

    https://github.com/jeffbonhag/wcfservice1

WCF works well!  You can perform AJAX requests, you can deserialize a
request to an object, and serialize a POCO by specifying it as the
return type of your WCF method -- it's all good.

One issue I had is that UriTemplates of the form:

    "weather/{state}/{city}"

don't seem to work -- at least on Ubuntu, Mono 3.2.8.  Perhaps there's
additional behavior that needs to be specified.  I'll revisit the issue
someday.

Good luck!  I've struggled with this for some time so I'm happy to
help any way I can.

Cheers,

Jeff Bonhag




-----Original Message-----
From: mono-list-bounces at lists.ximian.com on behalf of Olli Heiskanen
Sent: Sat 9/20/2014 7:16 AM
To: mono-list at lists.ximian.com
Subject: [Mono-list]  WCF service using JSON over Ajax possible on mono?
 
Hello list,

I've been working on a wcf service to be run on mono on a CentOS 6.5
platform. Can the current mono support a wcf service that communicates JSON
over Ajax calls from a html5 web client? I can't seem to find any examples
of someone being able to build such a system on a mono environment. I
wonder if I need to add something extra compared to the plentiful online
examples that are written for Windows platform?

Cheers,
Olli

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-list/attachments/20140920/cd3158bf/attachment.html>


More information about the Mono-list mailing list