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.
Related
I'm new to ASP.Net and I have the following scenario:
I have a .Net Framework project folder with several projects. All of them are configured .Net Framework 4.7.2 and I have a dependency I can not change at the moment. So migrating to .Net Core is not an option at the moment.
My question is the following:
What is the correct approach to add the functionality of a RESTful server with ASP.Net?
I don't want to implement a frontend. I just want to add a server to my projects.
In
https://learn.microsoft.com/en-us/dotnet/standard/choosing-core-framework-server
it says, "In most cases, you don't need to migrate your existing applications to .NET 5. Instead, a recommended approach is to use .NET 5 as you extend an existing application, such as writing a new web service in ASP.NET Core."
How should I do that?
I'm really confused. Please help me.
Maybe some hints or links to other pages are enough to lead me into the right direction :)
Kind regards
Chris
It basically depends on your future preference and time, If the organisation is pretty much aligned with .netcore what you can do is you can easily migrate .net framework project to .Net standard and create a new .Net core project with API endpoints defined and you can easily refer the .Net standard libraries directly to it.
https://learn.microsoft.com/en-us/dotnet/core/porting/
But if you want to stick to .Net framework libraries, you can create basic Asp.Net core web API with DotNetframework, It is not a legacy framework, it has the latest release within 3 months and it is also battle-tested, But you can only host in windows machines unlike .Net core which you can host in windows/linux
https://developer.okta.com/blog/2018/07/27/build-crud-app-in-aspnet-framework-webapi-and-angular
any .net project that running on a web server supports REST calls. In fact if you make a webmethod?
Say this code:
<WebMethod()>
Public Function HelloWorld() As String
If keyid <> 123 Then Exit Function
Return "Hello World from server"
End Function
Then right out of the box with ONLY the above code?
The above supports SOAP 1.1, 1.2, and post (REST) calls.
So there is no "concept" in asp.net that you "adopt" SOME kind of RESTful server - the server you use in this case is IIS, and it supports REST calls out of the box, and always did from day one to my knowledge. You MOST certainly have to run a web server, but making REST calls does not require a "special" RESTful server, but just in fact that you running a web server - in this case IIS or so called internet services.
If you already have a project that supports and API just add an additional controller, assuming the functionality is not closely related to existing functionality.
Context:
I'm currently on application including many subproject based on .NET Standard (for Xamarin).
This application need to run Kestrel Web Server to expose an API (application must be callable from external to receive updated datas).
So, I have created an ASP.NET Core project permitting to make easily a WebApi and run a server (Kestrel). Problem, It's a .NET Core project and it's incompatible with Xamarin.
Objectives:
The application must be callable from external (expose an API)
The application must used .NET Standard Projects (compatibility with
Xamarin)
The application must run on desktop and mobile
Questions:
Will WebAPI included in futures releases of .NET Standard?
Does it seems complicated to expose an API (and so, run a server) in
mobile app (and not a good practice by the way)?
Is there any other way to do this work?
Objectives:
•The application must be callable from external (expose an API)
Get a web server serving as middle man and passing the request it got from external then it should be doable
•The application must used .NET Standard Projects (compatibility with
Xamarin)
Web API runs on server and Xamarin runs on mobile/Desktop, Xamarin shouldn't have to worry about what tech stack the server uses as long as it complies with the protocol both agrees on (http)
•The application must run on desktop and mobile
Not an issue
Questions:
•Will WebAPI included in futures releases of .NET Standard ?
Definitely yes.
•Does it seems complicated to expose an API (and so, run a server) in
mobile app (and not a good practice by the way) ?
Totally wrong way to do it. your app will lost internet connection whenever the phone decides to sleep for a while plus the phone is just not designed to serve as a server.
•Is there any other way to do this work?
Get a real cloud server instead and run your API there.
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"
I am new to the IOS app development. I go through the apple developer portal they use Objective -C as their server side framework.
The main problem is I need to develop the app in one month and I know C# web service or java server side framework.
Does these frameworks are supported by the iOS apps API. Please suggest me.
And if possible give me some reference for these existing frameworks.
Thanks in advance
Usually an App communicates via an HTTP service (usually a REST service) with a server. The server can be written in any language which can be used to provide a REST service. For example ASP.NET Web API if you are familiar with .NET and C#
Does anyone tell me if it's possible to use WCF without .NET 3.0?
Our company develops a 3-tier client-server end-user solution based on .Remoting. One of the limitation of our project is using .NET 2.0. Unfortunately .NET 3.0 framework is too large to be included in our installation package and I don't know if MS license allows this.
But WCF might helps us to drastically reduce our efforts in some tasks.
Does anyone have a chance to use WCF from Mono?
Thanks in advance
--
Murat
Unfortunately this is not possible. System.ServiceModel and System.Runtime.Serialization assemblies are required and they are part of .NET 3.0.
Another important note is that WCF depends on HTTP.SYS (kernel level HTTP stack) which is available on Win2003, WinXP SP2 or higher, while you can still have .NET 2.0 installed on Win2000.
On the client side you could still have .NET 2.0 consuming the WCF service. You need to expose a basicHttpBinding endpoint for this purpose.
Could you use WCF and .Net 3.0 just on the servers at least? You could write your clients to consume simple ASMX style web service calls, and keep their install footprint small, while still getting the architectrual benefits of WCF in the server software.
That is part of the point of n-tier software... you can more easily upgrade critical peices of the application because they are on a few servers instead of on thousands of clients. I would re-examine .Net 2.0 requirement at least on your top tiers. You should see an easy cost-benefit improvement using the flexibility of the WCF platform even if you have heavy server install.
Well, there is WCF on Mono (http://www.mono-project.com/WCF) but I can't tell you how compatible it is. The whole thing would impose other restrictions as well, namely availability of Mono.
Apart from that WCF services can be exposed as web services with which you can talk to with mechanisms available on .NET 2.0
You can invoke WCF services (if they are configured to use SOAP over HTTP) from any client, using regular SOAP bindings/syntax. The service itself, however, needs to be running on .NET 3.0. If you have the ability to create just the service layer on .NET 3.x and leave the rest of your stack on 2.0, that might be a good way to go.
A lot of the features of WCF were piloted (using ASMX web services) in WSE 3.0, which runs on .NET 2.0, but you will need to look at WSE to figure out if it will actually save you time; it adds a lot of nice features for security/etc., but is not as easy to pick up and use as WCF.