serialize a SOAP envelope object into a string
(env)
| 32 | |
| 33 | |
| 34 | def 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 | |
| 68 | def parseProbeMatchMessage(dom): |
no test coverage detected