0

I'm exposing a web service to my client side javascript using .Net's Scriptmanager as follows:

 <asp:ScriptManager ID="scriptMgr" runat="server">
    <services>
        <asp:servicereference Path="RmUiControlDataSVC.svc" />
    </services>
</asp:ScriptManager>

In my javascript I can call it like this:

var service = new RmUiControlDataSVC();

When I run this from my local server, it works fine and I can run the methods within. It also runs when I deploy remotely and connect to my site using http:.(working on my site http://myserver/msftqa/RmMain.aspx) However, the problem comes in when I attempt to connect to the same application using https:(https://mysite.com/msftqa/RmMain.aspx). Now when I attempt to access the methods of the service, I get a

503 Service Unavailable

Inspecting through Firebug reveals that my Svc is attempting to bind using http: instead of https: and is this not able to find the service. Here is the relevent section of the web.config

  <service name="Company.App.RM.RmUiControlDataSVC">
    <endpoint address="" behaviorConfiguration="Company.App.RM.RmUiControlDataAspNetAjaxBehavior"
      binding="webHttpBinding" contract="Company.App.RM.RmUiControlDataSVC" />
  </service>

Is there a way that I can tell the service to use https: when connected through https but still have it work when I connect using http:?

4

1 に答える 1

1

http および https を介して WCF を公開するということは、2 つのエンドポイントが必要であることを意味します。宣言的またはプログラム的に構成できます。

http://netpl.blogspot.com/2010/05/how-to-programmatically-configure-ssl.html

于 2012-04-27T21:18:32.463 に答える