TML documents do not contain web service discovery information.

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.