got EndpointNotFoundException when consuming WCFService in A webrole from B webrole - wcf

I have a webrole for hosting a web application, and another webrole for hosting a WCF service. Now I have got my WCF service webrole published on windows Azure, but the webrole with web application is not since I am still developing it. Then when I try to consuming the WCF service which has published on cloud in the web application, it gives the error:EndpointNotFoundException, the inner exception is remote server is not found.
But actually, I can comsuming the WCF service in a web application which is not a Azure project. so is it because web application in one webrole can't consume WCF service in another webrole?

It should be able to as long as they both aren't in Azure. At that point you will need an InternalEndpoint instead for them to communicate through. Did you add it as a web reference in Visual Studio and that worked correctly? Can you browse to the WCF service from the browser and see it? My guess would be that it has the wrong port, maybe you just manually updated the reference after publishing it to Azure.

Related

WCF on cloud is not working

I just created a WCF service and deployed in one of the machine's IIS and checked it works fine.
When I deploy the same service on Cloud VM's IIS I am not able to consume that service.
I am getting the error saying that "There is no listener with the endpoint".
Can i deploy normal WCF on cloud or do i need to create WCF cloud service?
Environment(IIS 8.5)
It could be several Things, most probably:
ASP.net not activated on IIS
Also check:
The url you are using
firewall problems
site not started

Hosting of ajax enabled wcf service in IIS 7

I have deployed an asp.net mvc application in IIS, The application has been deployed successfully and working fine. I Used ajax enabled wcf service in my application, the problem is when I want to use the method of the service. I get the not found error, but when I browse to see the service it gives the page saying that your service is hosted, I cannot access the methods of the deployed ajax enabled service.. Kindly help me out..
Things to be noticed..
My services are hosted as a file with the extension of .svc
I deployed the application on windows server 2008 r2 64 bit, but I configured the application pool to work in 32 bit.
Services are accessible, but the methods of service are not allowed.
Thanks in advance.
Ahsan Nomani.

Questions about adding a WCF service to a Windows service assembly

I have found some basic information about hosting a WCF service in a Windows service, but not much. All of my experience thus far with WCF has been in Web projects. I have a few simple questions.
I have a project which creates a windows service application. I have done a right click -> add WCF Service. This creates Service1.cs and IService1.cs.
I'm wondering why no SVC file is created in this scenario? When I add services to Web projects i get an SVC file which I can navigate to and use to consume the service.
Adding the service adds some configurations to the app.config under the services element. I'm seeing a default base address of
http://localhost:8732/Design_Time_Addresses/WindowsServiceName.services/WCFServiceName/
What does this mean? It's sort of an odd looking address. Am I supposed to change it to whatever I want?
Navigating to this address in a browser results in an unable to connect message. Does the windows service itself have to be running to talk to the WCF service?
How do I go about consuming this service from another application without an svc file?
I'm taking a guess on this first one, but I'm thinking the .svc file when hosting in IIS is to tell IIS, "Hey I have a WCF service here, please handle accordingly".
The base address is as it should be and yes you can change it if I'm not mistaken.
You can't hit the WCF service unless the Windows service is running, which is one of the dangers of hosting in a Windows service, because if the service dies somehow your WCF service is offline until you get the Windows service running again.
You consume the service the same way you do any other WCF service, just using that base address to get at it.

WCF REST on windows service

I have hosted WCF REST service on windows service on my machine. I can access the service from my system but not able to do the same from some other system in network. I tried hosting it on internet and got the same problem. Any possible cause of the problem ?

How to start/stop windows service from a remote machine through WCF service?

I have created a WCF service which is deployed on my local machine. This service exposes one method which start/stop a windows service on my local machine.
On the remote machine I have created a client that consumes the WCF service. When I try to invoke the method which start/stop service exposed from a WCF service , I get InvalidOperationException . I found that this is the Security issue.
Also when I do the same operation (start/stop windows service) on the local machine it works!!
The WCF service is hosted on IIS 7.0 which is using basichttpBinding. Also Anonnymous access is checked. I have also added <identity Impersonate = true > under the web section in the web config file but still no success.
Please help!!
You set impersonation for ASP.NET. Impersonation in WCF uses its own infrastructure. Moreover in WCF client has to allow service to impersonate his identity. Check this simple example.