I'm using a sms panel in my website which provides me with a api to use, when I'm debugging the system and use it locally it works perfectly but when I publish the website it gives the following error:
A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 87.107.121.54:80
and this is the code I'm using
SendSoapClient client = new SendSoapClient("SendSoap");
ArrayOfString receivers = new ArrayOfString();
receivers .Add("0920xxxxxxx");
ArrayOfString result = client.SendSimpleSMS("username", "password", receivers, "sender number", "message goes here", false);
I've put the call to the web service inside my global.asax file just to check if it works or not and it just doesn't work. what exactly am I doing wrong here ?
P.S: I've used this api service in my other websites which are not mvc projects, but just asp.net website and they all are working fine, this is the first time using it in mvc project.
It appears that the computer you deployed your application to doesn't have network access to the 87.107.121.54 IP address which is where the API is hosted. So talk to your network administrator and make sure that the server on which your ASP.NET MVC application is running has network access to this address. Since it is on port 80, I suppose that there shouldn't be issues with the firewall, but nevertheless, you should check that as well. There's nothing wrong with your code, it's more of an infrastructure and network connectivity problem.
Related
I want to make a website that connects to a clients internal server through a TCP connection in order to get a stream of data from an internal server in the clients computer (at a specific port).
There is a 3rd party program that when running simulations creates a 'telemetry server' at a specific port in the clients computer. I want my website to connect to that port on the clients computer and do stuff (plots) with that output.
I read about Blazor server-side app and though I give it a try since I know C# and I already wrote a program to graph said telemetry output data in C#. Now I want to make my program available to others though a website.
My program connects through System.Net.Sockets.TcpClient without problem. I even tested the connection on Blazor server-side app and it connects when the server is running on my computer.
System.Net.Sockets.TcpClient tcpclnt = new System.Net.Sockets.TcpClient();
state = "Connecting.....";
tcpclnt.Connect(myIp, 15151); // Telemetry server in port 15151
stm = tcpclnt.GetStream();
The problem is when I host my Blazor website in Azure, it is not longer able to connect. I tried writing my public IP in myIp and it doesn't work.
Unfortunately I don't get info error output from Blazor since the website just freezes with "An error has occurred..." message.
I don't know much about this (TCP connections, web connection rules, ports..) and would appreciate any leads on what could be wrong or if it is even possible.
EDIT:
I'm using server-side as suggested here since a client-side app wont be allowed to connect How can I use Socket in Blazor Client-side?
Are you using a Azure web app?
You might want to consider adding Azure Network Gateways to handle Routing rules. I think all apps and VM's in Azure need a application gateway to communicate outside of the Azure subnet.
I am having an issue connecting to my web api (via Postman)from a separate computer on the same network. I am Able to connect (Via Postman) if I am working on the same computer where the API is located. However When I attempt to connect to the same API (Via Postman) on a separate computer (within the same network). I receive an error stating
"Could not Send response
ECONNREFUSED"
I have tried to unblock SSL certificates.
I have also tried to add bindings to the applicationhost.config file
Neither of these have worked for me.
As a side note, The API does not have any Authentication associated with it so my guess is it has something to do with access to the web server where the API is housed.
Any help would be greatly appreciated
Connect through Ip Address That should work.
For Example
on local it should be like this
http://localhost:8050/ParseXml
On Remote or other Pc
http://10.45.0.38:8050/ParseXml
Another thing is did you check if your system can successfully ping that system?
First off, I know very little about signalR. I'm trying to learn and I'm just messing around mostly.
Running on .NET Core 3.1.
I have 2 machines:
PC1 is my dev desktop with Win10 Pro and IIS which is on our domain.
PC2 is running Ubuntu (Not on the domain) with a Win10 VM which is on the domain.
I've created the Chat app from the Getting Started with SignalR.
If I host this in IIS on PC1 it all works fine. The SignalR connection is established and I can send messages from PC1, PC2 Ubuntu, PC2 Win10 VM, and even my phone. Any device on the network can connect to the hub just fine while there is no authentication in place.
If I add Cookie Authentication loading the site will redirect to the login page, login will be successful, and the user will be redirected back to the main index page.
However, only a machine that is part of the domain can establish a SignalR connection after login. This means PC1 can login and establish a signalR connection and send messages.
PC2 ubuntu can login, but get an Unauthorized error when trying to establish a SignalR connection.
PC2 ubuntu/Win10 VM (Which is on the domain) can login, but get an Unauthorized error when trying to establish a SignalR connection.
Using my phone I get the same Unauthorized error.
If a work colleague, who is part of the domain, loads the site on his machine, he can login and establish a working SignalR connection.
When authentication is active, no device that is NOT part of the domain can establish a working SignalR connection.
Any device that is NOT part of the domain get a Unauthorized 401 error when trying to establish a connection to the Hub after login.
Any device that IS part of the domain can login and establish a working SignalR connection with no errors.
The code seems to work fine. I'm thinking it's an IIS issue. My IIS setup is based on this:
https://damienbod.com/2018/09/21/deploying-an-asp-net-core-application-to-windows-iis/
It all seems to work and run fine as far as the code is concerned, but a device that is NOT part of the domain cannot establish a signalR connection when Authentication is active.
If there is no authentication, ANY device on the network can connect to the hub just fine.
Again, this is just me messing around and trying to learn what I can or cannot, OR, should or should not do. And yes, I did Google this A LOT.
My Startup code:
Login code:
Hub code:
I got it working... posting this in case it might help someone else and spare them many days of getting nowhere :)
It turns out the Windows domain does not play a role. None of the devices/machines on the network can make a signalr connection over the network if I have authorization active in the app. Only the machine where the IIS is running can open the app, login, and make a signalR connection and work as intended.
Yesterday I happen to watch a video about publishing .net core apps to IIS in Win10 and the guy created a new site under IIS instead of creating a new application under the Default Site that comes with the IIS install.
Decided to give this a go and sure enough the app started working when hosted under a new site in IIS.
I don't know if there is a setup issue on the Default Site... I'm the only one that uses this IIS install and I know I didn't change any of the Default Web Site settings. The win10 install is also only about 6 month old.
I want to test with a fresh install of IIS on a Win10 laptop we have here at work to see if the same issue comes up... I doubt it, but might be worth checking anyway.
I am using a 3rd-party tool that runs as a Microsoft Service on a Windows Server 2008 R2 machine. The machine is using a Dell SonicWall firewall. The tool has defined ports that it is listening on of which I have opened one. Using an external web tool that port is listed as open. The service has been installed and shows as running when I run services.msc.
Everything runs great on my local machine. However, when I try to query the service I get a 403 error. The following is what the query URL looks like:
https://{siteUrl}:{portNumber}/scanservice/v2/getstatus?method=jQuery111106758983342442662_1428439579840&_=1428439579841
This is an AJAX GET request coming from an ASP.NET MVC application.
The code attempts to find an open port by querying 3 ports that are the https ports for the service. The first two are ports that I have not opened on the machine. These queries time out which is what I would expect. The last port is the one I have opened on the server. I immediately get a 403 error.
Is there somewhere where I need to expressly allow that service, not just the port?
It is a case where your public IP is not whitelisted on the web service hosting server
i have created a web service using .net (c#).I have a server program and a client program.Which is working fine in my local system.(Even if i run client exe)
But when i have given my client exe to some other system (which are connected through LAN with my system) the service is not getting processed. My web service continuously running(server) on my Machine.
I followed http://sarangasl.blogspot.in/2010/09/create-simple-web-service-in-visual.html link to create server and client(web service).
So now the problem is how can i port my client or how other's can use my webserver?
How to fix this error i tried using Add reference option but i don't know where,what and how to add... where is that assembly?
Or what else i can try?