Communicating Azure Web app with WCF Web App - c#

I need to host ASP.NET based app as Azure Web App which should communicate with WCF based Azure Web App. ( WCF app is also an azure Web App not an on-premise app at all).
What are possible ways to achieve easy and flexible communication between both app services?
Do we need to establish a communication channel specifically?
Both Apps under IIS On-Premises are used to communicate without any problem over NET TCP protocol. But I think now we need both services to communicate over HTTP instead of Net TCP?
What problems we may have?
What things do we need to bear in mind?

First of all, we need to be clear that azure webapp only supports ports 80 and 443.
Secondly, in your project, you said that it runs normally in local, because I don't know what you mean by communicate, and I don't know how to achieve it. Normal communication may be socket or websocket, etc. It is not clear what communication you are talking about. If it is socket and you need to use a port other than 443/80, then it is not supported.
But I know clearly that azure web app supports wcf, which means that both of your webapps can be deployed successfully and run normally. If there is a problem, you can update the error details in the post, and we can provide you with further assistance.

Related

How to limit access to Azure Function App to a website and clients only

I have an API running on a Function App in Azure.
I want this API to only accept communications from two parties:
A blazor website
All copies of a piece of packaged software (a WPF application which will run on customer computers)
I want all other traffic to be rejected.
What is the best way to configure this networking scenario?
The ideal setup:
API should only be able to talk to the Blazor App as well as the client programs, not outside connections. The API can talk to the database which lays behind a virtual network. This Database VNET is already set up.
Any help is appreciated.
Use API Management in front of the API and require Ocp-Apim-Subscription-Key in the requests.
Also, add ip restrictions to avoid unauthorized access

How to host a WCF service

I am trying to create a chat application in WCF.
I've created the client and the service on a localhost using httpBinding,
this is the service endpoint:
http://localhost:9999/ProductService
Now, I really don't know how to make the program run 'globaly' and not on a localhost.
Is there anyway to host the server on my pc? or run the application serverless using p2p communications?
Thanks anyway for your Time
You can set up at publicly accessible web server on your own computer, but it's definitely not recommended for any production purposes, unless you have a good understanding of this and have a internet-connection that allows for it, both technically and legally.
You should probably get external web hosting for this instead.
But if you really want to do this, you can install IIS to host the service.
As a side note, I don't think WCF is the optimal route to take for this anymore. Maybee you should check out SignalR and/or WebSockets instead. And ASP.NET Core WebAPI. It's not really anything wrong with WCF, but for new projects I wouldn't recommend it.

Communicate between .NET desktop applications over local network

I need simple way of communication between 2 desktop application over local network. Client application have to call server and trigger command execution on server desktop. RPC is the old way of doing that. Looks like WCF is new way.
If WCF, does it require IIS on the computer that is running server application?
Where I can find WCF sample code to follow?
For two Windows applications, you're probably going to want a self-hosted WCF service using Net TCP binding.
Self-hosted means the service is contained in your application (could be a desktop app or Windows service) - no IIS required. Just about any kind of binding will work, but Net TCP binding is ideal for .NET applications that only talk to other .NET applications over a LAN.
Here's a sample from MS on self-hosting.
You can host WCF in various ways - IIS, windows service, console application.
So no, you do not need IIS installed unless you want to host it on IIS.
Here are some examples on how to do it
Host a WCF Service in a Managed Windows Service
Host WCF in a Windows Service Using TCP

web application c#

Im trying to make a a cleint/server web application where eventually the client application will be deploy on the internet. People told me to use visual studio WCF duplex but im confuse on how that works. I know for a simple server/client application using sockets, u can just use console for the server and then a windows form for the client.
So how does WCF duplex work, will it be used for both the server and the client side or do i sill use console for the server?? Also how do they establish a connection, in sockets you use ip address and a port.. HELP!
There are many WCF bindings that enable full-duplex communication. WCF servers and clients are able to use sockets among other means of communication. With WCF you can still use the IP Address:Port address system to expose and consume services.
With WCF you still can use Console Apps, Windows Forms or Web Applications to expose or consume those services. It brings no restriction at this point.
WCF will provide flexibility, since once you want to change the binding or the address, you can do it in the configuration file, instead of doing it by changing the code.

how to create a c# app to listen for xmls and reply in xml

I know that you can create web services in .net and have them run on iis. I'd like to make something that doesn't rely on iis as the webserver I'm using runs apache.
The eventual app should listen for incoming xml documents and repy in the form of an xml document, the client application will be running Javascript and sending xmls via http post requests. Is this something that SOAP handles?
All the guides and tutorials seem to follow the microsoft way, all hosted on servers running iis... is there a way around this?
As you can tell I'm quite confused as how to start.
I would strongly advise against implementing your own web service hosting platform - this really isn't a trivial thing to implement, especially if you want to be passing proper web service messages between your servers.
One option that would allow you to utilize WCF and Microsoft's baked in web service functionality is hosting WCF as a standalone service. In this model, you aren't using IIS to host the web service - you trade off some monitoring and logging functionality baked into IIS but it doesn't require IIS be installed.
Here's an article on WCF hosting options - http://msdn.microsoft.com/en-us/library/bb332338.aspx

Categories