[cap-talk] (was: network level designation and authorization (RANT))
Sandro Magi
smagi at naasking.homeip.net
Fri Jun 9 10:24:08 EDT 2006
I'm CC'ing the waterken list for documentation purposes.
John Carlson wrote:
> On Jun 8, 2006, at 6:25 AM, Sandro Magi wrote:
>
>> Only XML is required if you're using custom client software.
>>
> Are the parameter names to be passed back to the server in a POST
> or a GET available in the XML?
>
> I am looking at
> https://localhost/http/yurl.org/Publisher-anoint
Public link:
http://yurl.net/http/yurl.org/Publisher-anoint
> I see
>
> super
> Parameters: http://web-calculus.org/string/String
> The address space label.
> http://web-calculus.org/Integer
> The base 2 log of the maximum number of exported capabilities.
>
> Thus, it is very plain what the types of the parameters are, but I don't
> see the names anywhere?????
>
> Are the names: 0, 1, 2, 3... please tell me!
I understand your confusion now. This description is for a closure, ie.
a function with state. A closure accepts an array of objects as
parameters, whose types are defined by the above schema. So yes, they
are argument positions, not names; the first argument (index=0) is a
string, the second argument (index=1) is an integer. Invoking the
closure with the above parameters returns a http://yurl.org/Expert.
The java method would like:
public class Publisher {
...
public Expert anoint(String param0, Integer param1) {
...
}
}
Clearly the arguments have names in the source, but if you were to use
reflection to inspect this method at runtime
(Method.getParemeterTypes()), the names local to the method are not
accessible, and you can refer to them only by their index. And so it is
in the web-calculus.
> I don't want a customized HTML page, I want the default HTML page that
> shows in my browser, but I can't seem to see anywhere, because I don't
> have or can't find a button for apply XSLT to the view source stuff.
I agree that this can be a little confusing sometimes and I'm not sure
how to set up a pure HTML server instance for the java server. The
supported serialization formats have to do with the initial application
setup. Tyler will have to comment here. The XSLT is referenced in the
XML though, so as a last resort you could apply it manually if you
really wanted to. :-)
> How do I go about writing a serialization format?
You'd have to look through org.waterken.stream.output.Serializer to find
where the serialization format is specified. I'm not sure if/how to
plug-in a new format in the java server, only that it can be done.
> XML would be fine
> if it contained the parameter names. So I would know what to send back
> to the server.
It operates just as if you were invoking a function via reflection: pass
in each parameter in the order in which it appears in the definition.
If you send an XML doc to the waterken server in a POST request, then
this should be straightforward (see below if this isn't clear). If
you're sending the parameters in 'application/x-www-form-urlencoded'
format (the format web browsers use for form submissions), then the
parameters are encoded. It's been awhile since I wrote the C# code for this:
http://svn.sourceforge.net/viewcvs.cgi/web-calculus/trunk/WebCalculus/Http/FormUrlEncodedMarshal.cs?view=markup&rev=59
but I think the format is:
doc.X-node.schema=Y&doc.X-node=Z
where:
X=index of parameter, ie. 0, 1, 2, ...
Y=web-calculus type corresponding to Z.getClass()
Z=parameter value being passed in
So invoking:
Publisher.anoint("some random string", 100000);
would look like:
doc.0-node.schema=http%3A%2F%2Fweb-calculus.org%2Fstring%2FString&doc.0-node=some+random+string&doc.1-node.schema=http%3A%2F%2Fweb-calculus.org%2FInteger&doc.1-node=100000
> I have a feeling the parameter names are in the XSLT, and they are named
> something like doc.0, doc.1, doc.2. I would just like some
> confirmation, or
> an admittance that no one has a clue what the parameters are named.
Hope the above clarifies things for you.
> I think you're admitting that you are required to write XSLT in order
> to get
> parameter names. Thus I am stuck writing XSLT on the server, when all
> I want to do is write a client.
If you look at the bottom of:
http://www.waterken.com/dev/Web/HTTP/
you'll see there are example request/response exchanges purely in XML,
so no XSLT is required. For the above Publisher.anoint(), I think the
HTTP request would look like:
POST /test/?key=bsnb-5skf-p3sm&mid=tm635augvad5tft3l57uchjanq HTTP/1.1
Host: www.example.com
Content-Type: application/xml
Content-Length: ...
<list>
<doc schema="http://web-calculus.org/string/String">some random string</doc>
<doc schema="http://web-calculus.org/Integer">100000</doc>
</list>
but I haven't looked into this in any depth for the .NET implementation
yet, so Tyler will have to weigh in here. Tyler, purely XML
request/response could also use a simple "Hello World!"-style tutorial
too for those writing custom clients.
An extension to the current tutorial invoking a method with multiple
parameters with XML would be sufficiently illustrative I think. :-)
Sandro
> I am starting to think that parameter names are like capabilities in
> waterken...you don't
> want to let anyone know what they are!
>
> That would be fine....then I would know I HAVE to deal with the
> XSLT. You
> are claiming that I don't need XSLT.
>
> John
> _______________________________________________
> cap-talk mailing list
> cap-talk at mail.eros-os.org
> http://www.eros-os.org/mailman/listinfo/cap-talk
More information about the cap-talk
mailing list