Forum OpenACS Development: Re: Tcl Web Services Toolkit: TWiST

Collapse
Posted by Tom Jackson on
Malte,

Maybe your interest is in fixing stuff instead learning of how TWiST works? There are no known bugs, at least with the things you are talking about. Please stop making requests for code changes until you actually get this installed. TWiST is a simplified API on top of tWSDL. tWSDL is an attempt to satisfy the requirements of the WS-I Basic Profile for web services, it is not an attempt to satisfy you or the OpenACS community. Therefor the way things work, has a lot to do with the WS-I Basic Profile. Criticisms directed at the functional requirements are appreciated, those directed to a matter of preference are not.

Personally I think it is cool that an unrelated tool (wsdlpull, etc.) can grab a wsdl file generated by TWiST and construct C++ code to create a SOAP request and parse the result document. It is cool that for simple types, and enumerations it can validate inputs prior to sending. But this is not software that does everything, or should do everything. Type definition is a great example. Types are constructed according to the way they are derived in XML-Schema. The reason is obvious: in order to build a validation script inside a client, or server, you have to know how the types are derived from the basic types. Patterns are regular expressions, because that is what they are in XML-Schema. If you are uninterested in type definition, type validation, etc, then don't use WSDL, that is the whole point.

But it is not cool to have an application which satisfies some short term interest at the expense of interoperability. Anyone wishing to hack on tWSDL or TWiST should read all of the documentation first, and the references, especially those listed in:

http://twsdl.googlecode.com/svn/trunk/packages/doc/www/current-standards.html

Otherwise very many misunderstandings will result.

Collapse
Posted by Malte Sussdorff on
Thanks for pointing out that the code works on your website. I got this and as mentioned before, it works on mine as well 😊. Sadly, the difference is this:

noname:~ malte$ wsdl http://junom.com/ws/datetime/?WSDL
1.AddDurationToDateTimeOperation
2.CheckDateTimeOperation
3.DayNameFromNumberOperation
Choose one of the above operations [1-3] :3
DayNumber: 2
Incorrect input value 2
noname:~ malte$

On my system, after appying a change to /datetime/index.tcl as mentioned above it looks like this:

noname:~ malte$ wsdl http://e4.cognovis.biz/twsdl/wsapi/datetime/?WSDL
1.AddDurationToDateTimeOperation
2.CheckDateTimeOperation
3.DayNameFromNumberOperation
Choose one of the above operations [1-3] :3
DayNumber: 2
DayName:Wednesday

noname:~ malte$

Now, if you say that "wsdl" from "wsdlpull" is not a program to use for your code, then this is fine, but it was mentioned by you, so I do assume that I can use it for testing purposes.

Collapse
Posted by Malte Sussdorff on
I am not sure how you manage to come to the conclusions what I am interested in or what I suspect TWiST to do. Obviously it is not written to satisfy my needs, how could it, after all I have not voiced them before actually using the software.

What I am interested though is understanding how I can export pm::task::new as a webservice, so I could use e.g. wsdl to create a new task. That is my ultimate goal, and this is why I am asking all those questions which I hope you will answer eventually, unless you say it is all obvious from the documentation, then I will admit defeat and humbly ask you where it is answered in the documentation (as I read through a lot and might have missed it).

Last but not least, I have not intention to hack on tWSDL or TWiST. Unless you define exchanging "proc" with "ad_proc" for your proc definitions as hacking. And you made your wishes *very* clear and I respect that. Still I feel the installation and documentation could be improved, what you make of that is entirely up to you, this is *my* personal opinion and not meant as an insult.

Collapse
Posted by Malte Sussdorff on
More things I noticed while doing the < ws > approach:

1) The Service Description does not get updated. I guess this is because of "

# eventually must add check to delete prior namespace and wsdb code
# also might put in variable to freeze additional changes (better word?)
# this 'freeze' would operate in <ws>proc as well to silently abort and log event" in <ws>namespace init ?

Either way, rediting, I found out that I need to unfreeze my namespace 😊. So I assume that, when I want to change your demo code, I need to make sure to either not freeze the namespace or at least unfreeze it before working on it.

2) I cannot use xsd:: types directly but have to make a type declaration first. Though I am not sure why in your example for stockQuoter you have been generating identical types (::quote, ::dailyMove, ::lastMove). What am I missing here? Wouldn't it be enough to just define stock::float and then use that for the sequence definition? I mean, it worked when I tested it, but maybe there is a deeper meaning behind it which I am unaware of yet.

3) I found the documentation (more or less) for the < ws> functions. Not linked from anywhere, but it seems autogenerated using the man command. I linked it up at http://e4.cognovis.biz/twsdl/doc/api-index.html.

4) I might be wrong, but does < ws>proc check if the data type returned matches the value? I am not sure if it should, but I would probably prefer a server error on my machine than on the querying machine in case the returned type does not match the definition of the to be returned type (as an example, take the dateTime example. If you set the dateTime manually to "TWiST" then it is still returned and I could not find any error /Notice that what I was returning was not of the datetype specified.

5) How can I give a default value that does not have to be filled in. Or, lets be precise, how can I test it? I tried with the stockQuoter example of yours not to pass in the "verbose" value and failed, both with wsdl as well as the web interface. At the moment I have to fill it in, regardless what it says in the definition and this makes me wonder where the trick is.