Unsolved
This post is more than 5 years old
1 Message
0
3361
May 21st, 2009 22:00
1033 error on xstream dispose & maximum 32768 bytes in xstream
I am using VB.NET MS Visual Studio 2005. I downloaded the XAMSDK on 03 Feb 2009. Iget the errors when running the following code:
Dim
FileNo As Integer = FreeFile()
Dim
FileBytes() As Byte
FileOpen(FileNo, sFilePath, OpenMode.Binary, OpenAccess.Read, OpenShare.Shared)
ReDim FileBytes(LOF(FileNo) - 1)
FileGet(FileNo, FileBytes, 1)
FileClose(FileNo)
Dim xset As
XSet = xsys.CreateXSet
xset.CreateField(
"VME.Filename", sFile)
xset.CreateField(
"VME.ByteCount", FileBytes.Length)
Dim xs As XStream = xset.CreateXStream( "FileBody" , Constants.DEFAULT_MIME_TYPE)Try
xs.Write(FileBytes, 0, FileBytes.Length) <--- Fails here if FileBytes.Length is more than 32767
xs.Dispose() <--- Fails here with error 1033
Dim xuid AsXUID = xset.Commit()
The XAM test harness demo code fails in exactly the same way. I have checked that my XSystem is Authenticad OK.
Does anyone have any ide what is going wrong.
Dick.


YT.Kim
20 Posts
0
May 25th, 2009 02:00
As I tested, test harness sample code can write a file that has more then 32768 bytes. I think your code made 1033 error and it's related "Authentication bug" of Test harness sample code. It was also reporeted in other post.
Please change the following code and then re-try:
before:
xsys.Authenticate();
after:
if (xsys.Authenticated)
xsys.Authenticate();
Thank you
Regards
YT
gstuartemc
2 Intern
•
417 Posts
0
May 29th, 2009 05:00
YT - your logic is wrong. You should only call Authenticate() - which authenticates anonymously - if the connection has not already been authenticated on open via the use of parameters or pea files in the connection string.
In other words
if (!xsys.Authenticated)
xsys.Authenticate();
YT.Kim
20 Posts
0
May 31st, 2009 19:00
Graham,
You are correct. I made typo.
Thanks
YT