By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,898 Members | 1,198 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,898 IT Pros & Developers. It's quick & easy.

ElementSOAP and <soap:Header>

P: n/a
1) Is it correct that none of the examples in the ElementSOAP tutorial:

http://effbot.org/zone/elementsoap-1.htm

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

2) If one wanted to make use of ElementSOAP, and one wanted it to
produce a SOAP message that includes a <soap:Headerwould the general
outline be:
a) use ElementTree to create and populate the <soap:Headerelement
b) insert the <soap:Headerelement 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:Headeris 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.

Nov 20 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
mi************@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:Headerwould the general
outline be:
a) use ElementTree to create and populate the <soap:Headerelement
b) insert the <soap:Headerelement 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(action, request, header=header)
I think much of my confusion stems from my lack of understanding of
SOAP. As I understand it, <soap:Headeris 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>

Nov 20 '06 #2

P: n/a

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.

Nov 20 '06 #3

P: n/a
mi************@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>

Nov 20 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.