Re: web service API returning HTML rather than SOAP 1.2

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 UTC