W3C home > Mailing lists > Public > www-validator@w3.org > July 2007

Re: web service API returning HTML rather than SOAP 1.2

From: olivier Thereaux <ot@w3.org>
Date: Tue, 17 Jul 2007 07:40:07 +0900
Message-Id: <D0607C5C-B0A3-47A2-844F-49A27B6BA9D4@w3.org>
Cc: <www-validator@w3.org>
To: Lori Hylan-Cho <lorihc@adobe.com>

Hello Lori,



On Jul 10, 2007, at 02:08 , Lori Hylan-Cho wrote:
> var docContents = document.documentElement.outerHTML; /* gets entire
> document source, including !DOCTYPE statement */
> var result = httpPostText("http://validator.w3.org/check",  
> "fragment=" +
> encodeURIComponent(docContents) +"&output=soap12");

This looks reasonable

> In the above case, I get a SOAP reply. However, if I substitute a URL
> instead of raw HTML, as shown below...
>
> var docContents = "http://www.avocado8.com/index.shtml";
> var result = httpPostText("http://validator.w3.org/check", "uri=" +
> encodeURIComponent(docContents) +"&output=soap12");

I am far from being a javascript expert, but shouldn't it be  
encodeURIComponent(location.href) ? It looks like you're sending the  
whole content of the page as a URI parameter, which possibly trips up  
the validator.

> I always get an HTML reply. I've tried encoding the & in front of the
> output argument, but the results are the same. Is there something  
> else I
> should be doing? Have I misunderstood something major?

If the fix suggested above does not have any effect, could you test  
your code on the following instance of the validator?
http://qa-dev.w3.org/wmvs/HEAD/
It is our lastest development version, and it includes a number of  
recent bug fixes to the API.

Thank you.
-- 
olivier
Received on Monday, 16 July 2007 22:39:49 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 25 April 2012 12:14:25 GMT