We have Fortress version 1.0.4.15848 and I want to use the AddItemExternal from c#, fx3.5.
Do you have any example code for this using a service reference? or do i have to use a web reference?
TIA
Mark
Fortress and studio 2008
Moderator: SourceGear
Here's an example:
string url = "http://VaultServer/VaultService";
string username = "username";
string password = "username";
string repository = "Repository Name";
// Set the login options and login/connect to a repository.
ServerOperations.client.LoginOptions.URL = url;
ServerOperations.client.LoginOptions.User = username;
ServerOperations.client.LoginOptions.Password = password;
ServerOperations.client.LoginOptions.Repository = repository;
ServerOperations.Login();
ServerOperations.client.ClientInstance.Connection.InitDragnetService();
MantisItem mi = new MantisItem();
mi.ProjectID = 102; // your project id here
mi.Description = "Some description";
mi.TypeID = (int) ItemTypeVal.Bug;
mi.Details = "Some details";
mi.PlatformID = (int) PlatformVal.Windows;
ServerOperations.client.ClientInstance.Connection.DragnetServiceInstance.AddItemExternal(mi);
string url = "http://VaultServer/VaultService";
string username = "username";
string password = "username";
string repository = "Repository Name";
// Set the login options and login/connect to a repository.
ServerOperations.client.LoginOptions.URL = url;
ServerOperations.client.LoginOptions.User = username;
ServerOperations.client.LoginOptions.Password = password;
ServerOperations.client.LoginOptions.Repository = repository;
ServerOperations.Login();
ServerOperations.client.ClientInstance.Connection.InitDragnetService();
MantisItem mi = new MantisItem();
mi.ProjectID = 102; // your project id here
mi.Description = "Some description";
mi.TypeID = (int) ItemTypeVal.Bug;
mi.Details = "Some details";
mi.PlatformID = (int) PlatformVal.Windows;
ServerOperations.client.ClientInstance.Connection.DragnetServiceInstance.AddItemExternal(mi);
Here is a post showing the web reference way:
http://support.sourcegear.com/viewtopic.php?t=2568
http://support.sourcegear.com/viewtopic.php?t=2568