Yes, you are correct about one thing: projectm shows up as a prefix in the xml schema. However, your fix does not remove this prefix. I noticed this issue when looking into the wsdlpull issue. However, as you noted yourself, my example site doesn't work with wsdlpull either. But it also doesn't have the extra prefix. (This is a slightly older version than the trunk code):
http://junom.com/ws/datetime/?WSDL
So what is the bug? TWiST creates a mapping of the xml namespace to the prefix of your choice. However, it fails to trim off the leading ::, it passes ::projectm to tWSDL when creating the map. That is probably the bug. However, tWSDL could just trim this, because the leading : are illegal. So in the future, if another user API is developed, if the same mistake is made, the mapping will still work.
Now, during writing the WSDL file, the targetNamespace is your xml namespace. When you include types which are in the targetNamespace, the prefix is replaced with 'tns'. If an incorrect map is used, the replacement doesn't take place.
In the future, multiple namespaces will be supported, and this will be handled by creating another schema in the wsdl file and importing it into the targetNamespace. But, the schema for the targetNamespace will always use either the tns prefix or the built in xml-schema namespace.
The wsdlpull issue is a problem with wsdlpull, not TWiST. The problem will go away with the next update. Hopefully very soon. 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 plan, eventually, on moving to a directed graph construction to plan the order of writing out xml schemas, but an intermediate solution is on the way.
Your current fix with the lappend is not actually evil, just in the incorrect place. I think you can achieve the same effect by setting:
::wsdb::definitions::projectmServer::definitions::.ATTRS(xmlns:projectm)
to the targetNamespace. This will only affect the projectm wsdl.
You can also set the targetNamespace instead of accepting the default 'urn:tcl:yourns':
<ws>namespace init ::stock
<ws>namespace schema ::stock "http://junom.com/stockquoter";
But a simple fix is here:
in wsdl/tcl/wsdl-schema-procs.tcl
in proc ::wsdl::schema::new, add a trim of schemaAlias:
if {!$initialized} {
initDatabase
}
# trim schemaAlias for buggy user APIs
set schemaAlias [string trim $schemaAlias :]