简体   繁体   中英

consuming wcf on mvc project fails after published

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 ?

PS: 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM