Posting ASP null character to XML Socket Server

S

Shawn

Hey there i'm trying to post a section of XML code to an XMLSocket
Server via ASP I can successfully connect to the server, but it won't
disconnect because the string needs a null character inserted at the
end in order for the socket server to terminate the connection. how
would i do this? i've tried chr(32), chr(0).. anyother ideas?

newdoc="<USER> +19024894124</USER><MESSAGE>test
</MESSAGE><USERID>+19024894124 </USERID>"
 
M

Mark Schupp

You can append nulls like this:

strTmp = string(2,0) 'some win32 routines expect 2 nulls
newdoc="<USER>
+19024894124</USER><MESSAGE>test</MESSAGE><USERID>+19024894124 </USERID>" &
strTmp

Here's a vbscript test page that demos this

<%
Option Explicit

dim strtmp, i

strtmp = string(2,0)
Response.Write strtmp & "<br>"
Response.write len(strtmp) & "<br>"
for i = 1 to len(strtmp)
response.write asc(mid(strtmp,i,1)) & "-"
next
Response.Write "<br><br>"

strTmp = "<USER>
+19024894124</USER><MESSAGE>test</MESSAGE><USERID>+19024894124 </USERID>" &
strtmp
Response.Write strtmp & "<br>"
Response.write len(strtmp) & "<br>"
for i = 1 to len(strtmp)
response.write asc(mid(strtmp,i,1)) & "-"
next

%>

However, if the object you are calling was intended to be called from ASP
then I would expect it to append a null to the input string itself. Don't be
surprised it the above doesn't help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top