 |
Return to article
public Message() {
doc = new DocumentImpl();
elementMessage = doc.createElement("message");
elementHeader = doc.createElement("header");
elementStatus = doc.createElement("status");
elementHeader.appendChild(elementStatus);
elementCommand = doc.createElement("command");
elementHeader.appendChild(elementCommand);
elementQueueName = doc.createElement("queueName");
elementHeader.appendChild(elementQueueName);
elementMessageId = doc.createElement("messageId");
elementHeader.appendChild(elementMessageId);
elementProcessingRule = doc.createElement("processingRule");
elementHeader.appendChild(elementProcessingRule);
elementMessage.appendChild(elementHeader);
elementPayload = doc.createElement("payload");
elementMessage.appendChild(elementPayload);
doc.appendChild(elementMessage);
}
public Message(String msg) {
InputSource in = new InputSource(new StringReader(msg));
DOMParser parser = new DOMParser();
try {
parser.parse(in);
} catch (Exception e) {
System.out.println("Message:Message:1:Unable to create DOM object");
}
doc = parser.getDocument();
}
|
Return to article
|  |
|