Is it possible to expose WCF service on a different port? - wcf

Let's say I have an iis website with two https bindings. One for port 443 and the other one for port 553. The website hosts both ASP.NET MVC and WCF. This means that both of them are accessible via 553 and 443 ports. Is it possible to restrict WCF to be available on port 553 only? I tried the baseAddress config but it does not seem to work.
Env: iis 8.5, Windows 2012

It looks like this does the trick. Note: it does not work with localhost.
<serviceHostingEnvironment multipleSiteBindingsEnabled="false">
<baseAddressPrefixFilters>
<add prefix="https://fully_qualified_name:553"/>
</baseAddressPrefixFilters>

Right click your wcf application in iis then go to edit the bindings. Set the port here. If you have access to source click the wcf project in visual studio, there is a property for path, edit this. Any projects you have that use the web service will need their web reference updated. Change the port on here then right click and update reference

Related

Bind an application with public IP address

I have an ASP.Net MVC application developed on my system. I want to access my site from remote computer by binding my app with public IP using following Commands,
netsh http add urlacl url=http://192.168.1.42:3000/ user=everyone
in Visual Studio i have updated applicationhost.config file
<binding protocol="http" bindingInformation="*:3000:192.168.1.42" />
but it is still not working saying "Service Unavailable
HTTP Error 503. The service is unavailable."
In applicationhost.config file the localhost must be changed to your computer name.

Cannot call webservice exposed by Mule

I am using Mule to expose a web service and deployed it on AWS . It's working fine locally. I can use SoapUI to test http://localhost:8087/hello. But if we call from outside using the host of AWS: http://xxx.xxx.com:8087/hello, it will show connection error. We've opened the port 8087, what else do we need? Thanks!
If you have defined "localhost" in you mule configuration file mule will only listen on the localhost interface. Change the host in your inbound endpoint to 0.0.0.0 to bind to all available interfaces or explicitly specify the IP you want to listen on for incoming requests.
If this doesn't fix it please verify firewall settings again and then post more information such as relevant parts of you mule configuration file.

change the net tcp port of a wcf service running on windows service

I'm using this example:
http://msdn.microsoft.com/en-us/library/ms733069.aspx
How do I change the port or specify a port and open it and all the other good stuff needed to access the service?
read this manual http://msdn.microsoft.com/en-us/library/ms734786.aspx or at least finish reading of your link up to 13th point in list, where configuration file is provided
according to standard, URL consists of:
protocol :// hostname [: portnumber] [/path]
so, you need to change 8080 in your config to proper port
<add baseAddress="http://localhost:8000/ServiceModelSamples/service"/>

WCF service binds at 0:0:0:0 instead of dns alias

We have a cluster where to WCF services are running as a resource each in a separated resource group. These groups have a dns alias named to there cap name e.g. APPQA en APPPROD each with an IP's 10.110.250.1 and 10.110.250.2.
Actually it's the same WCF service but running on another baseadresss, like this example of our baseAdress:
<add baseAdress="net.tcp://appqa.domain.com:4504/....
and
<add baseAdress="net.tcp://appprod.domain.com:4504/....
But when running these services on the same node we noticed that we were getting errors like there is Address is in use.
We found that weird because we added our alias in the base address section a nslookup of both our aliases and that gave us both the right IP address.
When running only the PROD service, I did a telnet command to the IP address of the QA and the 4504 port. I was able to make a connection this means that we are actually running on both IP adresses (or all addresses and port like 0:0:0:0:4504).
As an extra test we changed our baseadresses to
<add baseAdress="net.tcp://10.110.250.1:4504/....
<add baseAdress="net.tcp://10.110.250.2:4504/....
And then we can run both services next to each other on the same node, so we prove that our services work only the dns resolution does not work.
It all works in when we enable port sharing but we don't want do that because of a different SLA.
Has someone a idea how we can force WCF to use the IP address of his dns alias?

WCF, WAS, IIS and ports

Hi,
I have worked with WCF for a while now but there is somthing Im not clear on.
When hosting a WCF service in IIS the standard protocol will be http and the default port is 80. Its possible to change this portnr if needed.
Then its also possible to host a WCF service in IIS using the TCP protocol(WAS). The WCF service will however still publish its mex on port 80 on http prootocol but how do I see the port nr for the WCF TCP communication?
I Supose that I will have to open first the port nr for the mex(usually port 80) and then also the WAS(WCF TCP in IIS) port?
BestRegards
You can see which port TCP will use by going into the website configuration in IIS and looking at the site bindings, then looking for (or adding, if necessary) the net.tcp binding. Here is the documentation on how to configure bindings.
If I remember correctly, the default port is 808.