Why is my front-end not retrieving information from my back-end? - networking

If I run my application locally (using localhost) it works perfectly.
But when I decided to switch to my global ip address (when I say global I mean not my lan ip address, but the one given by my ISP).
It just doesn't load the data from my back-end.
This is how I make the requests from my front-end:
this.http.get("http://my-isp-ip:52899/api/Student/ListStudents").subscribe(response => {
this.users = response["Users"];
});
And this is how I got my applicationhost.config on my back-end:
<bindings>
<binding protocol="http" bindingInformation="*:52899:localhost" />
<binding protocol="http" bindingInformation="*:52899:my-isp-ip" />
</bindings>
And I run the front-end application like this:
ng serve --host 0.0.0.0
And I already opened the ports both in my router and my firewall.
Now, in my router I only opened the ports: 4200 since this is the one running on my front-end and 52889 which is the one running on my back-end.
What can I be doing wrong?

Solution:
I changed:
<bindings>
<binding protocol="http" bindingInformation="*:52899:localhost" />
<binding protocol="http" bindingInformation="*:52899:my-isp-ip" />
</bindings>
To:
<bindings>
<binding protocol="http" bindingInformation="*:52899:localhost" />
<binding protocol="http" bindingInformation="*:52899:*" />
</bindings>
And run Visual Studio as Administrator...

Related

How to support multiple domain name for the same project in Visual Studio 2019 and asp.net core app?

I have a project that is written on the top of Asp.NET 5/Core using Visual Studio 2019.
My project has multi-tenancy support and need to be able to map multiple local domains to the project to test out multi-tenancy.
How can I bind a second local domain to point to the same running host? I added tenant1.website and tenant2.website in the .hosts file like so
127.0.0.1 tenant1.website
127.0.0.1 tenant2.website
I tried to modify the .vs\PrjectName\config\applicationhost.config and added new binding like this
<site name="ProjectName.Web" id="2">
<application path="/" applicationPool="ProjectName.Web AppPool">
<virtualDirectory path="/" physicalPath="E:\ProjectName\ProjectName.Web" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:37893:localhost" />
<binding protocol="https" bindingInformation="*:44356:localhost" />
<binding protocol="http" bindingInformation="*:37893:tenant1.website" />
<binding protocol="https" bindingInformation="*:44356:tenant1.website" />
<binding protocol="http" bindingInformation="*:37893:tenant2.website" />
<binding protocol="https" bindingInformation="*:44356:tenant2.website" />
</bindings>
</site>
But, when I go to https://tenant1.website:44356 I get the following error
This site can’t be reached
How can I correctly bind tenant1.website and tenant2.website to my locally running app using IIS Express?

Http is not running under Visual Studio IIS Express

I am experiencing a strange problem. I have an ASP.Net Web API solution project. The solution was opened and running perfectly. Then the system automatically restarted due to a pending windows update. After that when I started the solution and ran the Web API project, it only runs on https and I even cant see the http url in Show All Applications on IIS express.
While in applicationhost.config, it contains the following bindings:
<site name="BevahiorApp.API" id="2">
<application path="/" applicationPool="Clr4IntegratedAppPool">
<virtualDirectory path="/" physicalPath="D:\Projects\BevahiorApp.API\BevahiorApp.API" />
</application>
<bindings>
<binding protocol="http" bindingInformation="*:50145:localhost" />
<binding protocol="https" bindingInformation="*:44378:localhost" />
</bindings>
</site>
and in the Project properties under Web tab

How to start 2660 port in IIS for Tridion Core Service connection using netTcp

I am trying to connect to Tridion using core service script, here is my code:
public static SessionAwareCoreServiceClient Client;
Client = new SessionAwareCoreServiceClient("netTcp_2011");
Client.ClientCredentials.Windows.ClientCredential = new NetworkCredential(user, password);
web.Config has following:
<system.serviceModel>
<!-- Default/example WCF settings for Core Service. These settings should be copied into the host application's configuration file. -->
<bindings>
<!-- Default Core Service binding settings are provided here. These can be used as a starting point for further customizations. -->
<basicHttpBinding>
<binding name="basicHttp" maxReceivedMessageSize="10485760">
<readerQuotas maxStringContentLength="10485760" maxArrayLength="10485760"/>
<security mode="TransportCredentialOnly">
<!-- For LDAP or SSO authentication of transport credentials, use clientCredentialType="Basic" -->
<transport clientCredentialType="Windows"/>
</security>
</binding>
<binding name="streamDownload_basicHttp" maxReceivedMessageSize="209715200" transferMode="StreamedResponse" messageEncoding="Mtom" sendTimeout="00:15:00">
<security mode="TransportCredentialOnly">
<!-- For LDAP or SSO authentication of transport credentials, use clientCredentialType="Basic" -->
<transport clientCredentialType="Windows"/>
</security>
</binding>
<binding name="streamUpload_basicHttp" maxReceivedMessageSize="209715200" transferMode="StreamedRequest" messageEncoding="Mtom" receiveTimeout="00:15:00">
<security mode="None"/>
</binding>
</basicHttpBinding>
<netTcpBinding>
<binding name="netTcp" transactionFlow="true" transactionProtocol="WSAtomicTransaction11" maxReceivedMessageSize="2147483647">
<readerQuotas maxStringContentLength="2147483647" maxArrayLength="2147483647"/>
</binding>
<binding name="streamDownload_netTcp" maxReceivedMessageSize="2147483647" transferMode="StreamedResponse" sendTimeout="00:20:00"/>
<binding name="streamUpload_netTcp" maxReceivedMessageSize="2147483647" transferMode="StreamedRequest" receiveTimeout="00:20:00"/>
</netTcpBinding>
</bindings>
<client>
<!--Dev 2013 -->
<endpoint name="netTcp_2011" address="net.tcp://localhost:2660/CoreService/2011/netTcp" binding="netTcpBinding" bindingConfiguration="netTcp" contract="Tridion.ContentManager.CoreService.Client.ISessionAwareCoreService"/>
<endpoint name="streamDownload_netTcp_2011" address="net.tcp://localhost:2660/CoreService/2011/streamDownload_netTcp" binding="netTcpBinding" bindingConfiguration="streamDownload_netTcp" contract="Tridion.ContentManager.CoreService.Client.IStreamDownload"/>
<endpoint name="streamUpload_netTcp_2011" address="net.tcp://localhost:2660/CoreService/2011/streamUpload_netTcp" binding="netTcpBinding" bindingConfiguration="streamUpload_netTcp" contract="Tridion.ContentManager.CoreService.Client.IStreamUpload"/>
<!-- -->
</client>
</system.serviceModel>
Still I get this Error:
Could not connect to net.tcp://localhost:2660/CoreService/2011/netTcp. The connection attempt lasted for a time span of 00:00:01.0520000. TCP error code 10061: No connection could be made because the target machine actively refused it localhost:2660.
Note: localhost can also be an IP of a CMS instance.
Can anyone help?
Okay, so Over the time I educated myself and can clearly say that the error target machine actively refused it localhost:2660 clearly says that the port is not open for you to use.
So do these two things to be sure:
Make sure you have allowed net.tcp in IIS
And the port 2660 open in the windows firewall?
run a netstat -tan to see whether anything is running on 2660, if not then you can not access it.
Also If you are running your code form local system or from another server, in case netTcp is not working, try to use wsHttp or BasicHttp (provided you have these bindings in your server core service's web.config)
The Core Service runs as a Windows Service, not from IIS. Open Windows Services and make sure that the Tridion Content Manager Service Host is running.

Web Service Error "There was no endpoint listening at..." Firewall Concern

So I have a web service service reference that works localhost and can be pinged from its production url but I can't get access to it via the Service Reference call in production. I believe the issue is my firewall . I have two websites on the same server each with their own dedicated IP address. I am trying to call the web service on the second website from the first website. If I open a browser on my production server I cannot navigate to either website.
Error Description:There was no endpoint listening at http://[209.112.245.103]/Services/OfferService.asmx that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.
Inner Exception:Unable to connect to the remote server
The calling website is on the same server (different IP of course) and is calling the web service via a service reference:
Dim offerService As New ServiceReferenceOffer.OfferServiceSoapClient("OfferServiceSoap")
offerService.BroadcastOfferChange(offer.PropertyID, offer.OfferID, offer.ResultResponse)
And my web.config contains the following service endpoint information:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="OfferServiceSoap" />
<binding name="ConversationServiceSoap" />
</basicHttpBinding>
<customBinding>
<binding name="OfferServiceSoap12">
<textMessageEncoding messageVersion="Soap12" />
<httpTransport />
</binding>
<binding name="ConversationServiceSoap12">
<textMessageEncoding messageVersion="Soap12" />
<httpTransport />
</binding>
</customBinding>
</bindings>
<client>
<endpoint address="http://209.112.245.103/Services/ConversationService.asmx"
binding="basicHttpBinding" bindingConfiguration="ConversationServiceSoap"
contract="ServiceReferenceConversation.ConversationServiceSoap"
name="ConversationServiceSoap" />
<endpoint address="http://209.112.245.103/Services/ConversationService.asmx"
binding="customBinding" bindingConfiguration="ConversationServiceSoap12"
contract="ServiceReferenceConversation.ConversationServiceSoap"
name="ConversationServiceSoap12" />
<endpoint address="http://209.112.245.103/Services/OfferService.asmx"
binding="basicHttpBinding" bindingConfiguration="OfferServiceSoap"
contract="ServiceReferenceOffer.OfferServiceSoap" name="OfferServiceSoap" />
<endpoint address="http://209.112.245.103/Services/OfferService.asmx"
binding="customBinding" bindingConfiguration="OfferServiceSoap12"
contract="ServiceReferenceOffer.OfferServiceSoap" name="OfferServiceSoap12" />
</client>
</system.serviceModel>
Your configurations are correct. I just accessed your server and everything went fine (so it's not code related).
Since the site and the website are in the same server, you may need to use a different IP or address to access the wcf (try 127.0.0.1, localhost or an internal server ip).

Publish sites at custom portnumbers in windows azure?

We are trying to publish three sites in Azure, they are on ports 8080-8082.
The site on 8080 works fine, the sites on 8081 and 8082 does however not respond from the outside.
Ideas?
This is on a single role, right? Can you put your ServiceDefinition up to look at? Typically this is because you miconfigured input endpoints or the binding. Here is a trivial example that has 3 sites on 3 different ports.
<?xml version="1.0" encoding="utf-8"?>
<ServiceDefinition name="WindowsAzureProject1" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition">
<WebRole name="MvcWebRole1">
<Sites>
<Site name="Web1" physicalDirectory="../pathtowebsite1">
<Bindings>
<Binding name="Endpoint1" endpointName="Endpoint1" />
</Bindings>
</Site>
<Site name="Web2" physicalDirectory="../pathtowebsite2">
<Bindings>
<Binding name="Endpoint2" endpointName="Endpoint2" />
</Bindings>
</Site>
<Site name="Web2" physicalDirectory="../pathtowebsite3">
<Bindings>
<Binding name="Endpoint3" endpointName="Endpoint3" />
</Bindings>
</Site>
</Sites>
<Endpoints>
<InputEndpoint name="Endpoint1" protocol="http" port="8080" />
<InputEndpoint name="Endpoint2" protocol="http" port="8081" />
<InputEndpoint name="Endpoint3" protocol="http" port="8082" />
</Endpoints>
</WebRole>
</ServiceDefinition>

Resources