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

Method bodycontent

suds/bindings/document.py:42–71  ·  view source on GitHub ↗
(self, method, args, kwargs)

Source from the content-addressed store, hash-verified

40 """
41
42 def bodycontent(self, method, args, kwargs):
43 #
44 # The I{wrapped} vs I{bare} style is detected in 2 ways.
45 # If there is 2+ parts in the message then it is I{bare}.
46 # If there is only (1) part and that part resolves to a builtin then
47 # it is I{bare}. Otherwise, it is I{wrapped}.
48 #
49 if not len(method.soap.input.body.parts):
50 return ()
51 wrapped = method.soap.input.body.wrapped
52 if wrapped:
53 pts = self.bodypart_types(method)
54 root = self.document(pts[0])
55 else:
56 root = []
57 n = 0
58 for pd in self.param_defs(method):
59 if n < len(args):
60 value = args[n]
61 else:
62 value = kwargs.get(pd[0])
63 n += 1
64 p = self.mkparam(method, pd, value)
65 if p is None:
66 continue
67 if not wrapped:
68 ns = pd[1].namespace('ns0')
69 p.setPrefix(ns[0], ns[1])
70 root.append(p)
71 return root
72
73 def replycontent(self, method, body):
74 wrapped = method.soap.output.body.wrapped

Callers

nothing calls this directly

Calls 8

documentMethod · 0.95
param_defsMethod · 0.95
mkparamMethod · 0.95
bodypart_typesMethod · 0.80
setPrefixMethod · 0.80
getMethod · 0.45
namespaceMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected