MCPcopy Create free account
hub / github.com/andreikop/python-ws-discovery / createProbeMessage

Function createProbeMessage

wsdiscovery/actions/probe.py:24–44  ·  view source on GitHub ↗

serialize a SOAP envelope object into a string

(env)

Source from the content-addressed store, hash-verified

22
23
24def createProbeMessage(env):
25 "serialize a SOAP envelope object into a string"
26
27 doc = createSkelSoapMessage(NS_ACTION_PROBE)
28
29 bodyEl = getBodyEl(doc)
30 headerEl = getHeaderEl(doc)
31
32 addElementWithText(doc, headerEl, "a:MessageID", NS_ADDRESSING, env.getMessageId())
33 addElementWithText(doc, headerEl, "a:To", NS_ADDRESSING, env.getTo())
34
35 if len(env.getReplyTo()) > 0:
36 addElementWithText(doc, headerEl, "a:ReplyTo", NS_ADDRESSING, env.getReplyTo())
37
38 probeEl = doc.createElementNS(NS_DISCOVERY, "d:Probe")
39 bodyEl.appendChild(probeEl)
40
41 addTypes(doc, probeEl, env.getTypes())
42 addScopes(doc, probeEl, env.getScopes())
43
44 return getDocAsString(doc)
45
46
47def parseProbeMessage(dom):

Callers 1

createSOAPMessageFunction · 0.85

Calls 12

createSkelSoapMessageFunction · 0.85
getBodyElFunction · 0.85
getHeaderElFunction · 0.85
addElementWithTextFunction · 0.85
addTypesFunction · 0.85
addScopesFunction · 0.85
getDocAsStringFunction · 0.85
getMessageIdMethod · 0.80
getToMethod · 0.80
getReplyToMethod · 0.80
getTypesMethod · 0.45
getScopesMethod · 0.45

Tested by

no test coverage detected