Cannot access wcf service hosted on iis from php with soapclient - c#

This has been really painful for the last few hours and I just have no more ideas what to do.
Tried many solutions that I found on here without any luck...
I have an iis server that is hosting a wcf web service. Simple stuff.
I can connect to this (example: http://mydomain.com/Service.svc?wsdl) from the iis server and all other computers without any problems.
So I went on to make a php client on my computer - (using xampp via localhost) - (not on the iis server)
$wcfClient = new SoapClient('http://mydomain.com/Service.svc?wsdl');
$args = //input data
$response = $wcfClient->GetData($args);
print_r($response->GetDataResult->Post);
This works perfect. No problems at all. It returns all the data... Then I went on to upload this to my hosting account. This is the error I keep getting.
Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from ....
I have no more ideas. Disabled firewall, changed web.config a million times and still no luck. I tried the file_get_contents method to see what's up. I keep getting:
failed to open stream: Connection refused

I just fixed this by changing the port to 80 on the iis server...

Related

(502) Bad Gateway PhantomJS driver initialize

I'm using Selenium.WebDriver 3.8.0 in .NET Core app and trying to initialize PhantomJS driver like this:
PhantomJSDriverService driverService = PhantomJSDriverService.CreateDefaultService("<path to PhantomJS binary file>", "phantomjs");
PhantomJSOptions options = new PhantomJSOptions();
driverService.Proxy = "{my proxy address}:{port}";
driverService.ProxyType = "http";
IWebDriver driver = new PhantomJSDriver(driverService, options);
When I run on CentOS:
[INFO - 2018-01-15T13:28:48.526Z] GhostDriver - Main - running on port 46847
The remote server returned an error: (502) Bad Gateway.
The remote server returned an error: (502) Bad Gateway. ... The remote server returned an error: (502) Bad Gateway.
If I use the default constructor:IWebDriver driver = new PhantomJSDriver();, the same error occurs.
In CentOS system proxy is configured in /etc/profile like this:
MY_PROXY_URL="{my proxy address}:{port}"
HTTP_PROXY=$MY_PROXY_URL
HTTPS_PROXY=$MY_PROXY_URL
FTP_PROXY=$MY_PROXY_URL
http_proxy=$MY_PROXY_URL
https_proxy=$MY_PROXY_URL
ftp_proxy=$MY_PROXY_URL
export HTTP_PROXY HTTPS_PROXY FTP_PROXY http_proxy https_proxy ftp_proxy
What could be the problem? I learned all the queries in Google about Selenium, PhantomJS and CentOS
Cause of 502 Bad Gateway Errors
Bad Gateway errors are often caused by issues between online servers that you have no control over.
Source
There is probably some issue on the server end, so as you see, there is probably nothing you can do unless the server is yours. I doesn't have to do with your constructor.
However, sometimes, there is no real issue but your browser thinks there is one thanks to an issue with your browser, a problem with your home networking equipment, or some other in-your-control reason.
Source
On the other hand, it might be an issue with your configuration. There are some things you can do and try to fix it here: Fix 502 Bad Gateway Error, they might help you out if it's really a problem on your end.

Visual Studio '15 Web Deploy continuously failing

I'm trying to deploy an ASP.NET MVC 5 application to a shared hosting account (SmarterASP). It was working perfectly fine but recently it mysteriously stopped working for no reason. I tried contacting support, spent 2 days talking to them and they say "it's working fine for us, something's wrong at your end". I'm not sure whether it's my end. The task always fails with this:
3>Start Web Deploy Publish the Application/package to *url removed* ...
3>C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Web\Microsoft.Web.Publishing.targets(4295,5): Error : Web deployment task failed. ((12-Nov-16 3:07:55 PM) An error occurred when the request was processed on the remote computer.)
3>
3>(12-Nov-16 3:07:55 PM) An error occurred when the request was processed on the remote computer.
3>The server experienced an issue processing the request. Contact the server administrator for more information.
3>Publish failed to deploy.
Nothing else at all. No further error messages. Is there any I could get a detailed error message what EXACTLY is causing the process to fail? I'm already considering to move to a VPS if the issue persists.

intermittent "unable to connect to remote server" error

I'm running a windows service which downloads RSS feeds using the following code:
XmlReaderSettings settings = new XmlReaderSettings() { DtdProcessing = DtdProcessing.Ignore };
string feedXml = XDocument.Load(XmlReader.Create(url, settings));
The service doesn't run under IIS but as an independent service.
All of the sudden (I suspect an infrastructural problem) we started receiving "unable to connect to remote server" every 10-20 minutes.
The code itself hasn't changed and I'm looking for possible causes.
In an attempt to solve this, I moved the service to a different machine but the problem persisted.
Would love to get any ideas. Thanks!
The reason for this was that the exact same service was installed in a different machine in the same environment, causing two different IPs to connect to the RSS feeds. Depending on the intervals, sometimes it was OK, sometimes it was blocked by the RSS provider.

Web Reference Help: No connection could be made because the target machine actively refused it

Ok, so I'm learning about ASP.NET by making a simple program to read in a user's gmail credentials and construct an email from their input into the Console, but I'm getting a new error that I was not get yesterday, and I have not changed ANY code. The error is on line 41, so I have provided that (the rest of the code is just reading input into Strings) I have disabled my firewall to no avail, and have also tried "http://localhost/Service.asmx", which doesn't work either. I've also tried restarting IIS.
I'm completely new to this subject, but the error suggests, to me, that the program is communicating with the server but is being denied by a blocked port, but I have disabled my firewall and the error persists. Any ideas? Thanks in advance!
/*40*/ Communication_Service.Service CommServiceProxy = new Communication_Service.Service();
/*41*/ Result = CommServiceProxy.SendMail(GmailAccount, Password, To, Subject, Body);
There was an error dowloading http://localhost:4932/Service.asmx. Unable to connect to the remove server. No connection could be made because the target machine actively refused it 127.0.0.1:4492
Sounds like you are running cassini (development server). The application at http://localhost:4932/ needs to be started. You probably have multiple sites and need multiple start up projects. Right click your solution and click set start up project, pick multiple, and select all your websites. On VS goto debug, run without debugging and they should all start.

Visual Studio 2010 - web deploy times out - what to do?

My MVC2 web project is deployed using the VS 2010 "web deploy" feature. It used to run fine but now it is timing out more often than not with this error message:
Web deployment task failed.((10/11/2010 1:01:59 a.m.) An error occurred
when the request was processed on the remote computer.)
(10/11/2010 1:01:59 a.m.) An error occurred when the request was processed on the remote
computer. The remote host closed the connection. The error code is 0x800704CD.
Searching for the error code 0x800704CD does not return anything helpful.
Is there a way to increase the timeout period, or should I be looking for an alternative method and forgetting about web deploy?
I haven't answered the timeout problem (could not see any problems on the server log). But I did find a workaround:
Physically copy the webdeploy.zip file to the web server.
In IIS select the website, right click and choose "Deploy - Import Application ..."
Select the zip file copied in #1
Forget the error message. That error message is the local one. You are not interested in this - the reason it fails is that the remote host closed the connection. What you want is to see the server side logs for the server side error message. Could be a timeout, but the server side should have more information. Start with the IIS logs and event logs.

Categories