Error while adding a wcf service refrence in ASP.Net mvc - 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

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.

Cannot access wsdl file from different machine

I am trying to run the running Client & Server Application on different machine but then I am getting below exception message which says it can not get wsdl file on that machine:
javax.xml.ws.WebServiceException: Failed to access the WSDL at:
http://localhost:8080/proj_name/EmpServices?wsdl. It failed with: Got
http://localhost:8080/proj_name/EmpServices?wsdl while opening stream
from same_link_as_above/EmpServices?wsdl.
It looks like connection issue, not WSDL or service-related.
Possible causes and solutions:
You tell about "remote machine", but errors says "localhost".
Have you configured your service client to work with your remote machine?
Shouldn't it be remote machine's address? Or is it just a typo?
If you configured it correctly, make sure that you have a working connection and port 8080 is allowed in your firewalls.
You may also try to open this link directly in your browser from client machine, and see what is says.
Perhaps, you will get connection error message, while you should get WSDL file.

web reference not working when deployed live

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.

Cannot start TFS Build service: Error 1227

When I try to start the TFS 2008 Build service on the port 9191 I get the following error message:
Windows could not start the Visual
Studio Team Foundation Build service
on Local Computer.
Error 1227: The network transport
endpoint already has an address
associated with it.
If I use another port it works, but I need it to be the default, 9191.
I will appreciate any help!
Update:
I have tried by removing every binding to the port 9191 that the following command shows:
netsh http show uracl
To remove the bindings I used the following command:
netsh http delete urlacl url=https://xxxx:9191/Build/v2.0/AgentService.asmx/
Once I removed the bindings, the service was able to start, but the BS web service were not available from the outside, this is because of the removed bindings. I ran the following command to reserve the endpoint again:
wcfhttpconfig.exe reserve Domain\ServiceAccount https://xxxx:9191/Build/v2.0/AgentService.asmx/
But then, the service is unable to start again. The same error message is displayed as before.
The log trace of TFSBuildService contains the following message:
TF224000: The Visual Studio Team Foundation Build service failed to start because another application is already using the address http://xxxx:9191/Build/v2.0/AgentService.asmx.
Exception Message: HTTP could not register URL http://+:9191/Build/v2.0/AgentService.asmx/. Another application has already registered this URL with HTTP.SYS. (type AddressAlreadyInUseException)
It sounds like you already have a build agent defined on that server using the standard port. Each build agent has to have it's own port, otherwise it wouldn't know where to listen.

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