我发现有一个 API W3C的标记验证。
我早先问:Is有一个.NET库对W3C标记验证API?
阿萨夫的answer:
这个API是基于SOAP的。如果你想 用它在.NET应用程序,你可以 只需添加Web引用和code 反对。看起来很简单, 它基本上是一个包含一个方法的API ...
所以,我试图添加服务引用在地址 http://validator.w3.org/check
。
首先,对话框显示:
请等待服务信息 下载...
然后:
这是错误...发生在尝试 找到服务, http://validator.w3.org/check
错误的详细信息:
HTML文档不包含Web 服务发现信息。 元数据包含一个引用 不能得到解决: http://validator.w3.org/check 。该 内容类型text / html;字符集= UTF-8 的响应消息不匹配 结合的内容类型 (应用程序/肥皂+ XML;字符集= UTF-8)。 如果使用自定义的连接codeR,一定 该IsContentTypeSupported方法 正确实施。第一 1024字节的响应是:
<!DOCTYPE HTML PUBLIC - // W3C // DTD XHTML 1.0 Strict标准// EN
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> < HTML的xmlns =http://www.w3.org/1999/xhtmlXML:LANG =ENLANG =EN> < HEAD>
< META HTTP-当量=Content-Type的CONTENT =text / html的;字符集= UTF-8/>
<冠军>
验证结果 - W3C标记验证器/标题>
<链接相对=图标 href="data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%10%00%00%00%10%08%02%00%00%00%90%91h6%00%00%00%19IDAT(%91c%BCd%AB%C2%40%0A%60%22I%F5%A8%86Q%0DCJ%03%00%DE%B5%01S%07%88%8FG%00%00%00%00IEND%AEB%60%82" TYPE =图像/ PNG/>
<链接REV =制作的href =邮寄地址:www-validator@w3.org/>
<链接REV =开始的href =./称号=首页/>
<风格类型=文本/ CSS媒体=所有> @import./style/base.css;
@import./style/results.css";</style>
&LT; META NAME =关键词内容=HTML,超文本标记语言,验证,
W3C标记验证服务/&GT;
&LT; META NAME =说明内容=W3C的易于使用的
H
如果该服务的定义 目前的解决办法,尝试建立 溶液和添加的服务 再次参考
我如何使用W3C标记验证API在我的.net应用程序?
解决方案W3C的服务是没有标准的SOAP服务!它可以给一个SOAP格式的响应,但把它称作是一个sinple REST基于URL的服务 的http://validator.w3.org/check?uri=YourURLToProof&charset=utf-8&output=soap12
I found that there's an API for the W3C Markup Validator.
I had earlier asked: Is there a .NET library for the W3C Markup Validator API?
Assaf's answer:
This API is SOAP based. If you want to use it in a .net application you can just add the web reference and code against it. Seems simple enough as it's basically a one-method API...
So, I tried to "Add Service Reference" at address http://validator.w3.org/check
.
First the dialog displays:
Please wait for service information to be downloaded...
Then:
An error ... occurred while attempting to find services at 'http://validator.w3.org/check'
Error details:
The HTML document does not contain Web service discovery information. Metadata contains a reference that cannot be resolved: 'http://validator.w3.org/check'. 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 PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<title>
Validation Results - W3C Markup Validator</title>
<link rel="icon" href="data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%10%00%00%00%10%08%02%00%00%00%90%91h6%00%00%00%19IDAT(%91c%BCd%AB%C2%40%0A%60%22I%F5%A8%86Q%0DCJ%03%00%DE%B5%01S%07%88%8FG%00%00%00%00IEND%AEB%60%82" type="image/png" />
<link rev="made" href="mailto:www-validator@w3.org" />
<link rev="start" href="./" title="Home Page" />
<style type="text/css" media="all">@import "./style/base.css";
@import "./style/results.css";</style>
<meta name="keywords" content="HTML, HyperText Markup Language, Validation,
W3C Markup Validation Service" />
<meta name="description" content="W3C's easy-to-use
H
If the service is defined in the current solution, try building the solution and adding the service reference again.
How can I use the W3C Markup Validator API in my .NET application?
解决方案The W3C Service is no standard SOAP Service! It can give a SOAP formatted response but to call it's a sinple REST URL based Service http://validator.w3.org/check?uri=YourURLToProof&charset=utf-8&output=soap12