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

Function createProbeMatchMessage

wsdiscovery/actions/probematch.py:34–65  ·  view source on GitHub ↗

serialize a SOAP envelope object into a string

(env)

Source from the content-addressed store, hash-verified

32
33
34def createProbeMatchMessage(env):
35 "serialize a SOAP envelope object into a string"
36
37 doc = createSkelSoapMessage(NS_ACTION_PROBE_MATCH)
38
39 bodyEl = getBodyEl(doc)
40 headerEl = getHeaderEl(doc)
41
42 addElementWithText(doc, headerEl, "a:MessageID", NS_ADDRESSING, env.getMessageId())
43 addElementWithText(doc, headerEl, "a:RelatesTo", NS_ADDRESSING, env.getRelatesTo())
44 addElementWithText(doc, headerEl, "a:To", NS_ADDRESSING, env.getTo())
45
46 appSeqEl = doc.createElementNS(NS_DISCOVERY, "d:AppSequence")
47 appSeqEl.setAttribute("InstanceId", env.getInstanceId())
48 appSeqEl.setAttribute("MessageNumber", env.getMessageNumber())
49 headerEl.appendChild(appSeqEl)
50
51 probeMatchesEl = doc.createElementNS(NS_DISCOVERY, "d:ProbeMatches")
52 probeMatches = env.getProbeResolveMatches()
53 for probeMatch in probeMatches:
54 probeMatchEl = doc.createElementNS(NS_DISCOVERY, "d:ProbeMatch")
55 addEPR(doc, probeMatchEl, probeMatch.getEPR())
56 addTypes(doc, probeMatchEl, probeMatch.getTypes())
57 addScopes(doc, probeMatchEl, probeMatch.getScopes())
58 addXAddrs(doc, probeMatchEl, probeMatch.getXAddrs())
59 addElementWithText(doc, probeMatchEl, "d:MetadataVersion", NS_DISCOVERY, probeMatch.getMetadataVersion())
60 probeMatchesEl.appendChild(probeMatchEl)
61
62
63 bodyEl.appendChild(probeMatchesEl)
64
65 return getDocAsString(doc)
66
67
68def parseProbeMatchMessage(dom):

Callers 1

createSOAPMessageFunction · 0.85

Calls 15

createSkelSoapMessageFunction · 0.85
getBodyElFunction · 0.85
getHeaderElFunction · 0.85
addElementWithTextFunction · 0.85
addEPRFunction · 0.85
addTypesFunction · 0.85
addScopesFunction · 0.85
addXAddrsFunction · 0.85
getDocAsStringFunction · 0.85
getMessageIdMethod · 0.80
getRelatesToMethod · 0.80
getToMethod · 0.80

Tested by

no test coverage detected