WCF error 'Unable to connect to the remote server' - wcf

We have a website hosted in IIS have a wcf service with below settings
WCF(folder) is set as an application at IIS
WCF's svc file can be browsed
Our service is connecting used to connect and retrive a file. We pass argument in return we get a file.
Issue
this service works with proxy in an web isolated environment
fails in Web enabled environment
Error displayed
The server encountered an error processing the request. The exception message is 'Unable to connect to the remote server'. See server logs for more details.

Related

I don't get data from remote service

I have a service, hosted in a windows service. When I installed the windows service in the local machine, I can get data from the service, but when I installed the windows service in the remote computer (in the server), I don't get data.
I have tried in a internet browser to use the address of the endpoint in the server, and I get response, so I get the page that says how to use svcutil to create the proxy.
Although I get this page, I have tried to disabled the firewall in the server and in the client, but the problem persists, how I expected.
If I get response in the internet browser, wouldn't I get access to the methods of the service?
On server side add trace listener so as to find out what error occures. Do you make use of any certification which service may not possess?

after deployment picture download from wcf service doesn't work how to find out what is wrong?

WCF service is used to retrieve data and pictures. WCF service work well on localhost, and on web-hosting of provider. But the same service after deploying to server within local network doesn't allow to retrieve pictures, however data comes successfully.
So:
WCF service data downloading:
localhost (ok)
web-hosting (winhost.com) (ok)
remote server within local network (ok)
WCF service picture downloading (binary array of bytes):
localhost (ok)
web-hosting (winhost.com) (ok)
remote server within local network (NO!!!!)
so it's strange because the same service perfectly works on web-hosting of winhost.com provider but refuses to give pictures on local server!
What could be problem?
I don't know should I do some configuration of server 2008?
At last I have to debug WCF service on remote server, but how to?
Answer:
1)If you have several references for services don't forget to put for all of them the constraints; in configuration of app.config maxReceivedMessageSize.
2)To debug service simply add some more details in reponse from wcf service
A console client takes about 2 mins to write and you can set it up to be sure it outputs the exception being sent from the service. The winform application would be just as good if you are in a position to set up those checks. The point being, be sure the service throws exception info back to the client

consuming WCF method via web service getting error only in IIS not in IDE

I have added http://ws.hipcricket.com/api/EndUser.svc as a service reference in a my web service. I am able to consume the methods from the IDE but while hosting the same in IIS I'm getting the following errors:
Error 1:
Could not connect to the (please refer the above url). TCP error code 10060: 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 69.20.116.221:80.
Error 2:
There was no endpoint listening at (please refer the above url) that could accept the message. This is often caused by an incorrect address or SOAP action. See Inner Exception, if present, for more details
Maybe you have a firewall blocking communication from your webserver? When developing on your local machine communications through the proxy may most likely be using your credentials, while the user that the application pool that your application is running under on your IIS server most probably does not have the correct rights.

Resource not found error when accessing wcf svc file from remote machine

I hosted a simple wcf service in IIS and I am able to access it from the IIS server machine without any issues. But, when I access it from any other machine I get the error:
"Server Error in '/' Application.The resource cannot be found." I put an aspx file in the same location as that of the svc file and is accessible from all the machines; to rule out the connectivity problems. Please throw your thoughts on this.
It can be deployment or configuration issue. It can related to MIME type.
So plese re check your deployement process.
Refer the below links:
Host WCF Service on IIS 7 & Windows Server 2008
Setting up a netTcpBinding enabled WCF Service in IIS 7

Client unable to authenticate when connecting to WCF service

I have a WCF service hosted in a Windows service. The application is an intranet app, and I have programmatically set the bindings on both the service and the client as:
NetTcpBinding aBinding = new NetTcpBinding(SecurityMode.Transport);
aBinding.Security.Transport.ClientCredentialType = TcpClientCredentialType.Windows;
aBinding.Security.Transport.ProtectionLevel = System.Net.Security.ProtectionLevel.EncryptAndSign;
Both the service and client have endpoints configured with SPNs:
EndpointAddress = new EndpointAddress(uri, EndpointIdentity.CreateSpnIdentity("Service1"));
As far as I know, I have setup the bindings correctly-- and I am usually able to connect to the service just fine. I did however run into a case where on a server running Windows Server 2003 R2, x64, SP2 I get the following exception immediately when the client tries to connect:
INNEREXCEPTION -- Exception Message:
InvalidCredentialException: Either the target name is incorrect or the server has rejected the client credentials.
Stack Trace:
at System.Net.Security.NegoState.ProcessAuthentication(LazyAsyncResult lazyResult)
at System.Net.Security.NegotiateStream.AuthenticateAsClient(NetworkCredential credential, String targetName, ProtectionLevel requiredProtectionLevel, TokenImpersonationLevel allowedImpersonationLevel)
at System.ServiceModel.Channels.WindowsStreamSecurityUpgradeProvider.WindowsStreamSecurityUpgradeInitiator.OnInitiateUpgrade(Stream stream, SecurityMessageProperty& remoteSecurity)
I get the exception when I try to connect to the service from another machine in the domain, but if I connect to the service on the same machine running the service it works fine.
The hosting service itself is running as a domain user account-- but I have tried running the service as a Local System and Network Service to no avail. I have checked the Local Security Policies for the server and didn't see anything amiss (i.e. 'Access this computer from the network' includes 'Everyone').
Anyone have an idea of what could resolve this?
I am wondering if I need to do something in Active Directory with respect to the service's SPN? I have read some about using setspn.exe to register or refresh SPNs, but I haven't needed to do this before. Why would this be working with other configurations but not the one above?
Try and run the service as an account that has local administrator access - if you can't run the service with this much permisison, then I belive you'll need to use setspn.exe as you have alluded to.