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

RE: web service API returning HTML rather than SOAP 1.2

From: Lori Hylan-Cho <lorihc@adobe.com>
Date: Fri, 13 Jul 2007 07:51:48 -0700
Message-ID: <30B7B14B6B558243AA3D7CD7F98D5E7B0190D44F@namail2.corp.adobe.com>
To: <www-validator@w3.org>

Is anyone else using the validator web service API, or is it just me?

I've tried two more tests:

1. I removed the encodeURIComponent() call for the URI case, but it
didn't make a difference (I still got an HTML reply).

2. Pasting
http://validator.w3.org/check?uri=http://www.avocado8.com/index.shtml&ou
tput=soap12 directly into the browser gives the correct SOAP result, so
it doesn't seem to be anything inherent to passing a URI.

By default my JavaScript function posts the data with an
application/x-www-form-urlencoded content type. Should I be forcing a
different content type in the URI case?

> -----Original Message-----
> From: www-validator-request@w3.org 
> [mailto:www-validator-request@w3.org] On Behalf Of Lori Hylan-Cho
> Sent: Monday, July 09, 2007 1:08 PM
> To: www-validator@w3.org
> Subject: web service API returning HTML rather than SOAP 1.2
> Importance: High
> 
> 
> hello
> 
> I am experimenting with the validator's web service API, and I've
> noticed that while I can get a SOAP 1.2 reply for HTML fragments, if I
> validate by URI I always get an HTML reply.
> 
> I'm doing an HTTP post from JavaScript. The function I'm 
> using takes two
> arguments: the URL of the server, and the text to post. For example:
> 
> 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");
> 
> 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 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?
> 
> Thanks in advance for any assistance.
> 
> best,
> Lori
> 
> 
> 
Received on Friday, 13 July 2007 14:52:13 GMT

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