Quantcast
Channel: Classic ASP
Viewing all articles
Browse latest Browse all 488

using server.Createobject("MSXML2.XMLHTTP") post and having problems

$
0
0

Hi All I am using this code

FUNCTION fnEnc(txtToEncrypt)
  postUrl = "http://fastdev1.usask.ca:81/encdec.asmx/fnEnc"
  Set xmlhttp = server.Createobject("MSXML2.XMLHTTP")
  xmlhttp.Open "POST",postUrl,false
  xmlhttp.setRequestHeader "Content-Type","application/x-www-form-urlencoded"
  xmlhttp.send txtToEncrypt
  fnEnc = xmlhttp.responseText
END FUNCTION

and when calledlike this

DataToSendDec = "strValue=" & Request.Querystring(key)
enc=fnEnc(DataToSendDec)
Response.Write "Encrypted__:" & key & ": " & enc & "<BR>"

I get 
Encrypted__:D: szQFw5zM8b767Qh6gSCb0A==

notice how there is a space between D: and sz...

so I figure there is some ASC in there i cant see so using Server.HTMLEncode 
Response.Write "Encrypted__:" & key & ": " & Server.HTMLEncode(enc) & "<BR>"

I now get:

Encrypted__:D: <?xml version="1.0" encoding="utf-8"?> <string xmlns="http://tempuri.org/">szQFw5zM8b767Qh6gSCb0A==</string>

how do i pull just the string out of that xmlhttp.responseText


Viewing all articles
Browse latest Browse all 488

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>