Note that there are some explanatory texts on larger screens.

plurals
  1. POSilverlight: connecting to secured ASMX service
    primarykey
    data
    text
    <p>I need to connect to an ASMX secured web service over HTTPS using Silverlight 4. I have been able to connect to the service using a WPF application using the following configuration:</p> <pre><code> &lt;binding name="wsSomeWebService" 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="Transport"&gt; &lt;transport clientCredentialType="Basic" proxyCredentialType="Basic" realm="www.somedomain.com" /&gt; &lt;message clientCredentialType="UserName" algorithmSuite="Default" /&gt; &lt;/security&gt; &lt;/binding&gt; </code></pre> <p>And in code I do the following:</p> <pre><code>client.ClientCredentials.UserName.UserName = "username"; client.ClientCredentials.UserName.Password = "password"; </code></pre> <p>However, when I try to connect from Silverlight I always get a security exception.</p> <p>On the server the policy file looks like this:</p> <pre><code>&lt;access-policy&gt; &lt;cross-domain-access&gt; &lt;policy&gt; &lt;allow-from http-methods="*" http-request-headers="*"&gt; &lt;domain uri="*"/&gt; &lt;/allow-from&gt; &lt;grant-to&gt; &lt;resource path="/" include-subpaths="true"/&gt; &lt;/grant-to&gt; &lt;/policy&gt; &lt;/cross-domain-access&gt; &lt;/access-policy&gt; </code></pre> <p>On Silverlight, I have tried using this:</p> <pre><code> &lt;customBinding&gt; &lt;binding name="secureBinaryHttpBinding" &gt; &lt;security authenticationMode="UserNameOverTransport"/&gt; &lt;httpsTransport /&gt; &lt;/binding&gt; &lt;/customBinding&gt; </code></pre> <p>And also this:</p> <pre><code> &lt;basicHttpBinding&gt; &lt;binding name="basicSecureBinding" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647"&gt; &lt;security mode="Transport"/&gt; &lt;/binding&gt; &lt;/basicHttpBinding&gt; </code></pre> <p>But neither seems to work.</p> <p>Does anyone have an idea on how I can reproduce the successful configuration I used in WPF on a Silverlight client?</p>
    singulars
    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