if (doc == null)
throw new NullPointerException(_MESSAGES.get("NullDocument"));
Element root = XmlUtils.createElement(doc, WsnConstants.NOTIFICATION_MSG_QNAME);
EndpointReference sub = getSubscriptionReference();
if (sub != null)
{
Element eprXML = sub.toXML(doc);
XmlUtils.setElement(root, WsnConstants.SUBSCRIPTION_EPR_QNAME, eprXML);
}
QName topicPath = getTopic();
if (topicPath != null)
{
Element topic = XmlUtils.createElement(doc, WsnConstants.TOPIC_QNAME, topicPath);
topic.setAttribute(WsnConstants.DIALECT, getTopicDialect());
root.appendChild(topic);
}
EndpointReference producer = getProducerReference();
if (producer != null)
{
Element eprXML = producer.toXML(doc);
XmlUtils.setElement(root, WsnConstants.PRODUCER_QNAME, eprXML);
}
Element message = XmlUtils.createElement(doc, WsnConstants.MESSAGE_QNAME);
root.appendChild(message);