Note that there are some explanatory texts on larger screens.

plurals
  1. POCastle Windsor WCF Facility not setting Username Credentials
    primarykey
    data
    text
    <p>I am unable to see why the WCF Facility is failing to set the user-name credentials on my client configuration. Could anyone see where I am going wrong?</p> <p>When the IService is resolved from the container the ClientCredentials.UserName.UserName and Password are null. As are the Endpoint equivilents. None of the credentials references are set at all and all remain null values.</p> <pre><code>container .Register( Component .For&lt;IService&gt;() .ImplementedBy&lt;ServiceClient&gt;() .AsWcfClient( new DefaultClientModel { Endpoint = WcfEndpoint .FromConfiguration("binding"), } .Credentials( new UserNameCredentials( "username", "password")))); </code></pre> <p>The binding and endpoint configuration is being picked up correctly from the app.config file - it is purely the authentication that I need to resolve.</p> <p>for completeness:</p> <pre><code> &lt;system.serviceModel&gt; &lt;bindings&gt; &lt;basicHttpBinding&gt; &lt;binding name="binding" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true"&gt; &lt;readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" /&gt; &lt;security mode="TransportWithMessageCredential"&gt; &lt;message clientCredentialType="UserName" algorithmSuite="Default" /&gt; &lt;/security&gt; &lt;/binding&gt; &lt;/basicHttpBinding&gt; &lt;/bindings&gt; &lt;client&gt; &lt;endpoint address="http://___________________" binding="basicHttpBinding" bindingConfiguration="binding" contract="Namespace.Class" name="binding" /&gt; &lt;/client&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.
    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