TML documents do not contain web service discovery information.
Metadata contains reference that cannot be parsed: "http: // localhost: 6158/WCF-service/service. SVC ".
Service http: // localhost: 6158/WCF-service/service. SVC does not support the content type application/soap + XML; charset = UTF-8. The binding between the client and the Service may not match.
The remote server returns an error (415) unsupported media type.
If the service has been defined in the current solution, try to generate the solution and add the service reference again.
======================================
Solution
The following configuration must be included in the web. config file:
<System. servicemodel>
<Behaviors>
<Servicebehaviors>
<Behavior name = "servicebehavior">
<Servicemetadata httpgetenabled = "true"/>
<Servicedebug includeexceptiondetailinfaults = "false"/>
</Behavior>
<Behavior name = "">
<Servicemetadata httpgetenabled = "true"/>
<Servicedebug includeexceptiondetailinfaults = "false"/>
</Behavior>
</Servicebehaviors>
</Behaviors>
<Servicehostingenvironment multiplesitebindingsenabled = "true"/>
<! -- Create a node for the WCF Service -->
<Services>
<Service behaviorconfiguration = "servicebehavior" name = "service">
<Endpoint address = "" binding = "basichttpbinding" Contract = "iservice">
<Identity>
<DNS value = "localhost"/>
</Identity>
</Endpoint>
<Endpoint address = "mex" binding = "mexhttpbinding" Contract = "imetadataexchange"/>
</Service>
</Services>
</System. servicemodel>
Note that the red part is indispensable. If it is missing, the above error message will appear when adding a service reference.
Category:. Net Encoding Error