[fossil-users] JSON API and WSDL

2011-09-14 Thread Stephan Beal
Hi, all,

It would be cool if the JSON API had a way to serve a WSDL of its API. i'm
looking to pick someone's brain about WSDL, namely regarding:

a) Is WSDL intended only for SOAP (in which case it is not interesting
here)?
b) Does anyone know of a JSON-format WSDL-like language?

What i'd like to eventually have is:

http://my.fossil-server.org/json/

which would fetch the WSDL[-like] description of the API, which the client
could then use to automatically generate an object-oriented implementation
class. e.g. PHP can use a WSDL to generate (at runtime) classes which
reflect arbitrary SOAP interfaces.

:-?

-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] JSON API and WSDL

2011-09-14 Thread Martin S. Weber

On 09/14/11 11:21, Stephan Beal wrote:

Hi, all,

It would be cool if the JSON API had a way to serve a WSDL of its API.
i'm looking to pick someone's brain about WSDL, namely regarding:

a) Is WSDL intended only for SOAP (in which case it is not interesting
here)?


See section 4 [1] of the WSDL spec [2]. Short: there do exist http get/post 
bindings for WSDL; there is support for mimetypes, and thus application/json 
application/x-javascript text/javascript text/x-javascript (take your pick or 
use something completely different ;))


[1] http://www.w3.org/TR/wsdl#_http
[2] http://www.w3.org/TR/wsdl

-Martin
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] JSON API and WSDL

2011-09-14 Thread Stephan Beal
On Wed, Sep 14, 2011 at 5:40 PM, Stephan Beal sgb...@googlemail.com wrote:

 On Wed, Sep 14, 2011 at 5:31 PM, Martin S. Weber martin.we...@nist.govwrote:

 [1] http://www.w3.org/TR/wsdl#_**http http://www.w3.org/TR/wsdl#_http
 [2] http://www.w3.org/TR/wsdl


 Thank you very much :). i'll go get myself more informed on the topic...


If i'm understanding correctly, WSDL requires that parameters passed to the
server be form-urlencoded. That's not fundamentally a problem, but there is
a current conflict of interest regarding who (fossil's core or the JSON
bits) gets to parse the POST data (which we can only do once unless we
buffer it into a Blob first). The current heuristics are:

a) If the Content-Type of the request is application/json or text/plain then
the json/cgi bits try to parse it as JSON. This makes it unavailable to
fossil, as the json/cgi init bits must be run before fossil initializes its
side of the CGI environment (because parts of the fossil internals - namely
error reporting - now account for JSON mode and output a JSON error
object).

b) if the Content-Type is form-urlencoded or one of the fossil-specific
types then fossil gets to process it.

c) If we don't know the Content-Type then we ignore (neither consume nor
parse) the POST data.

This works so far, but will fail once we allow the JSON API to read
form-urlencoded data (which it has code to do but it currently does do so
not because that would interfere with (=completely break) ALL of
fossil's POSTed form handling).

In order to resolve this conflict of interests i need to add some code to
the json/cgi bits (an external/independent library) to allow delayed reading
of the POST data (it is currently done automatically at lib-init time, which
ends up preempting fossil), so that the fossil code can properly decide who
to feed the POST data to.

Anyway... that's certainly more than anyone really wanted to know.

-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] JSON API and WSDL

2011-09-14 Thread Stephan Beal
On Wed, Sep 14, 2011 at 5:31 PM, Martin S. Weber martin.we...@nist.govwrote:

 [1] http://www.w3.org/TR/wsdl#_**http http://www.w3.org/TR/wsdl#_http
 [2] http://www.w3.org/TR/wsdl


To follow up:

http://tools.ietf.org/html/draft-zyp-json-schema-03

looks interesting (but i need to finish reading it).

And WSDL 2.0 apparently accounts for non-XML representations:

http://www.ibm.com/developerworks/webservices/library/ws-restwsdl/

They mention JSON as an alternative, but it's not yet clear to me whether
there actually is an example of a JSON variant out there and whether or not
it could be used for this purpose.

-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users