VBScript Example

From CDYNE Wiki
Jump to navigation Jump to search

Check Phone Number

 1 Dim request, oXMLHttp, url
 2 url = "http://ws.cdyne.com/phoneverify/phoneverify.asmx"
 3 
 4 request = "<?xml version='1.0' encoding='utf-8'?>" & _
 5 "<soap:Envelope xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/"">" & _
 6 "<soap:Body>" & _
 7 "<CheckPhoneNumber xmlns=""http://ws.cdyne.com/PhoneVerify/query"">" & _
 8 "<PhoneNumber>17575449510</PhoneNumber>" & _
 9 "<LicenseKey>YOUR LICENSE KEY</LicenseKey>" & _
10 "</CheckPhoneNumber>" & _
11 "</soap:Body>" & _
12 "</soap:Envelope>"
13 
14 Set oXMLHttp = CreateObject("MSXML2.ServerXMLHTTP")
15 oXMLHttp.open "POST", url, False
16 oXMLHttp.setRequestHeader "Content-Type", "text/xml; charset=utf-8"
17 oXMLHttp.send request
18 response = oXMLHttp.responseText
19 
20 MsgBox oXMLHttp.responseText

Check Phone Numbers

 1 Dim request, oXMLHttp, url
 2 url = "http://ws.cdyne.com/phoneverify/phoneverify.asmx"
 3 
 4 request = "<?xml version='1.0' encoding='utf-8'?>" & _
 5 "<soap:Envelope xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/"">" & _
 6 "<soap:Body>" & _
 7 "<CheckPhoneNumbers xmlns=""http://ws.cdyne.com/PhoneVerify/query"">" & _
 8 "<PhoneNumbers>" & _
 9 "<string >17575449510</string>" & _
10 "<string>18009843710</string>" & _
11 "</PhoneNumbers>" & _ 
12 "<LicenseKey>YOUR LICENSE KEY</LicenseKey>" & _
13 "</CheckPhoneNumbers>" & _
14 "</soap:Body>" & _
15 "</soap:Envelope>"
16 
17 Set oXMLHttp = CreateObject("MSXML2.ServerXMLHTTP")
18 oXMLHttp.open "POST", url, False
19 oXMLHttp.setRequestHeader "Content-Type", "text/xml; charset=utf-8"
20 oXMLHttp.send request
21 response = oXMLHttp.responseText
22 
23 MsgBox oXMLHttp.responseText