Method not found - While hosting in IIS - c#

I have an application (API and the web app runs on the same port number). Which works perfectly when I host it in my iis. But when I do the same on the client machine it says
"POST XHR
http://localhost:12345/api/Login/InsertUser [HTTP/1.1 404 Not Found 3ms]".
When I open the url "http://localhost:12345/api/Login/InsertUser" in my local machine it opens without any errors. But if i do the same on the client machine it throws an error that the method name is changed or not found.
I have done the web app using angular js and API is written in C# and Back End using SQL Server.
Do I need to enable any thing on IIS . I tried adding the MIME Type Json in the IIS. Still it did not work. Can anyone help me out with this issue. Thanks

Related

c#.net Restful API Works on debug/release but not on IIS

I have am creating a restful API application in c#.net. When I compile my application in debug or release mode through iisexpress. It works as expected. I can use fiddler and pass the corresponding arguments in the "GET" like the user credentials and it will connect and get a respond of 200 (http://localhost:49917/v2/Carriers). When I publish my application and deploy it in IIS (http://api.test1.net/v2/Carriers). IIS is install the same computer where I compile my application. Then, I use fiddler and pass the argument necessary I get a respond of 503. I am not sure why is not working. My application pools is the following setting:
.Net CLR Version: v4.0
Managed Pipeline Mode: Integrated
Identity: LocalService (I have tried also ApplicationPoolIdentity)
When I publish my application I use the following publish method: "File System".
I have added the IP Address and the host name in the Host file (windows/system32/drivers/etc/). I am not sure why is not working.
What makes visual studio different in debug/release mode to work as expected from publish version?
I wanted to let you guys know that I did what you guys recommended and I figure the answer. I need to add a new user in the SQL Server Database.
"Accessing Database under IIS APPPOOL\ASP.NET v4.0
As we are using ASP.NET v4.0 App Pool make sure IIS APPPOOL\ASP.NET v4.0 is added to your Database Server -> Security -> Logins."
After I added this new user "IIS APPPOOL\api.test1.net" the api get request with fiddler works as expected with a 200 respond. "api.test1.net" is the name of my application pool in IIS.
Thank you for all your recommendation.

WCF and MySQL Connector

I created a WCF service. It uses MySQL Connector to connect to a MySQL Database. The consumer of the service is a Windows Phone app.
On my computer everything works great. But if I publish the WCF Service (on the web or on localhost), and try to use it from the phone application, it generates an error
"The server was unable to process the request due to an internal
error."
By testing I found out that the error comes at the line connection = new MySqlConnection(ConnectionString); On my laptop everything worked (when I debugged the project), I tested my WCF Service and it perfectly accessed the database and did everything well. Again, when I publish at localhost or on web, accessing the service causes an error.
I published the log file here.
What is wrong? What can cause this problem?
Finally, I found what was the problem.
This question helped a lot. It turned out that the problem was with MySql.Data.dll. It must be copied locally (by default that property is set to false). Without that, the program doesn't find the library and throws an exception. So I needed to change the setting to 'Copy To Local = true'

IIS Localhost Asp Net MVC application trows Erro 101 (net::ERR_CONNECTION_RESET)

I am no longer able to connect to my Asp NET mvc 4 application running on IIS7.5
I have made no change at all and after a computer restart I am getting:
Erro 101 (net::ERR_CONNECTION_RESET)
I am trying to access it from localhost. The application still been developed so I don´t understand why it is happening.
Following instructions I have already done:
Checked IIS services
Re-configured IIS for this application
Flushed DNS
Disabled Windows Firewall
Is there somenthing else I should look at???
Thanks
Found the solution.
For some reason I have might removed the localhost certificate used in the application.
I created a new self-signed certificate, and added it to IIS. Last step was to add this certificate in the application SSL configuration.
That´s all!

IIS / MVC application redirecting all outbound WebRequest(s) to localhost (127.0.0.1)

Built a simple MVC3 web app to ping a few of our servers for small bits of JSON data and report in a quick UI as a monitoring solution, deployed on Windows 2008 to IIS 7.
All of the outbound HTTP requests via the WebRequest class end up in a error: System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:25946
Code works fine when running on a console app on the same server, or as console or web app running on a dev machine. Its only when running as a web app in IIS on the production server that this error happens.
The web app can connect to SQL server and MongoDB but fails at any plain HTTP request. Using an empty WebProxy set to localhost. (with the period) changes the reported error to a 404.
Try looking at the Host (or LMHost) files and make sure that there are no issues wit them.

Can i consume WCF service inside windows mobile 6 project?

Can i consume WCF service inside windows mobile 6 project??
I spend many days to solve my problem of adding web reference of WCF to smartdevice project
but the smae error appears.
There was an error downloading 'http://localhost:8731/Design_Time_Addresses/WcfServiceLibrary1/Service1/mex'.
Unable to connect to the remote server
No connection could be made because the target machine actively refused it 127.0.0.1:8731
There was an error downloading 'http://localhost:8731/Desi
So i ask is it possible to consume WCF from windows mobile 6 project??
I create WCF and windows mobile projects in visual studio 2008 and when i "add web reference" to the mobile project to add the WCF and put the URL i get this error
"There was an error downloading 'http://localhost:8731/Design_Time_Addresses/WcfServiceLibrary1/Service1/mex'.
Unable to connect to the remote server
No connection could be made because the target machine actively refused it 127.0.0.1:8731
There was an error downloading 'http://localhost:8731/Desi"
however i change the "localhost" to my computer IP address the same error appeared.
How can i write the URL that will be put in the client application.
The important part of the error is "Unable to connect"
This means that the add service reference has tried to make a call to the service, but the call failed.
The most likely reasons for this are:
The service is not running
The metadata exchange (mex endpoint) is not enabled
It looks like you're trying to get the Mex, but the service isn't running on the dev machine:
Try going to this url in your browser
http://localhost:8731/Design_Time_Addresses/WcfServiceLibrary1/Service1/mex
you'll probably get the same error (machine actively refused it)
Make sure the service is started.

Categories

Resources