Remote Machine Debugging in Visual Studio 2012 with Metro and WCF - wcf

I'm trying to debug my Metro application on a tablet from my desktop, however when it boots up and tries to get data from my wcf service i get this error:
An exception of type 'System.ServiceModel.EndpointNotFoundException' occurred in mscorlib.dll but was not handled in user code
Additional information: There was no endpoint listening at http://localhost:39855/MyService.svc that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.
I'd assume that this is because the service is hosted on my desktop in iis express, and the tablet app is trying to look for the service at localhost which wouldn't be where the service is hosted, it would have to be the ip of my desktop or something. But how would i change my service in Visual studio to be hosted at my ip instead of localhost? I have disabled both firewalls so there should be nothing causing problems in that regard.
My experience with WCF is pretty limited :(
Or do i have to set up IIS, deploy my service on my local machine, and point the tablet to that address?

Hosting the service in iis express should be fine, but you have to modify the client (the tablet app) to point to your host machine explicitly (using the IP or the network host name of the machine). You can do that either by modifying the configuration file for the app or by creating the client binding in code, specifying the host.

Related

can not access iis hosted wcf from remote machine

I have hosted a wcf on IIS when I write its url to the same machine's browser it works but when I try to access it from a remote machine or mobile on the same LAN I get this message :
500 - Internal server error
how can I solve this problem?!
any ideas!
The best way to determine the root cause may be to enable WCF Tracing on both the client application and host service. Oftentimes, the WCF Trace log will reveal issues that were previously “hidden”.
http://msdn.microsoft.com/en-us/library/ms733025(v=vs.110).aspx

How can I Publish my WCF Service?

I want to use my webservice on internet. I opened my port which is 4501 an I disabled firewall on modem and on windows. I can write my global ip and I can open modem control inteface. But I want to connect to iis which address is xx.xx.xx.xx:4501/Products.svc
It works on localhost (http://localhost:4501/Product.svc) But I cant connect to svc on internet ..
I dont know where is problem.
When I add my svc link addres as adding reference service I got this error
There was an error downloading 'http://xx.xx.xx.xx:4501/Products.svc'.
Unable to connect to the remote server
Hedef makine etkin olarak reddettiğinden bağlantı kurulamadı xx.xx.xx.xx:4501
Metadata contains a reference that cannot be resolved: 'http://xx.xx.xx.xx:4501/Products.svc'.
There was no endpoint listening at http://xx.xx.xx.xx:4501/Products.svc that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.
Unable to connect to the remote server
Hedef makine etkin olarak reddettiğinden bağlantı kurulamadı xx.xx.xx.xx:4501
If the service is defined in the current solution, try building the solution and adding the service reference again.
And One point more,
If I start to IIS, wcf service doesnt work even in localhost. If I start it in Visual Studio (I mean asp.net development service works) it works..
IIS version is 7.5.7600 and I added application pool as Asp.net 4.0
Is there any specific reason you use port 4501 for HTTP in IIS?
Visual Studio 2010 WebDev WebServer (Cassini) uses random port number (4501 in your case) to simplify configuration. It assumes that port 80 can be occupied by its big brother IIS or any other software.
That is fine for development in local machine but there is no need to use the same port in production.
Default HTTP port is 80 and it is usually the most open open port in networks.
Use port 80 for HTTP traffic in IIS and your life will be much easier.
P.S. Did you try http://xx.xx.xx.xx/Products.svc? Port number is part of web service configuration and it is not copied when you move app to IIS. It is possible that IIS already uses default HTTP port.

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

Unable to host a Service Bus WCF Host in IIS on Azure

I have worker roles that send out multicast messages using the azure service bus. Two of the consumers of these messages are websites hosted on Azure. I know that there are issues hosting service bus WCF endpoints in IIS even when running on premise. I've followed the Microsoft's advice and configured a service host programmatically.
One of the websites has been using this technique successfully for quite a while. It uses the hosted web core (it was developed before full IIS was an option on Azure) and it initialises the service host as part of the RoleEntryPoint.OnRun(). I'm trying to move this site to using full IIS. Because in full IIS the RoleEntryPoint runs in a different process to the site itself and the service host needs access to some static variables in the site I've moved the initialisation of the service host to the Global.asax Application_OnStart. This code works fine when running as a website under IIS locally and it runs fine when running in the compute emulator, but once I deploy it to the cloud my WCF host never seems to receive any messages. I haven't been able to catch any errors that are occurring.
Has anyone else out there successfully deployed something like this?

WFC SVC File emits HTML when called from a service client

I'm in the process of deploying a WCF service application. The service works fine if it's running as its own site, but the intention is for the service to run as a virtual directory of the Default web site of the server. When I set the service up in this configuration, I get an odd problem. When the client tries to make a service call, it receives the HTML of the friendly service description, not SOAP. Naturally this generates a service error. The HTML appears to be identical to the service page that you see in a browser with an HTTP Get, but I'm only seeing the first 1024 bytes in the error message, so I may be missing something.
I've checked HttpHandlers and loaded assemblies, and as far as I can tell there's nothing unusual that is being inherited by the virtual directory. The default site has 3 ISAPI Filters installed including Outlook Web Access (yes, this server is running Exchange). I tried installing these filters in my test web site, but it still ran the service without problems. The problem only happens with the service is running as a virtual directory of another virtual directory within the default web site.
The server is Windows Small Bus Server 2003 SP 2 running IIS6.
If you're hosting WCF in IIS you need to set the server up in the 'Application Role' check out the following link does that help:
MSDN: Internet Information Service Hosting Instructions