Access Cannnot.svc in the RESTFul WCF service deployed to the local IIS web server

I need help, I'm new to the WCF world, having recently migrated from SOAP Webservices.

The WCF service works well when I start the VS2008 ASP.NET Development Server, that is, debug mode. The problem occurs when I try to access the service through IIS.

I installed the website on my local IIS web server hosted on port 8082 ( http: // localhost: 8082 ) and created VirtualDirectory (1.0) which points to the physical directory containing my WCF service code. The website is configured on ASP.NET 2.0.50727. I can get to the landing page, as well as from the assortment of .aspx pages, but when I try to access Service.svc, the browser never gets there and just sits idle.

http://localhost:8082/1.0/Service.svc  

My question is what kind of configuration I am missing to get the service to work from within IIS, since I already know that it works under the development server.

I am attaching part of my web.config if this helps.

    <system.serviceModel>
    <services>
        <service name="Service1" behaviorConfiguration="Service1Behavior">
            <!-- Service Endpoints -->
            <endpoint address="" binding="wsHttpBinding" contract="IService1">
                <!-- 
          Upon deployment, the following identity element should be removed or replaced to reflect the 
          identity under which the deployed service runs.  If removed, WCF will infer an appropriate identity 
          automatically.
      -->
                <identity>
                    <dns value="localhost"/>
                </identity>
            </endpoint>
            <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
        </service>
    </services>
    <behaviors>
        <serviceBehaviors>
            <behavior name="Service1Behavior">
                <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
                <serviceMetadata httpGetEnabled="true"/>
                <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
                <serviceDebug includeExceptionDetailInFaults="true"/>
            </behavior>
        </serviceBehaviors>
    </behaviors>
</system.serviceModel>
+3
source share
2 answers

RESTful, wsHttpBinding.... REST - "webHttpBinding".

WCF SOAP - , webHttpBinding, SOAP, wsHttpBinding RESTful , . , , , SoapUI - WcfTestClient Visual Studio.

XML , URL.

+1

Source: https://habr.com/ru/post/1721329/


All Articles