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

Function createByeMessage

wsdiscovery/actions/bye.py:24–43  ·  view source on GitHub ↗

serialize a SOAP envelope object into a string

(env)

Source from the content-addressed store, hash-verified

22
23
24def createByeMessage(env):
25 "serialize a SOAP envelope object into a string"
26 doc = createSkelSoapMessage(NS_ACTION_BYE)
27
28 bodyEl = getBodyEl(doc)
29 headerEl = getHeaderEl(doc)
30
31 addElementWithText(doc, headerEl, "a:MessageID", NS_ADDRESSING, env.getMessageId())
32 addElementWithText(doc, headerEl, "a:To", NS_ADDRESSING, env.getTo())
33
34 appSeqEl = doc.createElementNS(NS_DISCOVERY, "d:AppSequence")
35 appSeqEl.setAttribute("InstanceId", env.getInstanceId())
36 appSeqEl.setAttribute("MessageNumber", env.getMessageNumber())
37 headerEl.appendChild(appSeqEl)
38
39 byeEl = doc.createElementNS(NS_DISCOVERY, "d:Bye")
40 addEPR(doc, byeEl, env.getEPR())
41 bodyEl.appendChild(byeEl)
42
43 return getDocAsString(doc)
44
45
46def parseByeMessage(dom):

Callers 1

createSOAPMessageFunction · 0.85

Calls 11

createSkelSoapMessageFunction · 0.85
getBodyElFunction · 0.85
getHeaderElFunction · 0.85
addElementWithTextFunction · 0.85
addEPRFunction · 0.85
getDocAsStringFunction · 0.85
getMessageIdMethod · 0.80
getToMethod · 0.80
getInstanceIdMethod · 0.45
getMessageNumberMethod · 0.45
getEPRMethod · 0.45

Tested by

no test coverage detected