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

Olli Heiskanen ohjelmistoarkkitehti at gmail.com
Mon Sep 22 08:13:15 UTC 2014


Hi,

Thanks a million Jeff, your example and comments are extremely helpful!

I think there's something wrong in my setup, as my own project is similar
to the one you provided. When I made sure my Web.config matches Jeff's
example, and eploy my wcf service on my CentOS 6.5 server, I get the
following error while accessing the .svc file:

Failed to export endpoint 'WebHttpBinding_IDataService': wsdl exporter
'System.ServiceModel.Channels.WebMessageEncodingBindingElement' threw an
exception: System.NotImplementedException: The requested feature is not
implemented. at
System.ServiceModel.Channels.WebMessageEncodingBindingElement.System.ServiceModel.Description.IWsdlExportExtension.ExportEndpoint
(System.ServiceModel.Description.WsdlExporter exporter,
System.ServiceModel.Description.WsdlEndpointConversionContext context)
[0x00000] in <filename unknown>:0 at
System.ServiceModel.Description.WsdlExporter.ExportEndpoint_Internal
(System.ServiceModel.Description.ServiceEndpoint endpoint) [0x00000] in
<filename unknown>:0


My mono version is  3.10.1 so it seems strange that the
WebMessageEncodingBindingElement would not be implemented. In fact, I
compiled mono, mod_mono and xsp right from github masters only a few days
ago, which leads me to wonder if there's something wrong somewhere else.

Any idea how I could locate the problem?

cheers,
Olli


2014-09-20 19:00 GMT+03:00 Jeff Bonhag <jbonhag at sca-corp.com>:

>  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/20140922/e946e8cb/attachment.html>


More information about the Mono-list mailing list