beautypg.com

Nortel Networks Broadcast Server User Manual

Page 80

background image

Appendix A

Push XML API

Sample ASP Pages

Broadcast Server User Guide

72

'Load the XML into an XMLDOM object
Set SendDoc = server.createobject("Microsoft.XMLDOM")
SendDoc.ValidateOnParse= True
SendDoc.LoadXML(xmlString)

'Set the URL of the receiver
sURL = "http://192.168.1.201:9998/"

'Call the XML Send function (defined below)
set NewDoc = xmlSend (sURL, SendDoc)'xmlString)
'We receive back another XML DOM object!

'Tell the user what happened
response.Write "XML DOC posted off:
"
response.write SendDoc.XML & "
"
response.write "Target URL: " & sURL & "
"
response.write "XML DOC Received back:
"
response.write (NewDoc.Xml)

private function xmlsend(url, docSubmit)
Set poster = Server.CreateObject("MSXML2.ServerXMLHTTP")
poster.open "POST", url, false
poster.setRequestHeader "CONTENT_TYPE", "text/xml"
poster.send docSubmit
Set NewDoc = server.createobject("Microsoft.XMLDOM")
newDoc.ValidateOnParse= True
newDoc.LoadXML(poster.responseTEXT)

Set XMLSend = NewDoc
Set poster = Nothing
end function

%>