MCPcopy Create free account
hub / github.com/ronreiter/interactive-tutorials / mkheader

Method mkheader

suds/bindings/binding.py:291–311  ·  view source on GitHub ↗

Builds a soapheader for the specified I{method} using the header definition (hdef) and the specified value (object). @param method: A method name. @type method: str @param hdef: A header definition. @type hdef: tuple: (I{name}, L{xsd.sxbase.SchemaObje

(self, method, hdef, object)

Source from the content-addressed store, hash-verified

289 return marshaller.process(content)
290
291 def mkheader(self, method, hdef, object):
292 """
293 Builds a soapheader for the specified I{method} using the header
294 definition (hdef) and the specified value (object).
295 @param method: A method name.
296 @type method: str
297 @param hdef: A header definition.
298 @type hdef: tuple: (I{name}, L{xsd.sxbase.SchemaObject})
299 @param object: The header value.
300 @type object: any
301 @return: The parameter fragment.
302 @rtype: L{Element}
303 """
304 marshaller = self.marshaller()
305 if isinstance(object, (list, tuple)):
306 tags = []
307 for item in object:
308 tags.append(self.mkheader(method, hdef, item))
309 return tags
310 content = Content(tag=hdef[0], value=object, type=hdef[1])
311 return marshaller.process(content)
312
313 def envelope(self, header, body):
314 """

Callers 1

headercontentMethod · 0.95

Calls 4

marshallerMethod · 0.95
ContentClass · 0.90
appendMethod · 0.45
processMethod · 0.45

Tested by

no test coverage detected