Skip to main content

Microsoft Silverlight

Answered Question WCF Service and https problem in silverlightRSS Feed

(0)

Navnee
Navnee

Member

Member

3 points

10 Posts

WCF Service and https problem in silverlight

 Hi,

I am facing problems in consuming secure  WCF service in  Silverlight application, the WCF Service is running fine  on http:// however if i try to consume it using https:// URI then it throws error.

 

  <client />
    <bindings>
      <basicHttpBinding>
        <binding name="basicHttpBinding">
        </binding>
        <binding name="basicHttpsBinding">
          <security mode="Transport">
            <transport clientCredentialType ="None"/>
          </security>
        </binding>
      </basicHttpBinding>
    </bindings>

 <behaviors>
      <serviceBehaviors>
        <behavior name="SessionServiceBehavior">
          <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
        <behavior name="ServiceBehavior">
          <serviceMetadata httpGetEnabled="true"   />
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
        <behavior name="AnnualizedRateOfReturnBehavior">
          <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
</behaviors>
 <services>
      <service behaviorConfiguration="SessionServiceBehavior" name="SessionService">
        <endpoint address="" binding="basicHttpBinding"   contract="SessionService" />
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
      </service>
      <service behaviorConfiguration="AnnualizedRateOfReturnBehavior" name="AnnualizedRateOfReturn">
        <endpoint address=""  binding="basicHttpBinding"   contract="AnnualizedRateOfReturn" />
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
      </service>
      
    </services>

 here is the C# code

  

var WebService = new ServiceRef.SessionServiceClient("BasicHttpBinding_SessionService", Address.AbsoluteUri);
  
WebService.ReturnSessionClassCompleted += new EventHandler(WebService_ReturnSessionClassCompleted);
               
 

However the if i run WCF service from Directly in browser. Both with http:// and https:// are running fine. means problem is in just consuming WCF service in Silverlight

Thanks in Advance

Navneel Bhanot

varshavmane
varshavmane

Contributor

Contributor

6719 points

1,578 Posts

Answered Question

Re: WCF Service and https problem in silverlight

Hi,

Check this Video:

http://silverlight.net/learn/learnvideo.aspx?video=66686

HTH Smile

Please "Mark as Answer" if this post answered your question. :)
Visit my Blog: http://varshavmane.blogspot.com/

varshavmane
varshavmane

Contributor

Contributor

6719 points

1,578 Posts

Re: Re: WCF Service and https problem in silverlight

Even this post

http://forums.silverlight.net/forums/p/36713/111182.aspx 

will help you.

Please "Mark as Answer" if this post answered your question. :)
Visit my Blog: http://varshavmane.blogspot.com/

Navnee
Navnee

Member

Member

3 points

10 Posts

Re: Re: Re: WCF Service and https problem in silverlight

Thanks... You have solved my problem... thanks a lot :)

varshavmane
varshavmane

Contributor

Contributor

6719 points

1,578 Posts

Re: Re: Re: Re: WCF Service and https problem in silverlight

My Pleasure Smile

Please "Mark as Answer" if this post answered your question. :)
Visit my Blog: http://varshavmane.blogspot.com/
  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities