serialize a SOAP envelope object into a string
(env)
| 22 | |
| 23 | |
| 24 | def 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 | |
| 47 | def parseProbeMessage(dom): |
no test coverage detected