Hello list,

I'm quite new to PyXB and I'm looking forward for the porting to Python 3.

Meanwhile I've got an issue with soap 1.2 faults, is the 'tns' namespace
magic or something ?:

from pyxb.bundles.wssplat import soap12

resp="""<{0}:Envelope xmlns:{0}="http://www.w3.org/2003/05/soap-envelope";>
    <{0}:Body>
        <{0}:Fault>
            <{0}:Code>
                <{0}:Value>{0}:Sender</{0}:Value>
            </{0}:Code>
            <{0}:Reason><{0}:Text xml:lang="en">Reason
test</{0}:Text></{0}:Reason>
        </{0}:Fault>
    </{0}:Body>
</{0}:Envelope>"""

soap12.CreateFromDocument(resp.format('tns'))
print 'OK for tns'
soap12.CreateFromDocument(resp.format('anything'))

The CreateFromDocument works with 'tns' but not with 'anything' that fails
with:
pyxb.exceptions_.SimpleFacetValueError: Type {
http://www.w3.org/2003/05/soap-envelope}faultcodeEnum enumeration
constraint violated by value anything:Sender

Am I missing something ?

Regards,
Xavier
from pyxb.bundles.wssplat import soap12

resp="""<{0}:Envelope xmlns:{0}="http://www.w3.org/2003/05/soap-envelope";>
    <{0}:Body>
        <{0}:Fault>
            <{0}:Code>
                <{0}:Value>{0}:Sender</{0}:Value>
            </{0}:Code>
            <{0}:Reason><{0}:Text xml:lang="en">Reason test</{0}:Text></{0}:Reason>
        </{0}:Fault>
    </{0}:Body>
</{0}:Envelope>"""

soap12.CreateFromDocument(resp.format('tns'))
print 'OK for tns'
soap12.CreateFromDocument(resp.format('anything'))
------------------------------------------------------------------------------
Subversion Kills Productivity. Get off Subversion & Make the Move to Perforce.
With Perforce, you get hassle-free workflows. Merge that actually works. 
Faster operations. Version large binaries.  Built-in WAN optimization and the
freedom to use Git, Perforce or both. Make the move to Perforce.
http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk
_______________________________________________
pyxb-users mailing list
pyxb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pyxb-users

Reply via email to