Click here to Skip to main content
15,887,477 members
Home / Discussions / WPF
   

WPF

 
Questionround slider Pin
robotz8-Oct-09 4:57
robotz8-Oct-09 4:57 
AnswerRe: round slider Pin
Christian Graus8-Oct-09 9:41
protectorChristian Graus8-Oct-09 9:41 
GeneralRe: round slider Pin
robotz8-Oct-09 9:58
robotz8-Oct-09 9:58 
GeneralRe: round slider Pin
Christian Graus8-Oct-09 10:26
protectorChristian Graus8-Oct-09 10:26 
GeneralRe: round slider Pin
robotz8-Oct-09 10:32
robotz8-Oct-09 10:32 
QuestionMedia element fullscreen Pin
Nekkantidivya7-Oct-09 19:29
Nekkantidivya7-Oct-09 19:29 
AnswerRe: Media element fullscreen Pin
Nigel Ferrissey8-Oct-09 16:03
Nigel Ferrissey8-Oct-09 16:03 
QuestionCalling SSL WCF Service from Silverlight Pin
Soulforged7-Oct-09 15:47
Soulforged7-Oct-09 15:47 
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 XXXXHostFactory
    Inherits ServiceHostFactory

    Public Overrides Function CreateServiceHost(ByVal constructorString As String, ByVal baseAddresses() As System.Uri) As System.ServiceModel.ServiceHostBase
        Return MyBase.CreateServiceHost(constructorString, baseAddresses)
    End Function

    Protected Overrides Function CreateServiceHost(ByVal serviceType As System.Type, ByVal baseAddresses() As System.Uri) As System.ServiceModel.ServiceHost
        Dim webServiceAddress = New Uri("https://XXXX.com/XXXX.svc")

        Dim webServiceHost = New MyServiceHost(serviceType, webServiceAddress)
        Return webServiceHost
    End Function

    Public Class MyServiceHost
        Inherits ServiceHost

        Public Sub New(ByVal serviceType As Type, ByVal baseAddresses As Uri)
            Dim BaseAddressScheme As New UriSchemeKeyedCollection
            BaseAddressScheme.Add(baseAddresses)
            MyBase.InitializeDescription(serviceType, BaseAddressScheme)
        End Sub

        Protected Overrides Sub ApplyConfiguration()
            MyBase.ApplyConfiguration()
        End Sub

        Protected Overrides Sub InitializeRuntime()
            MyBase.InitializeRuntime()
        End Sub
    End Class
End Class


And change the markup of the WCF to:

<%@ ServiceHost Language="VB" Debug="true" Service="XXXX.Web.XXXX" Factory="XXXX.Web.XXXXHostFactory" CodeBehind="XXXX.svc.vb" %>


Everything works perfect without SSL, but I added another service for authentication - which requires SSL and made the changes to the code shown above, and I get the crossdomain error.

What else did I miss?
AnswerRe: Calling SSL WCF Service from Silverlight Pin
Nigel Ferrissey7-Oct-09 19:19
Nigel Ferrissey7-Oct-09 19:19 
GeneralRe: Calling SSL WCF Service from Silverlight Pin
Soulforged8-Oct-09 13:41
Soulforged8-Oct-09 13:41 
AnswerRe: Calling SSL WCF Service from Silverlight Pin
Mark Salsbery8-Oct-09 10:19
Mark Salsbery8-Oct-09 10:19 
QuestionSelector (ListBox, ComboBox) default selected item woes when bound to ObservableCollection Pin
Jeremy Likness7-Oct-09 10:32
professionalJeremy Likness7-Oct-09 10:32 
AnswerRe: Selector (ListBox, ComboBox) default selected item woes when bound to ObservableCollection Pin
Nigel Ferrissey8-Oct-09 12:08
Nigel Ferrissey8-Oct-09 12:08 
QuestionCan DataGrid Swap Row and Column? Pin
Frank W. Wu7-Oct-09 10:13
Frank W. Wu7-Oct-09 10:13 
AnswerRe: Can DataGrid Swap Row and Column? Pin
Nigel Ferrissey9-Oct-09 12:22
Nigel Ferrissey9-Oct-09 12:22 
Questioncombobox usage Pin
VCsamir6-Oct-09 21:22
VCsamir6-Oct-09 21:22 
QuestionRe: combobox usage Pin
Mark Salsbery7-Oct-09 7:22
Mark Salsbery7-Oct-09 7:22 
Questioncan we use wpf controls in window's application . Pin
Anuj Banka6-Oct-09 19:35
Anuj Banka6-Oct-09 19:35 
AnswerRe: can we use wpf controls in window's application . Pin
Pete O'Hanlon6-Oct-09 21:47
mvePete O'Hanlon6-Oct-09 21:47 
GeneralRe: can we use wpf controls in window's application . Pin
Anuj Banka6-Oct-09 21:54
Anuj Banka6-Oct-09 21:54 
GeneralRe: can we use wpf controls in window's application . Pin
Christian Graus6-Oct-09 22:11
protectorChristian Graus6-Oct-09 22:11 
GeneralRe: can we use wpf controls in window's application . Pin
Pete O'Hanlon6-Oct-09 22:55
mvePete O'Hanlon6-Oct-09 22:55 
GeneralRe: can we use wpf controls in window's application . Pin
Anuj Banka6-Oct-09 23:11
Anuj Banka6-Oct-09 23:11 
QuestionCustom scrolling in WPF control Pin
grvdarji6-Oct-09 11:51
grvdarji6-Oct-09 11:51 
QuestionRe: Custom scrolling in WPF control Pin
Mark Salsbery7-Oct-09 7:41
Mark Salsbery7-Oct-09 7:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.