Web service call from another ws blocked by firewall - c#

My problem is the following:
I got a Web Service running on localhost. When I call it it should connect to another third party web service. But I get a 'Unable to connect to the remote server error'.
When I call the third party web service from a console application, or from a computer that is not from my organization, I can reach it, but not from a running web service, either IIS or IIS Express. If I use another network I can't reach it too (Smartphone).
I suppose that is a a rule in the firewall for the port or something like that but I tried to open the port in both directions but still can't do nothing.
I use HttpWebRequest class to call the other web service.
Thanks in advance.

Related

Accessing a WCF Data Service on a local machine using the computer name with SSL

I have an application containing a WCF Data Service using SSL. I have a domain level certificate and a localhost certificate. I am using Local IIS to host the data service. I can access the WCF Service on my computer from another computer using
https://mycomputer.mydomain.com/MYDataService/ServiceName.svc
When I try that on my computer, it says it can't establish a secure connection. From my computer, I can use
https://localhost/MYDataService/ServiceName.svc
and it works. This is fine most of the time, but I have a windows forms application that I use for testing and some maintenance tasks. It is part of the solution containing the web service. To configure the web service, I use the Add Service Reference function and use the Discover feature. It configures the service fine as connecting to localhost. When I run the program, I get the following error:
Could not establish trust relationship for the SSL/TLS secure channel with authority 'mycomputer.mydomain.com'.
I have looked at the Configure Service Reference settings and it says localhost, but according to the error, the client is somehow trying to connect to the actual computer name. Has anyone run into this before?

.Net web api self hosting

I developed a console application that is stored as a web service.
In this console, I host a self-hosted web app service. Also, I open a thread that opens a web socket with another program (HTTP, port 443).... Now, when I initialize the web service, I can reach the self-hosted service, and the web socket works well. Now after 2-3 hours the web socket is closed and this is the exception that i get:
"An established connection was aborted by the software in your host
machine".
Also, I get the following error:
"Exception: Error message: Socket not connected"
..
Has anyone an idea for this?
Have you tried turning your firewall off just to make sure? Also make sure that HttpWebRequest.KeepAlive is turned on

remote client intermitency with wcf service hosted in iis

I have developed a WCF service and hosted in IIS, I need that this service can be consumed by web applications and for one desktop application, but this desktop application was made in .net 2.0, so i add an asmx extension in order to can add the web reference to the desktop app. When I run the app in the same machine that is hosting the WCF service, it works fine, so I installed the system in one client for beta testing. When the client run in the server all requests made to the web services works fine, but this client has 2 remote stations, which have to consume as well the WCF service, now this is the issue, some times the request is not arriving to the WCF, I already added exceptions to the antivirus and firewall, so there is nothing blocking the communication between the server and the client stations.
I'm wondering if all the problem is because an incompatibility issue between the asmx extension and WCF service, but I don't find any after hours googling.
I appreciate any advice about this, the client is a beta, but is pressing hard to get a solucion ASAP.

WCF Service Hosted in Windows Service over net tcp

In my project I have one WCF Service which is hosted in a Windows Service. I hosted the WCF Service in Windows Service over netTCPBinding and Installed Windows Service. To access WCF service in my silverlight project I have added service reference of wcf.
But, when I am calling a method in WCF Service am getting the following error :
Could not connect to
net.tcp://localhost:8732/WCFHost/.
The connection attempt lasted for a time
span of 00:00:03.2951885.
TCP error code 10013: An attempt was made to
access a socket in a way forbidden by
its access permissions..
This could be
due to attempting to access a service
in a cross-domain way while the
service is not configured for
cross-domain access. You may need to
contact the owner of the service to
expose a sockets cross-domain policy
over HTTP and host the service in the
allowed sockets port range 4502-4534.
Please help me out.
For same-machine connections rather make use of Named Pipe bindings.
It might help if you showed us your service and client side endpoint configurations.
EDIT: After reading up a bit on the error you're getting (here among other sites), try changing the port number from 8732 to something between 4502-4534 as the error message suggests.
Keep same protocols at both the server and client end. May be your are calling the service with different protocols. Also check if your are using nettcp, your are having access to the machine where service is hosted.
use basicHttpBinding instead of netTCPBinding

how to access webservice deployed in remote server

Please help me , how to add web service which is deployed in remote server. externally i unable to access that service..in that remote server only that service will run but we don't have Ms.net Environment to add service to my application in that server.
So please guide me how to add that web service to my application ,not accessig externally that service URl, internally Executing that URl.
How can i add that service to my application on my developer PC ?
To add a web reference you need to have access to the WSDL file.
You need to do this in 2 steps:
First add a web reference to your project based on the WSDL
Then change the URL of the web reference to match the address of the external service
You can move service URL to web config please refer here.
http://forums.asp.net/p/1268077/2388602.aspx
But if your IP address changes too often (Dynamic IP) I think better your remote network configuration should be changed to have some sort of redirection to your Dynamic IP via a Static IP in your outside network so you can give that Static IP as service URL.
So you don't have to change the web config even too often.
Anyway you Should get advice from a network administrator.

Categories