I am still relatively new to writing API's and web services, so bear with me if I use incorrect terminology.
I want to know if it is possible to create an API in C# using nancyfx (or any other framework) or even just a simple web app and then set it up as a continually running web service using WampServer. I'm pretty new to Wamp, all I have done so far is create a few rudimentary pages with php; but I can't seem to find any information about running a web service with Wamp using a different back end language other than php.
WAMP is stand for Windows Apache MySQL PHP. As I can say, you can't run a C# web service with it base configuration. However, you actually don't need this. If you are on .net Core, there is a Kestrel web server. You can use it to serve your app. On a .net framework you have a HttpListener which can help you to implement self-hosted web service (for example, a windows service which hosts your application).
There are many other options, btw. Try google for some kind of "Hosting .net web application" or "Self-hosted .net web application"
Related
I am learning about Blazor server apps. We have an existing asp.net MVC application that communicates with a WCF service via netTcpBindings. We are now thinking about moving our development into .net Core so based on that Blazor Server seems very cool to start with.
My question is, how can I consume the existing WCF netTcpBindings service on any new Blazor Server application? I have tried googling this but could not find much on the subject. Is it even possible to consume a WCF service in .Net core (because from what it seems WCF is not brought into .Net core)?
It is still possible to consume WCF from a .Net Core application. Bear in mind that it is nothing else than a communication protocol, so it doesn't really matter what "language" you are using as long as you are able to connect to the server providing the service and you implement the protocol.
Luckily the Microsoft people have that in .Net Core so
Say you have the following service:
on your Server on the Startup.cs file you can then do something like this:
Done, you may now invoke your WCF service from your .Net Core server
i am new to visual studio, and i developing a distributed system with visual studio, i'm developing two applications
windows forum application c#
Web application asp.net
so i using WCF Services to make this system distributed, is is right?
in web application im using a WCF Services to Login and insert data and retrive data.
In your situation, i can say WCF would be fine. But in future if you are planning to support your application on devices like smartphones/tablets then Web API would be better choice.
But its totally depend on the situation. You will get more info on the following link:
http://www.dotnettricks.com/learn/webapi/difference-between-wcf-and-web-api-and-wcf-rest-and-web-service
Hope this will help you to choose appropriate option for your application.
so our company wrote an accounting app,in windows,using c# for a certain company that ordered an accounting application.
after a while,they requested an android app that can communicate with the server and request or send data from or to the database that the windows form application uses,which uses SQLExpress 2014.
note that : the application that runs on the android platform may need run on more than one client at any given time.
AND
the android app will be native.
my main question is this : whats the best technology to use?
do i HAVE to use web services ?
well to do that i have to install IIS on the windows client which is
all im trying to avoid,because i have a setup and the program has been
mass produced within the city so i cant just take back every
customer's product and add iis setup procedures to the setup...if u
know what i mean
Not true. Since WCF days, there's an in-process option called XXX self-host which is a tiny web server written in C# and started along with your process using code.
Currently your best web should be developing your Web services using OWIN/Katana self-host and implement your RESTful service running on a Windows service (did you know about TopShelf?).
Check this interesting MSDN article to learn more about self-hosting a Web API into a Windows Service using Topshelf.
TL;DR
Your best bet here would be creating a Windows service which might be installed along with the Windows application or in some customer's server machine and host this way your RESTful Web service using ASP.NET Web API.
This is easy to deploy and distribute, and your customer won't require an IIS installed to host web services.
I have an existing website that is currently using .Net 3.5 and must stay that way because of our sharepoint integration. I need to write a web service/web api that the website will interact with (a method to send an email, for example). I also need to write a windows service that is going to do the same thing. The windows service will probably be .Net 4.5.
What framework should I use for the web service/web api so both environments can interact with it the best?
The very nature of web services, soap or rest, is that they are platform agnostic. This also applies to .net versions, you can have whatever version at the server and another version at the client and this surely will work.
I'm migrating an old Delphi application that I wrote into C#. The application is a datalogger that exposes logged data requests via a SOAP web service interface.
The web service is contained with the delphi graphical windows application, i.e. no need to run a web server like IIS, etc I just run the application and it's up and running under the hood.
I'm looking to do the same in my c# Windows form application, I can find loads of resources on writing web services that are ultimately hosted within IIS but am struggling to find a solution for a self contained web service within my application.
Does anyone have any suggestions or can point me towards any resources on this?
The web service does not neceserily have to be SOAP, REST is fine (in fact probably prefered).
Look into WCF Services.
Hosting and Consuming WCF Services
Hosting WCF services in a Windows Forms Application
The System.Web.Hosting namespace allows you to host ASP.Net pages without using IIS within your applications. I have never used it to host web services but I found a tutorial that seems to provide a guide on doing this-
http://msdn.microsoft.com/en-us/magazine/cc163879.aspx
If you're wanting to host a service inside your application, it's possible with the System.ServiceModel.ServiceHost class. You need to learn WCF first, but that at least answers your question to get you started. If you have any further questions, leave me a comment or two and I'll update my answer to accommodate your inquiries.