Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: POST XML

From: "Terry Hulsey"<thulsey@-------.--->
To: NULL
Date: 4/15/2005 11:41:00 AM
<%@ Language=VBScript %>
<%
dim strRequest
dim strResponse
dim lngNumBytes:lngNumBytes = 0
dim BytesArray
dim objRequest

lngNumBytes = Request.TotalBytes

err.Clear()
if (lngNumBytes = 0) then
    Response.Write("<H4>Expecting POST of an array of bytes</H4><BR>")
else
    BytesArray = Request.BinaryRead(lngNumBytes)
   'Transfer the bytes to a string.
   if (lngNumBytes <> Request.TotalBytes) then
	Response.Write("<H4>Bytes lost in transmission. Please resubmit your 
request.</H4></BR>")
   else
	'Convert data from array of bytes into a string.
	strRequest = BinDataToString(BytesArray,lngNumBytes)
	if (err.number = 0) then
	   'Send request string for processing.
		'...process, write to DB, etc.
	else
	   Response.Write("<H4>Failed to convert binary data into a string:" & _
		"<FONT COLOR=red>" + err.description + "</FONT></H4></BR>")
	end if
   end if
end if 

Function BinDataToString(Binary_Data, Num_Bytes)
	Dim Data, Index

	Data = CStr(Num_Bytes, vbSpace)
	For Index = 0 To Num_Bytes - 1
	   Mid(Data, Index + 1, 1) = Chr(Binary_Data(Index))
	Next 'Index

	BinDataToString = Data

End Function
%>


transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent