That's exactly what they've done here, now I guess they are looking at me breaking this down into something simpler. Two months ago when we started this work with no one having done this s**t before, I was thinking "Let's get a contractor who knows this s**t for 3 months"... Thanks guise for all the input, I will be referring back to this page! If I can get it working in Web API 2 then get it working in the most simple way that Gambol suggested then say to the boss "take your pick", I think he'll be quite happy with that.
The poor **** is going to listen to Gambol, head melt himself for 8 hours today, then get the sack. Take the easy .NET walk through solution ya silly bastard!
Hai guise, didn't manage to get it working but made some progress. Never done any web or c# development so it's all gobbledygook to me and I struggled to find any decent example code of what the boss wants which is clearer now and is as follows: Web API 2 Web Service running as a service on the local machine or server (managed to do this using OWIN and Katana) (whatever the **** they are) Javascript in our vash/js combo to call the webservice which should return data in json format Web Service to call into a C# dll which will in turn call into our SQL Server DB I know it's probably not a good design but the boss has this idea that the web service shouldn't do a lot other than call into the dll which will be the place to do all the work. Personally I'd have the web service going straight to the DB via Stored Procs which can easily be changed. Spent most of the afternoon trying to get the web service I'd created to run as a service on my machine but it just wouldn't ****ing work. OWIN wouldn't accept it. Found a very good very simple example of how to get this to work which I copied and it does work so now I need to put in some code to get it to do something other than return a string. Boss wants me doing QA tomorrow as we've done most of the Dev for this sprint and there's a stack of stuff needs testing.
You are clearly out of your depth so resorting to piss-takery. Is Mike around? I sometimes wonder if me, him and ER are the only contributors to this forum worth bothering with.
Responded, any thoughts on what I posted above? The running as a service bit seems ok, reckon I'll probably get there in the end but such slow progress as it's all new to me.
Yes I'm lost - it seems like a 5 minute job which you have went on some mad tangent on, which is why I offered to Skype. So you were saying that you were trying to get the web service to work as a 'Service' on your machine - I've no idea if that can work (without Googling it) - typically you have a web server running IIS which you will try to get a web service to run off, because you know 'web' is the key word here and you need a website to serve it. Usually the average programmer creates a 'web service' project in Visual Studio, then when they go to Publish it, it contains all the files you need to just plop into the website directory (usally Service.svc type files). The only complication after that is configuring IIS to accept web services (some MIME type settings need changed). Inside that service the code is basically like normal .NET code (bar a few bits and bobs to define it as a web accessible method), and again it's probably a 5 minute job to connect to a database in there.
This is a bit different (or is it?), we want to run this web service as either a windows service on the local machine or on a server on the network. When I looked in VS2013 to publish what I'd done, the options seemed to be Azure whatever that is or the cloud whatever that is. I need to have something which we can install in our setup to either the local machine or a server. We have a product which can be a standalone or server/client installation. There ain't gonna be any website or web server.
Well that's me ****ed. A web service is basically a DLL which is accesible over a web server - it's a shared library made public. Ok you connect some web services to DLLs, but that's only because web services are a way of publicly exposing DLLs (you don't host a DLL on a website and let things hit it directly). I just don't understand why you would be wanting to use a web service that isn't served from a website - a DLL does exactly the same thing if you want to connect through normal network protocols. In case we're getting confused, a 'Windows Service' is something completely different - it's more or less a program which doesn't have a User Interface and just starts up automatically (or not) rather than being run as a standard windows application which you double-click on.
To run as a Windows Service I followed this guide: http://katanaproject.codeplex.com/wikipage?title=Hello World&referringTitle=Documentation Installed "chocolatey" (wtf?) and all the rest of it but it wouldn't work. Googled the errors I was getting and that's where I found the example that actually worked. Can give you the link tomorrow if you're interested, saved it on my work comp, can't find it now. Edit: don't try to understand why we want to do it this way, this is what da boss decided was the way, I'm just the monkey tasked with implementing it.
I seriously thought you were taking the piss. Ok, as I understand it you already have a web service installed as a DLL on the web site and your're trying to figure out how to call it to get the JSON data onto a page so you can use JavaScript to render it?
So you solved it? Afraid I'm unfamiliar with the Katana framework. Never even heard of it. I take it the Katana framework is also responsible for taking your data and creating an entity layer (turning a database result set into C# objects) too? Which is why I guess your boss went for it. Seems like an awful lot of bother to go to just to call a web service.