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

Collapse
Posted by Malte Sussdorff on
I like the idea of having the prefix default to tns: if the namespace is actually the target namespace and your fix just does that. I assume (and here I have to wait for the partners tomorrow, as we are in Europe and it is late already) that this is fixing the issue Eclipse has been having as well, as they had been able to parse correctly your code at junom.com. Thanks for that simple fix.

As for naming the schema using "<ws>namespace schema ::projectm "http://e4.cognovis.biz/twsdl/projectmanager" ", I remembered it not adding an additional xmlns::projectm="..." to the definitions, just setting the targetNamespace differently. (Look at the source code of http://e4.cognovis.biz/twsdl/wsapi/stockquoter/?WSDL which is using your example). Sadly this still is an issue Eclipse is choking at (but do not ask me why...). So, if you could add the first call (adding the Namespace as an xmlns: definition) when doing the second (defining a custom schema), I assume it would work. Though I think for most implementations the fix you provided should be just fine.

One thing in your posting caught my attention.

"wsdlpull does not understand renaming of simpleTypes, at least within the same namespace. The problem will go away because the renaming isn't necessary anymore."

I was wondering about that. If I use <ws>proc ::projectm:GetTask {task_id:integer}, you are creating the custom "simpleType" with the name "project_id" and the base="xsd:integer". When I (during testing) made sure that not the custom type but the original xsd:integer was used as the type in the xsd:element, it worked. Obviously that is not a  solution if you want to have further restrictions like enumeration or patterns. But for strictly the simple types I don't think you need to create a custom simpleType, but again, I haven't read the specs thoroughly enough to say that is allowed by the standard. I can only speak for wsdlpull behaviour in this particular instance.

Collapse
Posted by Tom Jackson on
"As for naming the schema using "&lt;ws&gt;namespace schema ::projectm "http://e4.cognovis.biz/twsdl/projectmanager"; ", I remembered it not adding an additional xmlns::projectm="..." to the definitions,..."

You are right, it doesn't fix the bug, it replaces the default targetNamespace with your choice. Note that a lot of defaults exist as variables in &lt;ws&gt;namespace.

The problem with wsdlpull is that there is another layer of derivation for the types which it isn't handling correctly by wsdlpull. I believe the schema is correct. One way to test is to remove the intermediate type and point directly to the global simpleType. I'm guessing, but I think that wsdlpull is interpreting the definition as empty:

&lt;xsd:simpleType name="DayNumber"&gt;
    &lt;xsd:restriction base="tns:dayNumber"/&gt;
&lt/xsd:simpleType&gt;