Thierry Leurent wrote at 2013-11-22 08:20 +0100:
>I must read a SOAP request, add a WS-Security hearder and send it.
>I search in Internet, I found informations about some framework like PyXB
>but never a complete documentation.
>
>I try to understand the PyXB code, but I'm not a expert in Python and in
>SOAP, and I don't understand the code.
"PyXB" does not provide you with WSSE. Its main functionalities:
* generate Python classes corresponding to the types
defined in an XML-Schema
* provide a parser for instances of the XML-Schema (refered to
above) which parse those instances into Python objects
(instances of the classes generated above)
* the instances of the generated classes have a method
to serialize them as instances of the XML-Schema.
To state it differently: starting with an XML-Schema, "PyXB"
generates Python classes and provides a bedirectional mapping between
the corresponding XML documents and Python objects.
WSSE has an associated XML-schema (in fact a set of interacting schemas) -
and "PyXB" comes out of the box with the corresponding Python classes.
This way, you can "do" WSSE by means of Python objects rather than
directly XML documents (or fragments thereof).
This may help quite a bit: you do not need to an XML expert.
However, you still need to know WSSE (at a more abstract level):
you must know which objects are involved, what attributes they have
and how to compute senseful values for them.
>Where can I find samples, doc and any informartions about PyXB, an other
>framework or another way to develop a solution ?
PyXB is very well documented -- when you visit "PyXB" on "pypi"
("https://pypi.python.org/pypi/PyXB/1.2.3"), you see quite prominently
a link "Package Documentation". This link brings you to the "PyXB"
documentation.
However, it will not tell you how to do WSSE with "PyXB".
It tells you how to use "PyXB" for its primary functionality (see above).
I do not know "WSSE" well (therefore, I cannot help you with your
concrete problem). However, I have used "PyXB" to do something
similar for "SAML2". In my case "PyXB" does the mapping between
Python and XML for me. However, I must know "SAML2" well
and I must know XML-DSig (XML based digital signatures)
(I use "dm.xmlsec.binding" (based on "libxmlsec", the XML security library)
to handle the signatures).
I expect that for "WSSE" the case will be similar (if you
do not find an out-of-the-box "WSSE" solution but implement it
yourself on top of "PyXB").
--
Dieter
_______________________________________________
Soap mailing list
[email protected]
https://mail.python.org/mailman/listinfo/soap