ElementSOAP and <soap:Header>

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • mirandacascade@yahoo.com

    ElementSOAP and <soap:Header>

    1) Is it correct that none of the examples in the ElementSOAP tutorial:



    include an example in which the SOAP message that contains the request
    includes a <soap:Headerblo ck?

    2) If one wanted to make use of ElementSOAP, and one wanted it to
    produce a SOAP message that includes a <soap:Headerwou ld the general
    outline be:
    a) use ElementTree to create and populate the <soap:Headerele ment
    b) insert the <soap:Headerele ment as a subelement of envelope in
    the SoapService class

    I think much of my confusion stems from my lack of understanding of
    SOAP. As I understand it, <soap:Headeri s an optional part of a SOAP
    message. I'm pretty sure that 'optional' at a minimum means that not
    all SOAP messages must contatin a <soap:Header> . But does 'optional'
    mean more than that? Does it mean that one could get by without ever
    having to produce a SOAP message that includes a <soap:Header> ? Or,
    are there some webservices where if one didn't include a <soap:Header>
    in the SOAP message, the webservice would not work?

    Thank you.

  • Fredrik Lundh

    #2
    Re: ElementSOAP and &lt;soap:Header &gt;

    mirandacascade@ yahoo.com wrote:
    2) If one wanted to make use of ElementSOAP, and one wanted it to
    produce a SOAP message that includes a <soap:Headerwou ld the general
    outline be:
    a) use ElementTree to create and populate the <soap:Headerele ment
    b) insert the <soap:Headerele ment as a subelement of envelope in
    the SoapService class
    make sure you have the 0.5 release, call SoapHeader to create a header
    element, populate it with whatever you want, and pass it to "call" using
    the header= keyword argument

    header = SoapHeader()
    ... populate header ...
    service.call(ac tion, request, header=header)
    I think much of my confusion stems from my lack of understanding of
    SOAP. As I understand it, <soap:Headeri s an optional part of a SOAP
    message. I'm pretty sure that 'optional' at a minimum means that not
    all SOAP messages must contatin a <soap:Header> . But does 'optional'
    mean more than that? Does it mean that one could get by without ever
    having to produce a SOAP message that includes a <soap:Header> ? Or,
    are there some webservices where if one didn't include a <soap:Header>
    in the SOAP message, the webservice would not work?
    optional means "it's up to the server to decide if it wants one".

    </F>

    Comment

    • mirandacascade@yahoo.com

      #3
      Re: ElementSOAP and &lt;soap:Header &gt;


      Fredrik Lundh wrote:
      make sure you have the 0.5 release
      May I confirm the following recommendations/dependencies:
      1) if one wants to use ElementSOAP to create a message that includes
      <soap:Header> , it is recommended that one use the 0.5 release of
      ElementSOAP
      2) if one wants to use the 0.5 release of ElementSOAP, one should be
      using Python 2.5

      Thank you.

      Comment

      • Fredrik Lundh

        #4
        Re: ElementSOAP and &lt;soap:Header &gt;

        mirandacascade@ yahoo.com wrote:
        May I confirm the following recommendations/dependencies:
        1) if one wants to use ElementSOAP to create a message that includes
        <soap:Header> , it is recommended that one use the 0.5 release of
        ElementSOAP
        yes. or if you prefer not to upgrade, you can hack the "call" method to
        insert a header at the right place.
        2) if one wants to use the 0.5 release of ElementSOAP, one should be
        using Python 2.5
        no. but if you're using earlier versions of Python, you also need a
        version of ElementTree that supports the "iterparse" interface (which
        means 1.2.5 or later).

        </F>

        Comment

        Working...