Fortress and studio 2008

Post your questions regarding using the Vault and Fortress API in your programs.

Moderator: SourceGear

Post Reply
mark
Posts: 2
Joined: Wed Apr 23, 2008 5:13 am

Fortress and studio 2008

Post by mark » Wed Apr 23, 2008 5:18 am

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

shannon

Post by shannon » Wed Apr 23, 2008 10:43 am

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);

shannon

Post by shannon » Wed Apr 23, 2008 1:14 pm

Here is a post showing the web reference way:
http://support.sourcegear.com/viewtopic.php?t=2568

mark
Posts: 2
Joined: Wed Apr 23, 2008 5:13 am

Post by mark » Thu Apr 24, 2008 2:44 am

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)
Attachments
Fortress.JPG
Fortress.JPG (45.97 KiB) Viewed 8966 times

shannon

Post by shannon » Thu Apr 24, 2008 8:16 am

ServerOperations is located in VaultClientIntegrationLib, available with the api.

Post Reply