Konfigurieren von WCF 4 mit routing (global.asax) für http & https-Endpunkte

Ich bin noch ein Neuling mit wcf und nicht allzu gut informiert .net im Allgemeinen. Ich habe einen WCF 4 web-service verwendet die global.asax das routing Ansatz und sehr vereinfachte web.config mit den standard-Endpunkt-Methode. Diese wcf-Dienst ausgeführt wird, eine Anwendung mit der Standard-web-site auf iis 7.5 zu präsentieren. Ich brauche es unterstützt sowohl http-und https-Schnittstellen, wenn möglich. Wenn das zu Komplex ist dann nur https. Wie ist das am besten behandelt Beibehaltung des derzeitigen Ansatzes?

Den Inhalt der global.asax.cs und web.config-Dateien sind ziemlich einfach:

public class Global : HttpApplication
{
    void Application_Start(object sender, EventArgs e)
    {
        RegisterRoutes();
    }

    private void RegisterRoutes()
    {
        //Edit the base address of Service1 by replacing the "ippay" string below
        RouteTable.Routes.Add(new ServiceRoute("myservice", new WebServiceHostFactory(),   
typeof(myservice)));     
    }
}


<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
<standardEndpoints>
<webHttpEndpoint>
     <standardEndpoint name="" helpEnabled="true"    contentTypeMapper="myservice.Util.RawMapper,myservice">
        </standardEndpoint>
  </webHttpEndpoint>
</standardEndpoints>

  • Hast du jemals eine Antwort finden?
InformationsquelleAutor Jeff Maier | 2010-06-16
Schreibe einen Kommentar