Click here to Skip to main content
15,886,137 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am getting the following error while referencing web service.

The HTML document does not contain Web service discovery information.
Metadata contains a reference that cannot be resolved: 'http://localhost:60789/AppService.asmx'.
The content type text/html; charset=utf-8 of the response message does not match the content type of the binding (application/soap+xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 1024 bytes of the response were:
HTML
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head meta-charset="utf-8" /></title>

If the service is defined in the current solution, try building the solution and adding the service reference again.

it is also showing syntax error on client side.
"start tag seen without a doctype first. Expected <doctype!> html"

[Edit TakenFrom ="OP's Comment"]
XML
<@!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  --@>
<configuration>

  <connectionstrings>
    <add name="ConnStringAppStore" connectionstring="Data Source=DIN16000635;Initial Catalog=AppStore;Integrated Security=True;User ID=sa;Password=ccIndia@123" providername="System.Data.SqlClient">
  </add></connectionstrings>
  <system.web>
    <compilation debug="true" targetframework="4.0">
      <assemblies>
        <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A">
        <add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
        <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089">
      </add></add></add></assemblies>
    </compilation>
    <httpruntime>
    <authentication mode="Forms">
      <forms loginUrl="Login.aspx"/>
    </authentication>
    <authorization>
      <deny users="?">
    </deny></authorization>
  </httpruntime></system.web>
  <system.servicemodel>
    <behaviors>
      <endpointbehaviors>
        <behavior name="AppStore.MyAppServiceAspNetAjaxBehavior">
          <enablewebscript>
        </enablewebscript></behavior>
      </endpointbehaviors>
    </behaviors>
    <servicehostingenvironment aspnetcompatibilityenabled="true" multiplesitebindingsenabled="true">
    <services>
      <service name="AppStore.MyAppService">
        <endpoint address="" behaviorconfiguration="AppStore.MyAppServiceAspNetAjaxBehavior" binding="webHttpBinding" contract="AppStore.MyAppService">
      </endpoint></service>
    </services>
  </servicehostingenvironment></system.servicemodel>
</configuration>


[/Edit]

what can be solution for this.
Thanks in Advance
Posted
Updated 29-May-13 6:14am
v7
Comments
KK Kod 29-May-13 2:56am    
Did you created proxy for the service ..if so how . using which tool ?
KK Kod 29-May-13 2:59am    
IS that web service working fine...?
are you getting WSDL for the service ..?
Try Down load SOAPUI which is a free service testing tool which is free then test the service if its working fin e.
rahul-4u 29-May-13 3:26am    
i am using vs 2012. when browsing web service its showing correct result
Please post the web.config code here.
Can you try giving the relative URL of the Service as the endpoint address like below...

<endpoint address="AppService.asmx" behaviorconfiguration="AppStore.MyAppServiceAspNetAjaxBehavior" binding="webHttpBinding" contract="AppStore.MyAppService">

If the service is in the same directory as the web.config, then just add like this, otherwise calculate the correct path and put in address attribute.

1 solution

Hi In the header of Web.config file.

Be sure that begin with:


It Appear that the response is trying to match with your encoding wrote in your App/webb.

please review if your project is over ISO-8859-1 encoding or UTF-8

Or
check if the WSDL show you this encoding
HTML
http://localhost:60789/AppService.asmx?WSDL



Other way could be that the Web service App.. is not Configured Properly

Regards from Mexico.
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900