This post is more than 5 years old
14 Posts
0
2770
March 28th, 2011 01:00
Testing XAM, commit fails
Hi, I have been testing XAM .NET wrapper for Centera, but so far it has failed every time I tried to make a commit. I don't know what error means, so I cannot find a solution.
Can anyone help me out.
Here is the code:
const string ConnectString = "snia-xam://centera_vim!128.221.200.180?C:\\emea2_profile1_rdqeDcw.pea";
///
///
/// Using .NET wrapper structure for testing
///
[Test]
public void TestXam()
{
try
{
//Application properties:
XAMLibrary xlib = XAMLibrary.Instance;
xlib.LogLevel =
Constants.LOG_ALL;
xlib.LogPath =
"sdk.log";
xlib.CreateField(
Constants.CENTERA_APP_NAME, "XAM.NET Test Harness", false);
xlib.CreateField(
Constants.CENTERA_APP_VERSION, "3.5", false);
XSystem system = xlib.CreateXSystem(ConnectString);
//Authenticate first time
if (!system.Authenticated)
{
// Authenticate - can provide an authentication string or use default of ANONYMOUS
system.Authenticate();
}
Trace.WriteLine("Authenticated = OK");
XSet xSet = system.CreateXSet();
xSet.CreateField(
"valueString", "this is a test string");
//commit any changes made
XUID xuid = xSet.Commit(); //<-- ERROR HERE
Trace.WriteLine("Commit OK, XUID=" + xuid);
}
catch (Exception exception)
{
Trace.WriteLine("FAILED =" + exception.ToString());
throw;
}
}
I tried using similar approach calling xam.dll directly from .NET with DllImport
The error is happening on xSet.Commit() line, it returns :
FAILED =XAM Error <-10204> [XSet_Commit]XAMSDK.XAMException : Exception of type 'XAMSDK.XAMException' was thrown.at XAMSDK.Helpers. CheckAndThrow( XAMHandle inHandle, Int32 inStatus, String inUserMessage) in XAMMisc.cs: line 625
at XAMSDK.Helpers. CheckAndThrow( Int32 inStatus, String inUserMessage) in XAMMisc.cs: line 615
at XAMSDK.XSet. Commit() in XSet.cs: line 483
at TestHarness.MyTestCase. TestXam() in MyTestCase.cs: line 65
Anyone knows what I can do about that, thanks !
0 events found

