Hosting of ajax enabled wcf service in IIS 7 - wcf

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.

Related

Calling a net.tcp wcf service from Silverlight - in an external facing web site?

I have an external (public) website developed in Silverlight. The Silverlight app currently calls http based wcf services hosted in IIS.
I am now having to call a wcf service with net.tcp binding hosted in a different app server. I have the net.tcp wcf service hosted in a windows service on port range 4502-4530 and with an interface to expose clientaccesspolicy.xml file as part of the service. I am able to invoke this service from my Silverlight app in the web server. I want the SL app to make direct call to net.tcp, rather than routing the call to it from another http based service.
Question is will this work without any issues when exposed over internet.
Client browser --> IIS webserver with Silverlight website --> App Server with wcf service on net.tcp.
I am assuming in this case, from XAP SL would try to make direct call to the app server service using net.tcp ?
The communication between the web server and app server could be opened up for ports 4502-4535. But I am wondering what about the client. Does this setup require the ports to be available even in the clients machine (with browser)?
Any insight is much helpful.
Thanks.
Take a look at http://support.microsoft.com/kb/2425652; there is sample code included as well! If you setup clientaccesspolicy.xml correctly; it should work as long as clients can access your TCP server.
If your clients are behind some firewall which is blocking your server's ports; they may face connectivity issues!

Consuming WCF Restful Service hosted by IIS

I have successfully deployed my WCF restful web service to IIS 7. I have verified that my service is working when I call it from a browser in IE via a something like "https://myserver/mservice.svc/postuser/JohnSmith" . The method is a POST and I have verified that my IIS configuration allows for POSTS.
My issue is as follows. We are using a 3rd party Software as a Service application that allows for external web service calls. It allows you to configure the URL "https://myserver/mservice.svc/postuser/" and then you can choose a parameter. When I call the web service from the external application, a 404 error is registered in IIS.
I think there must be some difference between the way I call my webservice "https://myserver/mservice.svc/postuser/JohnSmith" and the way the SAAS application is calling my external web service. The web service is attempting to pass the username, but I cannot detect how it is constructing this.
Do I need to write a web enabled front end for my web service that is hosted in IIS that can handle XML? I'm assuming this is how the SAAS application is trying to pass the username onto my web service.
Thank you all in advance for your ideas and help.

got EndpointNotFoundException when consuming WCFService in A webrole from B webrole

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.

WCF http activation without IIS

Is it possible to enable HTTP components for WCF without installing IIS. When i try to enable the HTTP components on windows server 2008 it forces me to enable the web server components.
Is there a workaround by not installing webserver.
(any solution other than self hosting or windows service)
thanks
Ben
WCF services can be hosted in any managed .NET application, not only IIS. You can either host it inside a windows service, or create a standard .NET executable to host the service (self-hosting). You can configure your end point to http eventhough the WCF is hosted outside IIS.
Check this article for more insight:
Hosting and Consuming WCF Services

Can I host a wcf 4.0 website in IIS instead of as an application in IIS?

Most examples I see about hosting WCF in IIS have you create an Application under an existing website. I have a website in IIS, but the website uses a .NET 2.0 app pool, so I can't host the service as an application under the website. Is it better to create an empty website to just host the service or to create an empty website and then create an application under that empty website to host the service?
I have WCF running as a WebSite in both IIS6 and IIS7, and they work fine. They basically work exactly the same as any ASP.NET site; the .svc files are conceptually similar to .aspx pages, in that IIS calls over to .NET to process them, and all the core WCF stuff is in the assemblies in \bin. The web site is assigned to an App Pool where the actual processes run, just like a normal ASP.NET site. I don't think you need to make an 'Application' in IIS.
You don't need a new website - you can still host WCF in a 2.0 application pool - but in your project you'll need to set the target framework version to 3.5, instead of 4.0.