Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>First, just to comment on SOAPpy vs. other soap libraries... SOAPpy traditionally has been the easy-to-use library that didn't support complex data structures. So if it works for your case then you are better off. For more complex data structures in the WSDL you'd need to move ZSI.</p> <p>Anyway, the documentation link for the project on SourceForge seems to be broken, so I'll just cut+paste the header documentation here with some minor formatting changes:</p> <h2>Using Headers</h2> <p>SOAPpy has a Header class to hold data for the header of a SOAP message. Each Header instance has methods to set/get the MustUnderstand attribute, and methods to set/get the Actor attribute.</p> <p>SOAPpy also has a SOAPContext class so that each server method can be implemented in such a way that it gets the context of the connecting client. This includes both common SOAP information and connection information (see below for an example).</p> <h2>Client Examples</h2> <pre><code>import SOAPpy test = 42 server = SOAPpy.SOAPProxy("http://localhost:8888") server = server._sa ("urn:soapinterop") hd = SOAPpy.Header() hd.InteropTestHeader ='This should fault, as you don\'t understand the header.' hd._setMustUnderstand ('InteropTestHeader', 0) hd._setActor ('InteropTestHeader','http://schemas.xmlsoap.org/soap/actor/next') server = server._hd (hd) print server.echoInteger (test) </code></pre> <p>This should succeed (provided the server has defined echoInteger), as it builds a valid header into this client with MustUnderstand set to 0 and then sends the SOAP with this header.</p> <pre><code>import SOAPpy test = 42 server = SOAPpy.SOAPProxy("http://localhost:8888") server = server._sa ("urn:soapinterop") #Header hd = SOAPpy.Header() hd.InteropTestHeader = 'This should fault,as you don\'t understand the header.' hd._setMustUnderstand ('InteropTestHeader', 1) hd._setActor ('InteropTestHeader','http://schemas.xmlsoap.org/soap/actor/next') server = server._hd (hd) print server.echoInteger (test) </code></pre> <p>This should fail (even if the server has defined 'echoInteger'), as it builds a valid header into this client, but sets MustUnderstand to 1 for a message that the server presumably won't understand before sending. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload