Web服务引用错误 [英] web service reference error

查看:96
本文介绍了Web服务引用错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

引用Web服务时出现以下错误。



HTML文档不包含Web服务发现信息。

元数据包含一个无法解析的引用:''http:// localhost:60789 / AppService.asmx''。

内容类型text / html;响应消息的charset = utf-8与绑定的内容类型不匹配(application / soap + xml; charset = utf-8)。如果使用自定义编码器,请确保正确实现IsContentTypeSupported方法。响应的前1024个字节是:

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:

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head meta-charset="utf-8" /></title>



如果在当前解决方案中定义了服务,尝试构建解决方案并再次添加服务引用。



它在客户端也显示语法错误。

没有看到启动标记首先是doctype。预期< doctype!> html






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"


<@!--

  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

推荐答案

Hi
在Web.config文件的标题中。



请务必以下列开头:





看起来响应正在尝试与您在App / webb中编写的编码相匹配。



请检查您的项目是否超过ISO-8859-1编码或UTF-8





检查WSDL是否显示此编码

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
http://localhost:60789/AppService.asmx?WSDL







其他方式可能是Web服务App ..未正确配置



来自墨西哥的问候。




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

Regards from Mexico.


这篇关于Web服务引用错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆