Page 1 of 1

Fortress and studio 2008

Posted: Wed Apr 23, 2008 5:18 am
by mark
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

Posted: Wed Apr 23, 2008 10:43 am
by shannon
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);

Posted: Wed Apr 23, 2008 1:14 pm
by shannon
Here is a post showing the web reference way:
http://support.sourcegear.com/viewtopic.php?t=2568

Posted: Thu Apr 24, 2008 2:44 am
by mark
Thanks for your reply.

Where did you get "ServerOperations" from?

Here is a screen dump of the operations i get once i have added a service reference (circled in red)

Posted: Thu Apr 24, 2008 8:16 am
by shannon
ServerOperations is located in VaultClientIntegrationLib, available with the api.