Gajendra Jangid

Gajendra Jangid

  • 28
  • 41.2k
  • 2.2m

Error: Cannot obtain Metadata from WCF service

Jan 28 2018 4:45 AM
Error: Cannot obtain Metadata from WCF service

Answers (2)

1
Sagar  Pandurang Kap

Sagar Pandurang Kap

  • 0
  • 11.6k
  • 67.1k
Jan 28 2018 11:00 PM
Hi,
 
<serviceBehaviors> <behavior name="MEX"> <serviceMetadata/>
</behavior> </serviceBehaviors>
 
Add above lines in Web.config.
 
Hope it helps..
0
Mageshwaran R

Mageshwaran R

  • 0
  • 10.8k
  • 1.1m
Nov 12 2019 10:48 PM
Hi,
 WebConfig[WCF]: 
  1. <?xml version="1.0"?>  
  2. <configuration>  
  3. <connectionStrings>  
  4.   <add name="Json_ConnectionString" connectionString="Data Source="ConnectionString"/>  
  5. </connectionStrings>  
  6.   <appSettings>  
  7.     <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />  
  8.   </appSettings>  
  9.   <system.web>  
  10.     <compilation debug="true" targetFramework="4.6.1" />  
  11.     <httpRuntime targetFramework="4.6.1"/>  
  12.   </system.web>  
  13.   <system.serviceModel>  
  14.     <behaviors>  
  15.       <serviceBehaviors>  
  16.         <behavior name="BehaviourName">  
  17.           <!-- To avoid disclosing metadata information, set the values below to false before deployment -->  
  18.           <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>  
  19.           <!-- 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 -->  
  20.           <serviceDebug includeExceptionDetailInFaults="false"/>  
  21.         </behavior>  
  22.       </serviceBehaviors>  
  23.       <endpointBehaviors>  
  24.         <behavior name="Web">  
  25.           <webHttp/>  
  26.         </behavior>  
  27.       </endpointBehaviors>  
  28.     </behaviors>  
  29.     <services>  
  30.       <service behaviorConfiguration="BehaviourName" name="Service.Service">  
  31.         <endpoint   behaviorConfiguration="Web" binding="webHttpBinding"  
  32.           contract="Service.IService" />  
  33.       </service>  
  34.     </services>  
  35.     <protocolMapping>  
  36.         <add binding="basicHttpsBinding" scheme="https" />  
  37.     </protocolMapping>      
  38.     <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />  
  39.   </system.serviceModel>  
  40.   <system.webServer>  
  41.     <modules runAllManagedModulesForAllRequests="true"/>  
  42.     <!--  
  43.         To browse web app root directory during debugging, set the value below to true.  
  44.         Set to false before deployment to avoid disclosing web app folder information.  
  45.       -->  
  46.     <directoryBrowse enabled="true"/>  
  47.   </system.webServer>  
  48.   
  49. </configuration>