Burak,

In parallel with writing the documentation for input validation in
rpclib, I am trying to apply rpclib to solve the problem that brought
me to this list in the first place.

I began creating my custom types and I ran into some cases which don't
seem to be straightforward.



One of the types looks like this

<xs:complexType name="DigestAlgAndValueType">
        <xs:sequence>
        <xs:element name="DigestMethod" type="ds:DigestMethodType" 
minOccurs="0"/>
        <xs:element name="DigestValue" type="ds:DigestValueType"/>
        </xs:sequence>
</xs:complexType>


ds:DigestMethodType is in another namespace, the link to which is
given in the beginning of the WSDL file. If I understand things
correctly, I have to create a custom class for DigestMethodType and
override its __namespace__ = 'ds'. Can you confirm that?

(1) It is also necessary to modify the top of the generated WSDL file
and include a link to the document that defines the 'ds' namespace.
How to do that? I supposed I could also override the namespace with a
URL to the XML file itself, but is that a good practice?



DigestMethodType itself is a tricky beast, this is the definition:
http://xml.fmi.fi/namespace/woml/swo/2011/11/15/index790.html

<complexType name="DigestMethodType" mixed="true">
  <sequence>
    <any namespace="##other" processContents="lax" minOccurs="0"
maxOccurs="unbounded"/>
  </sequence>
  <attribute name="Algorithm" type="anyURI" use="required"/>
</complexType>

(2) how does rpclib handle 'namespace="##other"'? My understanding is
that it means I can add an arbitrary number of elements of any type.
The closest match I could find is AnyXml or AnyDict (declared in
primitive.py). However, I am not sure how to use it; test_primitive.py
doesn't cover these two classes.

(3) 'use="required"' - the 'use' attribute is not declared in the
AnyUri class, neither in Unicode or SimpleModels (the classes from
which it was derived). It seems to be a basic attribute; was I unable
to find it? Or is it really not there?

(4) 'mixed' is another attribute that I didn't find declared in the
base class of the ComplexType class? Does one really need it? I mean,
maybe it is assumed that all the ComplexType children are mixed by
default?



There's another data type with the poetic name 'DataType' :-)

<xs:complexType name="DataType">
        <xs:simpleContent>
                <xs:extension base="xs:string">
                        <xs:attribute name="MimeType" type="xs:string" 
use="optional"/>
                        <xs:attribute name="Encoding" type="xs:string" 
use="optional"/>
                </xs:extension>
        </xs:simpleContent>
</xs:complexType>


I've seen how to declare elements and attributes in a custom type, but
this is something new to me. It feels like some kind of inheritance,
so:

(5) How to declare such a type?


I will update the documentation and add some examples of this as soon
as I figure it out myself.

Alex
_______________________________________________
Soap mailing list
[email protected]
http://mail.python.org/mailman/listinfo/soap

Reply via email to