473,796 Members | 2,649 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Posting ASP null character to XML Socket Server

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>t est
</MESSAGE><USERID >+19024894124 </USERID>"
Jul 21 '05 #1
3 1712
Try ....</USERID>" + ""

"Shawn" <sh***@rampaget echnology.com> wrote in message
news:98******** *************** ***@posting.goo gle.com...
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>t est
</MESSAGE><USERID >+19024894124 </USERID>"

Jul 21 '05 #2
Nope didn't work.. spaces, chr() or even %20's don't work.. any other ideas?

"Jeff Dillon" <je**@removeeme rgencyreporting .com> wrote in message news:<#9******* *******@TK2MSFT NGP09.phx.gbl>. ..
Try ....</USERID>" + ""

"Shawn" <sh***@rampaget echnology.com> wrote in message
news:98******** *************** ***@posting.goo gle.com...
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>t est
</MESSAGE><USERID >+19024894124 </USERID>"

Jul 21 '05 #3
You can append nulls like this:

strTmp = string(2,0) 'some win32 routines expect 2 nulls
newdoc="<USER>
+19024894124</USER><MESSAGE>t est</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>t est</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.

--
--Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com
"Shawn" <sh***@rampaget echnology.com> wrote in message
news:98******** *************** ***@posting.goo gle.com...
Nope didn't work.. spaces, chr() or even %20's don't work.. any other
ideas?

"Jeff Dillon" <je**@removeeme rgencyreporting .com> wrote in message
news:<#9******* *******@TK2MSFT NGP09.phx.gbl>. ..
Try ....</USERID>" + ""

"Shawn" <sh***@rampaget echnology.com> wrote in message
news:98******** *************** ***@posting.goo gle.com...
> 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>t est
> </MESSAGE><USERID >+19024894124 </USERID>"

Jul 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
5548
by: BlueDragon | last post by:
I don't know enough math to demonstrate that any numerical operation with a null should yield a null; although I would guess that it's true. I just don't buy it, however, when dealing with strings and nulls. In a simple table with first, middle and last name columns, I would infer that a null value in the middle name column means the HR person forgot to ask. A zero length string, however, tells me HR did ask and there is no middle name....
4
7091
by: zbcong | last post by:
Hello: I write a multithread c# socket server,it is a winform application,there is a richtextbox control and button,when the button is click,the server begin to listen the socket port,waiting for a incoming connection,the relative code snipprt as following:: private IPAddress myIP=IPAddress.Parse("127.0.0.1"); private IPEndPoint myServer; private Socket socket; private Socket accSocket; private System.Windows.Forms.Button button2;...
1
3093
by: Danny | last post by:
I am posting xml to a server and get the above error returned. The client code is listed below, it works until say a "<" character is put in XmlData. On the server page I try to pick up the XmlData with: Response.Write(Request.Form); Client side code: ASCIIEncoding encoding = new ASCIIEncoding(); string XmlString = "<TEST"; Stream requestStream = null;
0
1666
by: Stefan Schwarzer | last post by:
Hi all! For my FTP library module ftputil , some users have asked for a way to avoid server timeouts (FTP status code 421). But I haven't found out yet how I can do this in all cases. I try to explain the problem in more detail. The following is rather special and probably not so easy to understand, but I'll do my best. Please ask if you need more information.
7
2252
by: AmitKu | last post by:
I am trying to do a URL post using HttpWebRequest, but it fails because I am hosting on Network Solutions, and their servers are all medium trust. Apparently HttpWebRequest doesn't work on medium trust. Is there any way to do URL posting in a medium trust environment? I'm hoping I don't need to switch hosts because of this. Btw I've posted this a 3rd time now because I've yet to receive any replies whatsoever. I've called around...
12
1741
by: Mohitz | last post by:
How do you write a function in C++ which returns a class object in some cases and in others, returns something like a NULL pointer so that i can know in the callee function that the object doesnt exist?? ClassName A() { ClassName a; if (condition) return a; else
1
1818
by: Sparky74 | last post by:
Hi Everybody. I have been searching for many hours for an answer to this problem. I hope somebody can help me. I have a C# .NET client application that connects to a TCP/IP C++ server application that I have maintained for a number of years. What I am finding is that Socket.Close() does not actually sever the client connection from my server application. Actually, my statement above isn't entirely true - Socket.Close() *does* work as...
8
2302
by: A. Anderson | last post by:
Howdy everyone, I'm experiencing a problem with a program that I'm developing. Take a look at this stack report from GDB - #0 0xb7d782a3 in strlen () from /lib/tls/i686/cmov/libc.so.6 #1 0xb7d4c2f7 in vfprintf () from /lib/tls/i686/cmov/libc.so.6 #2 0xb7d6441b in vsprintf () from /lib/tls/i686/cmov/libc.so.6 #3 0x08049ba0 in character_data::printf (this=0x800, argument=0x0) at character.c:198
1
9793
by: starter08 | last post by:
Hi, I have a C++ routine(client-side) which uploads an xml file to a web server by making a socket connection and sending all the post request through that socket. On the server side I have a cgi script which receives all the data and creates a file in the specified directory. If I am uploading only the file all works well, however I want to send data of other fields too (field1, field2 ..etc), this fails the post request and even the file is...
0
9673
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10449
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10217
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10168
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10003
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9047
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6785
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4114
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2924
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.