I would like to create a web site in IIS that hosts a WCF service using net.tcp binding. Since there is no need for the http binding, I would like to remove this. However, if I remove the http binding (and leave only the net.tcp binding) from the IIS manager, the site appears with a red X on top of it, and there are no longer an option to Start/Stop the site in the context menu.
If I try using the PowerShell cmdlets Start-Website or Stop-website I get the error message: "The object identifier does not represent a valid object. (Exception from HRESULT: 0x800710D8)".
Is it not possible to have a site with only a net.tcp binding in IIS? Do I really need to reserve a port for http, even though it won't be used, or is there some configuration option I am missing here?
Related
I'm trying to self host two WCF services with the following url conventions:
https://service.servicehost.com/service
https://service-branch.servicehost.com/service
And I get this error:
Service cannot be started.
System.ServiceModel.AddressAlreadyInUseException: HTTP could not
register URL https://+:443/service/. Another application has already
registered this URL with HTTP.SYS. --->
I understand the error and I know how to work it around by changing the service's suffix, but it seems like the WCF self host doesn't support the host header feature like IIS does (since I see the + sign).
Is there any way I can make it happen?
I'm not sure this can be done for SelfHost/Http. With Net.Tcp you would have had to use PortSharing to make this happen.
Worst case you could potentially create a Routing Service that routes your requests to the correct service, where each is listening on a different port.
Also, take a look at the documentation for HostNameComparisonMode Enumeration. The docs for basicHttpBinding will show you how to use it.
In our production environment (Windows Server 2008 R2) we have a handful of WCF web services hosted as individual IIS 7.5 websites. Each website has two bindings; an HTTP and a net.tcp. The HTTP bindings are never used to call the service, this is only being done via the net.tcp binding.
Now when I'm about to create a handful of new websites for additional web services, I thought it would be convenient to only add a net.tcp binding, since that's the only one we're actually going to use.
So now I have created a new empty website with only a net.tcp binding. In IIS Manager's leftside pane, in the 'Sites' listing, the website's globe icon has a red circle with a white cross on it. If I add an HTTP binding to it, the icon turns into a question mark instead, indicating it has multiple protocols. With only the net.tcp binding set up, I am unable to access the website's 'Advanced Settings' button from the rightside pane. But when it has a HTTP binding, the 'Advanced Settings' button is there. I need this in order to access the property "Enabled protocols" in Advanced Settings, where net.tcp needs to be added. Am I forced to have unused HTTP bindings simply because of this, or am I missing something?
What I would like to do is have a wcf service be anonymous accessible using a https url.
I have created a WCF in a .net 4.0. Deployed the wcf on a server that is set up to use HTTPS. The server's IIS is set to allow anonymous calls. I can access the WCF's Service.svc's website url and the Service.svc page comes up with no issues. When I click on the wsdl url link on the Service.svc, I get back either a HTTP 404 error or HTTP 401 error. The wcf's wsdl virtual directory, (I am guessing), won't allow me to get to the wsdl file.
I have set the serviceMetadata's property httpsGetEnabled to true.
wsHttpBinding's security to transport and the clientCredentialType is set to none.
basicHttpBinding's security to transport and the clientCredentialType is set to none.
Is it absolutely certain, I need to create a certificate? Because when I use VS2010 in another project and add the WCF as a Service Reference, a pop-up certificate dialog box appears and I click okay and it continues onward. But it stops when the project can't grab the wsdl flie.
How can I get to the service.svc's wsdl?
Thanks.
If you browse to the deployed service endpoint, you'll see a screen that has a link to generating the WSDL. You do need a certificate for SSL -- just create a self-signed one (it's pretty easy). Don't forget to set up your https bindings too for your site in IIS.
I've been trying to have my Silverlight application work with a WCF net.tcp binding the whole day and couldn't make it, even though it seems to me I've done everything right, including after some googling...
I had a WCF service with a basicHttpBinding endpoint which worked perfectly, and as my WCF service and my Silverlight application are on the same network, told myself "why not trying something else than HTTP ?"
So I began googling to see what had to be done, and here's the list of what I did :
Server
Checked that Net.Tcp Listener Adapter service was running
IIS
Enabled net.tcp binding on my website, with binding information set to "4502:*"
Added net.tcp protocol to the Application that hosts my WCF service
Added a policy in the clientaccesspolicy.xml file to allow socket connection on ports 4502-4536
WCF Service
Added a net.tcp binding with Security set to None
Added an endpoint with this binding for my service, keeping the regular HTTP one
After doing all this, I can use my WCF service with WcfTestClient, it sees the two endpoints (HTPP and net.tcp), and both of them work like a charm.
In my Silverlight application, I can update my service reference (which I added with the HTTP address of my service, not the TCP one), and it also sees the two endpoints because it added the TCP endpoint in the ServiceReferences.ClientConfig. As I saw when googling, netTcpBinding is not supported in Silverlight, thus it describes the binding as a custom binding with a and a element.
I saw on the different tutorials I followed that, as for the HTTP binding, Silverlight asks for a socket policy file to check if the client has access to the WCF service. In SL4 Beta, this file was requested by TCP on port 943. As of SL4 RC and RTM, it's requested by HTTP on port 80, as it is for the HTTP bindings.
The thing is, when I launch my application with the proxy set to use the net.tcp binding, I checked with Fiddler, the clientaccesspolicy.xml is NOT requested at any time, and I get the classic error when the socket policy file is not present : TCP error code 10013: An attempt was made to access a socket in a way forbidden by its access permissions.
After googling, I found out that SL looks for this file with the IP address of the server, not its name, but trying http://IP_OF_MY_SERVER/clientaccesspolicy.xml in a browser on my client machine serves the file as expected...
So I'm a bit lost here, I would really like to have it working to see something else than HTTP with WCF...
Someone has any bit of a clue to guess what happens ???
As the service works as expected with WcfTestCLient with the net.tcp binding, I'm guessing this has something to do specifically with SL...
Thanks for reading :-)
Is anybody familiar with setting up WCF-nettcp adapters for BTS?
When I create a WCF-netTcp adapter for a Receive location, I am unsure how/when BTS will open up port 808 to listen on the address URI specified. It appears to only happen if I restart the entire BizTalk application. If it closes for some reason, I do not see any way of reconfiguring and reopening the port.
Furthermore, since that is only the net.tcp binding, there is no mex endpoint exposed. I believe client applications that wish to use that exposed WCF service needs mex metadata initially. Accessing that endpoint direct from a Visual Studio project would just yield
Metadata contains a reference that cannot be resolved: 'net.tcp://biztalkserver/PostReceiveLocation_TCP/PostReceiveService.svc'.
Metadata contains a reference that cannot be resolved: 'net.tcp://biztalkserver/PostReceiveLocation_TCP/PostReceiveService.svc'.
If the service is defined in the current solution, try building the solution and adding the service reference again.
Cannot tell for such how to properly expose a mex endpoint to the service. the BizTalk WCF Service Publishing Wizard is confusing me; I cannot get it to reference the WCF adapter/Receive location I setup. I find no document that teaches what one ought to do for netTcp services; it is all about Http.
Funny, it took the walkthrough about publshing Net-Msmq WCF service to nudge me thinking how the WCF Service Publishing Wizard really works.
The issue is this: When I manually created the WCF-netTcp Receive location, it has its endpoint URI e.g. net.tcp://biztalkserver/PostReceiveLocation_TCP/PostReceiveService.svc. When selecting the option to publish just an mex endpoint in the WCF Service Publishing Wizard, it will eventually ask for the WCF Service Location, which i confused to be the actual service location. Since it would accept nothing but Http URLs, it appeared to only support Http-based WCF endpoints.
But for that textbox, one is supposed to place the Http URL that for just the mex endpoint, not the actual net.tcp WCF endpoint. That is the location in IIS where the wizard will create the necessary meta-data files. Once finished, that location, hosting a mex endpoint will inform clients of the real service located at the net.tcp endpoint.