Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WPF
  4. Calling SSL WCF Service from Silverlight

Calling SSL WCF Service from Silverlight

Scheduled Pinned Locked Moved WPF
wcfsecuritycsharpwpfcom
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Soulforged
    wrote on last edited by
    #1

    Whenever I call my SSL enabled webservice I get this message:

    An error occurred while trying to make a request to URI 'https://XXXX.com/XXXX.svc'. This could be due to attempting to access a service in a cross-domain way without a proper cross-domain policy in place, or a policy that is unsuitable for SOAP services. You may need to contact the owner of the service to publish a cross-domain policy file and to ensure it allows SOAP-related HTTP headers to be sent. This error may also be caused by using internal types in the web service proxy without using the InternalsVisibleToAttribute attribute. Please see the inner exception for more details.

    This service works with no crossdomain issues without SSL. I followed some online guide to enable SSL, which is to add a few lines in crossdomain policy file:

    <access-policy>
    <cross-domain-access>
    <policy>
    <allow-from http-request-headers="*">
    <domain uri="http://*"/>
    <domain uri="https://*"/>
    </allow-from>
    <grant-to>
    <resource path="/" include-subpaths="true"/>
    </grant-to>
    </policy>
    </cross-domain-access>
    </access-policy>

    Changing the web.config file:

    <system.serviceModel>
    <bindings>
    <basicHttpBinding>
    <binding name="SSLEnabled" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
    <security mode="Transport" />
    </binding>
    </basicHttpBinding>
    </bindings>
    <behaviors>
    <serviceBehaviors>
    <behavior name="XXXX.Web.XXXX">
    <serviceMetadata httpsGetEnabled="true" />
    <serviceDebug includeExceptionDetailInFaults="false" />
    </behavior>
    </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
    <services>
    <service behaviorConfiguration="XXXX.Web.XXXXBehavior" name="XXXX.Web.XXXX">
    <endpoint address="" binding="basicHttpBinding" bindingConfiguration="SSLEnabled" contract="XXXX.Web.XXXX" />
    <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
    </service>
    </services>
    </system.serviceModel>

    The host I am working on has multiple domain name so I had to add the following code in the WCF service:

    Public Class

    N M 2 Replies Last reply
    0
    • S Soulforged

      Whenever I call my SSL enabled webservice I get this message:

      An error occurred while trying to make a request to URI 'https://XXXX.com/XXXX.svc'. This could be due to attempting to access a service in a cross-domain way without a proper cross-domain policy in place, or a policy that is unsuitable for SOAP services. You may need to contact the owner of the service to publish a cross-domain policy file and to ensure it allows SOAP-related HTTP headers to be sent. This error may also be caused by using internal types in the web service proxy without using the InternalsVisibleToAttribute attribute. Please see the inner exception for more details.

      This service works with no crossdomain issues without SSL. I followed some online guide to enable SSL, which is to add a few lines in crossdomain policy file:

      <access-policy>
      <cross-domain-access>
      <policy>
      <allow-from http-request-headers="*">
      <domain uri="http://*"/>
      <domain uri="https://*"/>
      </allow-from>
      <grant-to>
      <resource path="/" include-subpaths="true"/>
      </grant-to>
      </policy>
      </cross-domain-access>
      </access-policy>

      Changing the web.config file:

      <system.serviceModel>
      <bindings>
      <basicHttpBinding>
      <binding name="SSLEnabled" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
      <security mode="Transport" />
      </binding>
      </basicHttpBinding>
      </bindings>
      <behaviors>
      <serviceBehaviors>
      <behavior name="XXXX.Web.XXXX">
      <serviceMetadata httpsGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="false" />
      </behavior>
      </serviceBehaviors>
      </behaviors>
      <serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
      <services>
      <service behaviorConfiguration="XXXX.Web.XXXXBehavior" name="XXXX.Web.XXXX">
      <endpoint address="" binding="basicHttpBinding" bindingConfiguration="SSLEnabled" contract="XXXX.Web.XXXX" />
      <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
      </service>
      </services>
      </system.serviceModel>

      The host I am working on has multiple domain name so I had to add the following code in the WCF service:

      Public Class

      N Offline
      N Offline
      Nigel Ferrissey
      wrote on last edited by
      #2

      Hi there, I was getting the same message with an SSL enabled service recently. It turned out that the name on the certificate in IIS was slightly different than what I had in the WCF binding (I was missing a "companyname.co.nz" on my binding). It didn't really matter without SSL because it was all running locally so the machine-name (without the "companyname.co.nz") was enough. Something for you to double check anyway. Cheers.

      S 1 Reply Last reply
      0
      • S Soulforged

        Whenever I call my SSL enabled webservice I get this message:

        An error occurred while trying to make a request to URI 'https://XXXX.com/XXXX.svc'. This could be due to attempting to access a service in a cross-domain way without a proper cross-domain policy in place, or a policy that is unsuitable for SOAP services. You may need to contact the owner of the service to publish a cross-domain policy file and to ensure it allows SOAP-related HTTP headers to be sent. This error may also be caused by using internal types in the web service proxy without using the InternalsVisibleToAttribute attribute. Please see the inner exception for more details.

        This service works with no crossdomain issues without SSL. I followed some online guide to enable SSL, which is to add a few lines in crossdomain policy file:

        <access-policy>
        <cross-domain-access>
        <policy>
        <allow-from http-request-headers="*">
        <domain uri="http://*"/>
        <domain uri="https://*"/>
        </allow-from>
        <grant-to>
        <resource path="/" include-subpaths="true"/>
        </grant-to>
        </policy>
        </cross-domain-access>
        </access-policy>

        Changing the web.config file:

        <system.serviceModel>
        <bindings>
        <basicHttpBinding>
        <binding name="SSLEnabled" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
        <security mode="Transport" />
        </binding>
        </basicHttpBinding>
        </bindings>
        <behaviors>
        <serviceBehaviors>
        <behavior name="XXXX.Web.XXXX">
        <serviceMetadata httpsGetEnabled="true" />
        <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
        </serviceBehaviors>
        </behaviors>
        <serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
        <services>
        <service behaviorConfiguration="XXXX.Web.XXXXBehavior" name="XXXX.Web.XXXX">
        <endpoint address="" binding="basicHttpBinding" bindingConfiguration="SSLEnabled" contract="XXXX.Web.XXXX" />
        <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
        </service>
        </services>
        </system.serviceModel>

        The host I am working on has multiple domain name so I had to add the following code in the WCF service:

        Public Class

        M Offline
        M Offline
        Mark Salsbery
        wrote on last edited by
        #3

        Also, if you're hosting on IIS, make sure there's an HTTPS binding on the site.

        Mark Salsbery Microsoft MVP - Visual C++ :java:

        1 Reply Last reply
        0
        • N Nigel Ferrissey

          Hi there, I was getting the same message with an SSL enabled service recently. It turned out that the name on the certificate in IIS was slightly different than what I had in the WCF binding (I was missing a "companyname.co.nz" on my binding). It didn't really matter without SSL because it was all running locally so the machine-name (without the "companyname.co.nz") was enough. Something for you to double check anyway. Cheers.

          S Offline
          S Offline
          Soulforged
          wrote on last edited by
          #4

          Thank you, it turns out everything was set up fine, but the Certificate itself was wrong. The host has fixed it and now the SSL service work fine.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups