Note that there are some explanatory texts on larger screens.

plurals
  1. POWCF ports configuration error
    primarykey
    data
    text
    <p>I have two services, configured via a config file. Each of them listens to one http and one https address. The problem is how to configure the ports. If I configure the http ports to the same value and the https ports to another value, when debugging the whole project I get the following error message in WCF Service Host:</p> <blockquote> <p>Status: Error System.ServiceModel.AddressAlreadyInUseException: HTTP could not register URL <a href="https://+:8002/Services/xxxService/" rel="nofollow noreferrer">https://+:8002/Services/xxxService/</a> because TCP port 8002 is being used by another application. ---> System.Net.HttpListenerException: The process cannot access the file because it is being used by another process</p> </blockquote> <p>If I configure the four ports (http and https) to have different values and none of the https values is the value of the ssl port configured and certified in IIS, I get the following exception on service call (but both services are started in the WCF Service Host):</p> <blockquote> <p>An error occurred while making the HTTP request to <a href="https://localhost:8000/Services/yyyService/" rel="nofollow noreferrer">https://localhost:8000/Services/yyyService/</a>. This could be due to the fact that the server certificate is not configured properly with HTTP.SYS in the HTTPS case. This could also be caused by a mismatch of the security binding between the client and the server.</p> </blockquote> <p>If I configure the first service to use the SSL port (443), then only the second service is started (the one with the "wrong" https port). The error message for the first service again is:</p> <blockquote> <p>System.ServiceModel.AddressAlreadyInUseException: HTTP could not register URL <a href="https://+:443/Services/xxxService/" rel="nofollow noreferrer">https://+:443/Services/xxxService/</a> because TCP port 443 is being used by another application. ---> System.Net.HttpListenerException: The process cannot access the file because it is being used by another process</p> </blockquote> <p>On top of that, I get an exception, when calling the second service:</p> <blockquote> <p>An error occurred while making the HTTP request to <a href="https://localhost/Services/yyyService/" rel="nofollow noreferrer">https://localhost/Services/yyyService/</a>. This could be due to the fact that the server certificate is not configured properly with HTTP.SYS in the HTTPS case. This could also be caused by a mismatch of the security binding between the client and the server.</p> </blockquote> <p>When I configure both services to use 443 for https, well... then nothing gets started. And I get all kinds of strange exceptions - clientcredentials is readonly, the handshake encountered an unexpected packet format, something about remote address and so on.</p> <p>I have configured both addresses in the web.config as follows:</p> <pre><code>&lt;baseAddresses&gt; &lt;add baseAddress="http://localhost:port1/Services/xxxService/" /&gt; &lt;add baseAddress="https://localhost:port2/Services/xxxService/" /&gt; &lt;/baseAddresses&gt; [...] &lt;baseAddresses&gt; &lt;add baseAddress="http://localhost:port3/Services/yyyService/" /&gt; &lt;add baseAddress="https://localhost:port4/Services/yyyService/" /&gt; &lt;/baseAddresses&gt; </code></pre> <p>I have been trying to run this thing for two days now, so any helf would be appreciated.</p> <p>PS. In Visual Studio I have configured IIS as a development server, instead of the in-build visual studio web development server.</p> <p><strong>EDIT:</strong></p> <pre><code> &lt;system.serviceModel&gt; &lt;serviceHostingEnvironment aspNetCompatibilityEnabled="true" /&gt; &lt;services&gt; &lt;service name="namespace.xxxService" behaviorConfiguration="default"&gt; &lt;host&gt; &lt;baseAddresses&gt; &lt;add baseAddress="http://localhost:8000/Services/xxxService/" /&gt; &lt;add baseAddress="https://localhost:8001/Services/xxxService/" /&gt; &lt;/baseAddresses&gt; &lt;/host&gt; &lt;endpoint address="" binding="wsHttpBinding" bindingConfiguration="defaultWsHttpBinding" contract="namespace.IxxxService" /&gt; &lt;endpoint address="mex/" binding="mexHttpBinding" contract="IMetadataExchange" bindingConfiguration="" /&gt; &lt;/service&gt; &lt;service name="namespace.yyyService" behaviorConfiguration="default"&gt; &lt;host&gt; &lt;baseAddresses&gt; &lt;add baseAddress="http://localhost:8003/Services/yyyService/" /&gt; &lt;add baseAddress="https://localhost:8004/Services/yyyService/" /&gt; &lt;/baseAddresses&gt; &lt;/host&gt; &lt;endpoint address="" binding="wsHttpBinding" bindingConfiguration="defaultWsHttpBinding" contract="namespace.IyyyService" /&gt; &lt;endpoint address="mex/" binding="mexHttpBinding" contract="IMetadataExchange" /&gt; &lt;/service&gt; &lt;/services&gt; &lt;client&gt; &lt;endpoint address="https://localhost:8001/Services/xxxService/" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IxxxService" contract="namespace.IxxxService" name="WSHttpBinding_IxxxService" /&gt; &lt;endpoint address="https://localhost:8001/Services/yyyService/" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IyyyService" contract="namespace.IyyyService" name="WSHttpBinding_IyyyService" /&gt; &lt;/client&gt; &lt;behaviors&gt; &lt;serviceBehaviors&gt; &lt;behavior name="default"&gt; &lt;serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" /&gt; &lt;serviceDebug includeExceptionDetailInFaults="true" /&gt; &lt;serviceCredentials&gt; &lt;userNameAuthentication userNamePasswordValidationMode="MembershipProvider" membershipProviderName="SqlMembershipProvider" /&gt; &lt;/serviceCredentials&gt; &lt;serviceAuthorization principalPermissionMode="UseAspNetRoles" roleProviderName="SqlRoleProvider" /&gt; &lt;/behavior&gt; &lt;/serviceBehaviors&gt; &lt;/behaviors&gt; &lt;bindings&gt; &lt;wsHttpBinding&gt; &lt;binding name="defaultWsHttpBinding"&gt; &lt;security mode="TransportWithMessageCredential"&gt; &lt;message clientCredentialType="UserName" /&gt; &lt;transport clientCredentialType="None" /&gt; &lt;/security&gt; &lt;/binding&gt; &lt;binding name="WSHttpBinding_IyyyService" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false" &gt; &lt;readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" /&gt; &lt;reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" /&gt; &lt;security mode="TransportWithMessageCredential"&gt; &lt;transport clientCredentialType="None" proxyCredentialType="None" realm="" /&gt; &lt;message clientCredentialType="UserName" negotiateServiceCredential="true" algorithmSuite="Default" establishSecurityContext="true" /&gt; &lt;/security&gt; &lt;/binding&gt; &lt;binding name="WSHttpBinding_IxxxService" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false"&gt; &lt;readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" /&gt; &lt;reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" /&gt; &lt;security mode="TransportWithMessageCredential"&gt; &lt;transport clientCredentialType="None" proxyCredentialType="None" realm="" /&gt; &lt;message clientCredentialType="UserName" negotiateServiceCredential="true" algorithmSuite="Default" establishSecurityContext="true" /&gt; &lt;/security&gt; &lt;/binding&gt; &lt;/wsHttpBinding&gt; &lt;/bindings&gt; &lt;/system.serviceModel&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload