Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# WCF
I am newbie to WCF. I am looking to steps to deploy WCF on IIS and consume the service. I have follow the steps same as to deploy the Website on IIS, also set the default document to Service1.svc
 
Now when I am trying to consume this wcf service it is giving me the following error.
 
Metadata contains a reference that cannot be resolved: http://manish-pc:8000/Service1.svc?wsdl.
The WSDL document contains links that could not be resolved.
There was an error downloading http://manish-pc:8000/Service1.svc?xsd=xsd0.
The underlying connection was closed: An unexpected error occurred on a receive.
Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.
An existing connection was forcibly closed by the remote host
Metadata contains a reference that cannot be resolved: http://localhost:8000/Service1.svc.
Content Type application/soap+xml; charset=utf-8 was not supported by service http://localhost:8000/Service1.svc.  The client and service bindings may be mismatched.
The remote server returned an error: (415) Cannot process the message because the content type ;application/soap+xml; charset=utf-8 was not the expected type text/xml; charset=utf-8..
If the service is defined in the current solution, try building the solution and adding the service reference again
 

Following is my Service web.config details
<system.serviceModel>
    <services>
      <service behaviorConfiguration="DemoWCF.Service1Behavior" name="DemoWCF.Service1">
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:8000/Service1.svc"/>
          </baseAddresses>
        </host>
        <endpoint address="http://localhost:8000/Service1.svc"
                  binding="basicHttpBinding"
                  contract="DemoWCF.IService1"
                  bindingConfiguration="basicBinding">
          <identity>
            <dns value="localhost"/>
          </identity>
        </endpoint> 
        <endpoint address="mex" 
                  binding="mexHttpBinding" 
                  contract="IMetadataExchange" />
      </service>
    </services>
    
    <bindings>
      <basicHttpBinding>
        <binding name="basicBinding" textEncoding="utf-8"></binding>
      </basicHttpBinding>
    </bindings>
    
    <behaviors>
      <serviceBehaviors>
        <behavior name="DemoWCF.Service1Behavior">
          <serviceMetadata httpGetEnabled="True" />
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>
 
Please guide me.
Thanks.
Posted 6-Feb-13 0:44am
Edited 6-Feb-13 1:08am
v3

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

After search on google and watching videos. Finally I got the solution.
 
This error occur due to IIS configuration that I was not bother about.
 
open your IIS Manager console.
1. Make a separate applicaiton pool.
a). Set .NET Framework version to 4.0
b). Managed pipeline mode : Classic
2. Set Applicaiton Pool Identity to "LocalSystem".
3. Follow the steps same as to deploy a web application on IIS like creating a Virtual
Directory.
4. Create the Virtual Directory set that Application Pool you have created.
5. And consume the WCF Service in Client application.
 
Click here to watch the video
 
Kindly Update this question / answer thread, if you find more about this.
Thanks Smile | :)
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 410
1 Sergey Alexandrovich Kryukov 329
2 Afzaal Ahmad Zeeshan 264
3 BillWoodruff 235
4 CPallini 195
0 OriginalGriff 5,560
1 DamithSL 4,476
2 Maciej Los 3,942
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,175


Advertise | Privacy | Mobile
Web01 | 2.8.141216.1 | Last Updated 8 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100