Alright, I almost reached a point of frustrations that I want to go to break things. Figurly speaking of course.
For about week now I try to learn to make a web service written in C# (WCF, ASMX web service, I don't care, whatever is best) and I want to reach the web service with JQuery/AJAX (and no ASP.NET webforms cause I want to use AngularJS) or if it is better, generate a proxy that calls the WCF.
What I have tried so far: I started with the normal web service (In Visual Studio 2012: start an empty ASP.NET Web application and add an web service to it). I run the webservice and it works. Then I publish the web service to IIS so I can reach it from a different computer. And then the first problem shows up, it wont work. Seems I had to install ASP.NET at IIS. And it works but when I call the web service on the different computer I get the message that I can only invoke the web methods on the local machine.
Looking on this message gives me a lot of the same results: I have to configure my web.config and I have to add httpGet and httpPost tags to it. So I do that, but... still doesnt work. Searching further doesnt give me the right answer or solution.
But what I did read is that this way of web service is out of date and I should use WCF. Since I want this to work, and it doesnt matter in what way, as long as the service is in c# and client is JS (with AngularJS) I am happy.
So I searched for tutorials, found a lot of them, followed many of them but none of them worked, at least, not for me. Errors and messages is what I get, and when I solve one message or error, I get the next one.
With WCF I am now that far I could call the operation contract but I couldnt pass the parameter of the operation contract. Maybe Json Syntax error? I don't know. According to some anwers on StackOverflow I had to add a RequestFormat. So I did. And I also had to change the WebGet to WebInvoke. But now I get a 405 error and searching on it, it seems a Post/Get issue. So I change the Type in the AJAX call to Post (which it should be according to the service headers), but the call stays on GET. And that I simply don't understand and after a long time of trying it starts to frustrate me.
The bottom line is: What is the best practice when it comes to web services? Is there a good written tutorial which handles every point so it actually does work in the end? Or what and I doing wrong? Cause, since there are probably thousands of web services on the internet, it is surely is something I am doing wrong, but I can never figure out clearly what.