• 0

[ASP/XML] Sending a Page via WCTP


Question

So working with some ASP (vbscript to be exact) and I am trying to setup some sort of form with the ability to send people pages.

I have the form written and working, but I would like to. If this is even possible, send the page using WCTP.

<?xml version="1.0"?>

<!DOCTYPE wctp-Operation SYSTEM "http://wctp.usamobility.net/DTD/wctp-dtd-v1r1.dtd">

<wctp-Operation wctpVersion="wctp-dtd-v1r1">

<wctp-SubmitRequest>

<wctp-SubmitHeader>

<wctp-Originator senderID="user@domain"/>

<wctp-Recipient recipientID="subscriberPIN"/>

</wctp-SubmitHeader>

<wctp-Payload>

<wctp-Alphanumeric>Message text goes here.

</wctp-Alphanumeric>

</wctp-Payload>

</wctp-SubmitRequest>

</wctp-Operation>

that is apparently all the information I need to send to a specific address. In this case its wctp.usamobility.net/wctp

here is what I have now now I have the second XML string commented out because with it uncommented the page doesnt even load. If I comment it out I receive a message that says

XML sent!

TrueTarget URL: http://wctp.usamobility.net/wctp

so I am thinking that this may be the problem. However I dont know exactly what is causing the issue. I am pretty new to ASP.

&lt;%
xmlString = "&lt;?xml version=""1.0""?&gt;" &amp; vbcrlf
'xmlString = xmlString &amp; "&lt;!DOCTYPE wctp-Operation SYSTEM ""http://wctp.usamobility.net/DTD/wctp-dtd-v1r1.dtd"">bcrlf
xmlString = xmlString &amp; "&lt;wctp-Operation wctpVersion=""wctp-dtd-v1r1""&gt;" &amp; vbcrlf
xmlString = xmlString &amp; "&lt;wctp-SubmitRequest&gt;" &amp; vbcrlf
xmlString = xmlString &amp; "&lt;wctp-SubmitHeader&gt;" &amp; vbcrlf
xmlString = xmlString &amp; "&lt;wctp-Originator senderID=""a pager id""/&gt;" &amp; vbcrlf
xmlString = xmlString &amp; "&lt;wctp-Recipient recipientID=""some number""/&gt;" &amp; vbcrlf
xmlString = xmlString &amp; "&lt;/wctp-SubmitHeader&gt;" &amp; vbcrlf
xmlString = xmlString &amp; "&lt;wctp-Payload&gt;" &amp; vbcrlf
xmlString = xmlString &amp; "&lt;wctp-Alphanumeric&gt;This is a test WCTP Message&lt;/wctp-Alphanumeric&gt;" &amp; vbcrlf
xmlString = xmlString &amp; "&lt;/wctp-Payload&gt;" &amp; vbcrlf
xmlString = xmlString &amp; "&lt;/wctp-SubmitRequest&gt;" &amp; vbcrlf
xmlString = xmlString &amp; "&lt;/wctp-Operation&gt;" &amp; vbcrlf
'objHttpRequest.setoption(2,13056)
Set SendDoc = server.createobject("Microsoft.XMLDOM")
SendDoc.ValidateOnParse=True
SendDoc.LoadXML(xmlString)

sURL = "http://wctp.usamobility.net/wctp"

Set NewDoc = xmlSend (sURL, SendDoc) 'xmlString)

Response.Write "&lt;b&gt;XML sent!&lt;/b&gt;&lt;br&gt;"
Response.Write "SendDoc.XML &amp; "&lt;br&gt;""
response.write "&lt;b&gt;Target URL:&lt;/b&gt; " &amp; sURL &amp; "&lt;br&gt;"


private function xmlsend(url, docSubmit)
Set poster = Server.CreateObject("MSXML2.XMLHTTP")
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
%&gt;

Edited by Sophism
Link to comment
https://www.neowin.net/forum/topic/812930-aspxml-sending-a-page-via-wctp/
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Thanks. i got this to work.

Basically this is the code I used.

Dim Pagernumbers, Pagernumbs, pager
Pagernumbers = Request.form("pagenumbsgernumbs = split(Pagernumbers,",")
	For Each pager in pagernumbs
		sURL = "http://wctp.metrocall.com/wctp"
		Set http = Server.CreateObject("msxml2.ServerXMLHTTP")
		http.Open "POST", sURL
			xmldata = "&lt;?xml version=""1.0""?&gt;"
			xmldata = xmldata &amp; "&lt;!DOCTYPE wctp-Operation SYSTEM ""http://wctp.usamobility.net/DTD/wctp-dtd-v1r1.dtd"">ata = xmldata &amp; "&lt;wctp-Operation wctpVersion=""wctp-dtd-v1r1""&gt;"
			xmldata = xmldata &amp; "&lt;wctp-SubmitRequest&gt;"
			xmldata = xmldata &amp; "&lt;wctp-SubmitHeader&gt;"
			xmldata = xmldata &amp; "&lt;wctp-Originator senderID=""Intranet""/&gt;"
			xmldata = xmldata &amp; "&lt;wctp-Recipient recipientID=""" &amp; pager &amp; """/&gt;"
			xmldata = xmldata &amp; "&lt;/wctp-SubmitHeader&gt;"
			xmldata = xmldata &amp; "&lt;wctp-Payload&gt;"
			xmldata = xmldata &amp; "&lt;wctp-Alphanumeric&gt;" &amp; Request.Form("MSSGmp; "&lt;/wctp-Alphanumeric&gt;"
			xmldata = xmldata &amp; "&lt;/wctp-Payload&gt;"
			xmldata = xmldata &amp; "&lt;/wctp-SubmitRequest&gt;"
			xmldata = xmldata &amp; "&lt;/wctp-Operation&gt;"
		http.Send xmldata
	Next

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.