web reference not working when deployed live - asp.net-mvc

I used a webreference in my mvc project. It is working properly for my project locally but i am getting the following error when i deployed my project in live.
System.Net.Sockets.SocketException:
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 46.xxx.xxx.xxx:80
Please help me solve this.

Related

Azure Hybrid Connection SSPI handshake failed

I have an instance of Azure Hybrid Connections running on a server where SQL Server is installed.
I hosted an WebApp on azure, set up the hybrid connection and I'm consistently getting the same SSPI Handshake error
SSPI handshake failed with error code 0x8009030c, state 14 while establishing a connection with integrated security; the connection has been closed. Reason: AcceptSecurityContext failed. The operating system error code indicates the cause of failure. The logon attempt failed [CLIENT: 1x.xx.xx.xxx]
As described here I added the clients ip in the local security policy.
I also tried adding the DisableLoopbackCheck=1 in HKLM\System\CurrentControlSet\Control\LSA, but it didn't help either.
Do I have to fix it on a database level perhaps?
As per https://github.com/Huachao/azure-content/blob/master/articles/app-service-web/web-sites-hybrid-connection-connect-on-premises-sql-server.md
[AZURE.NOTE] To ensure that your application uses the database that you created in SQL Server Express, and not the one in Visual Studio's default LocalDB, it is important that you complete this step before running your project.
Edit the connectionStrings section to point to the SQL Server database on your local machine, following the syntax in the following example:
I added user credentials to my connection string in appsettings.json and it now works.

Using DevTools features with Selenium Grid on Docker

I managed to work with DevTools features in Selenium 4 locally, but when I tried to use it on Selenium Grid, it didn't work.
In order to investigate it, I installed a local grid with one Chrome node using docker-compose and I got the same error:
OpenQA.Selenium.WebDriverException : Unexpected error creating WebSocket DevTools session.
----> System.Net.WebSockets.WebSocketException : Unable to connect to the remote server
----> System.Net.Http.HttpRequestException : 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. (172.18.0.3:4444)
----> System.Net.Sockets.SocketException : 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.
Where 172.18.0.3 is the private IP of chrome-node container.
I guess that the main reason is that I don't have access to that IP from the host, and that's probably a docker configuration matter, on which I'm not an expert. But that wasn't the only problem.
Using the debugger, I was able to track that the driver tries to use this address due to the following capability that is returned from the driver after creation: "se:cdp": "ws://172.18.0.3:4444/session/2c519f679e1060cdc926ca74e63e222f/se/cdp". I then tweaked this value (in the debugger, before trying to create the connection to the DevTools protocol) to use localhost instead of the private IP, and then I got the following error: IOException: The response ended prematurely..
What do I need to do in order to use the DevTools features of Selenium through Selenium Grid (and docker)?
Adding - SE_NODE_GRID_URL=http://localhost:4444/ environment to the "chrome" container in the docker-compose yaml file solves the problem.
If you want to access the grid from outside of the host, instead of localhost write the IP or name of the machine.

Xamarin and gRPC: connection close by peer

I am trying to do some tries with xamarin android and gRPC.
I have my service running in my computer, and I have a net standard 2.1 library with the gRPC client. If I use this library in a wpf application in the same computer, I get response from server, but if I use this library in my xamarin proyect, that I run in a virtual machine with android 8.0, I get the message error connection closed by peer.
In the xamarion prject, the address that I am using is https://10.0.2.2:5001. I am using the IP 10.0.2.2 because if I am not wrong, it is the IP that is used to communicate with localhost.
How could I solve this problem?
Thanks.
PD: I have set permissions to application to can use internet.
PD: I have realized that if my WPF application I use https://localhost:5001 it works, but if I use https:x.x.x.x:5001 where x.x.x.x is the IP of the computer, it gives the same error.
Xamarin works with native nugets Grpc.Core and Grpc.Core.Api
It wont work with Grpc.Net.Client
Find more on
https://learn.microsoft.com/en-us/aspnet/core/grpc/client?view=aspnetcore-3.1
Calling gRPC over HTTP/2 with Grpc.Net.Client is currently not supported on Xamarin. We are working to improve HTTP/2 support in a future Xamarin release. Grpc.Core and gRPC-Web are viable alternatives that work today.

Error while adding a wcf service refrence in ASP.Net mvc

I get this message error from visual studio when I attempt to add a service reference in visual studio using an url address.
There was an error downloading
'http://serviceendpoint.com/_vti_bin/ListData.svc/$metadata'. Unable
to connect to the remote server No connection could be made because
the target machine actively refused it 127.0.0.1:8888 Metadata
contains a reference that cannot be resolved:
'http://serviceendpoint.com.tn:10200/'. There was no endpoint
listening at http://serviceendpoint.com.tn:10200/ that could accept
the message. This is often caused by an incorrect address or SOAP
action. See InnerException, if present, for more details. Unable to
connect to the remote server No connection could be made because the
target machine actively refused it 127.0.0.1:8888 If the service is
defined in the current solution, try building the solution and adding
the service reference again.
However, this url is accessible from the browser and from another computer using visual studio.
Can you check your host file? Seems like it doesn't contain reference to your localhost

Problem Publishing Silverlight Application LocalHost

I am trying to publish my SilverLight application to the web and I keep getting "An error occurred while trying to make a request to URI "http://localhost:2898....".
I've changed the ServiceReferences.ClientConfig to point to the web address but the app still keeps on trying to connect to localhost.
I've opened the application in FireFox and took a look at the firebug log and it says: -
clientaccesspolicy.xml 404 Not Found localhost:2898
crossdomain.xml 404 Not Found localhost:2898.
The silverlight app is accessing the web service in the same domain, I just don't know why it is still trying to connect to localhost.
Any help appreciated.
Steve
Two things come to mind, but check your "c:\windows\system32\drivers\etc\hosts" file and make sure ure local computer name or ip isnt mapped to localhost or the network machine isnt mapped to localhost for whatever strange reason.
Is the Silverlight app And WCF Service hosted on your localmachine, or are you accessing a server on your local network?
Just open the hosts file (C:\windows\system32\drivers\etc) and uncomment the following line (remove # from the beginning of the line): 127.0.0.1 localhost
Then save it, it should work.

Resources