Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Adding .NET based WCF service to Script# project #414

Closed
parthangshu opened this Issue Mar 31, 2014 · 2 comments

Comments

Projects
None yet
3 participants

Hi,
I have one .NET based WCF service running in production (NOT RESTFUL service). I have to consume that WCF service to my Script# project. I am using Script# version 0.7.2.0. Whenever I am adding the service using Visual studio "Add Service reference", the service is getting added. But building the application it says "Error 5 The type or namespace name 'GeneratedCodeAttributeAttribute' does not exist in the namespace 'System.CodeDom.Compiler' (are you missing an assembly reference?"

So, I couldn't add the WCF service to my Script# project. I googled and found Script# has limited .NET based capabilities so it is not able to add WCF service. But I have to add the WCF service to my project to fulfill the requirement. But I can' t change the WCF service to RESTFul service because it is in production.

Please help!!!

Many thanks,
Partha

Contributor

michaelaird commented Mar 31, 2014

Unfortunately, there isn't anything that will scaffold consuming a WCF
service from Script#. If you're service speaks JSON, you could follow an
approach like this:
http://pranayamr.blogspot.ca/2010/12/steps-to-call-wcf-service-using-jquery.html
.

You might also be able to use something like this:
http://www.codeproject.com/Articles/627082/How-to-Consume-WCF-Service-using-JavaScript-Proxyto
generate a Javascript proxy. Then, in Script#, write an external
interface to reproduce the proxy.

On Mon, Mar 31, 2014 at 3:50 AM, parthangshu notifications@github.comwrote:

Hi,
I have one .NET based WCF service running in production (NOT RESTFUL
service). I have to consume that WCF service to my Script# project. I am
using Script# version 0.7.2.0. Whenever I am adding the service using
Visual studio "Add Service reference", the service is getting added. But
building the application it says "Error 5 The type or namespace name
'GeneratedCodeAttributeAttribute' does not exist in the namespace
'System.CodeDom.Compiler' (are you missing an assembly reference?"

So, I couldn't add the WCF service to my Script# project. I googled and
found Script# has limited .NET based capabilities so it is not able to add
WCF service. But I have to add the WCF service to my project to fulfill the
requirement. But I can' t change the WCF service to RESTFul service because
it is in production.

Please help!!!

Many thanks,
Partha

Reply to this email directly or view it on GitHubhttps://github.com/nikhilk/scriptsharp/issues/414
.

Owner

nikhilk commented Apr 3, 2014

Great to see folks already chiming in and helping... just some contextual stuff to keep in mind.

Script# is not about running .net code. Its about using c# language to author script apps, and use the capabilities of scripting environments (in browser, in node.js etc.). The answer to many of these "how do I do x in script#" questions is the same as "how do I do x in insert_your_script_environment".

So, as mentioned, in a JavaScript client, you'd likely (or maybe I should say ideally, since this isn't the case with WCF-based implementations sometimes) work with a service with a simple REST API that speaks JSON. The same applies in script#.

@nikhilk nikhilk closed this Apr 3, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment