Java callable API Examples?

Examples of programs integrating with Vault and Fortress API. Also, information on integrating with NAnt, CruiseControl.Net and other third-party tools

Moderator: SourceGear

davehub
Posts: 6
Joined: Tue Apr 07, 2009 7:28 am

Java callable API Examples?

Post by davehub » Wed Apr 21, 2010 12:55 pm

The Download site states:

Java Command Line Client (CLC)
(Approx 18 MB) Cross-platform command-line access to Vault repositories. Also includes the Java-callable version of our Client API libraries.

Are there any docs or examples of the 'Java-Callable' part of this package? I see there are jar files, but any javadoc out there?

Thanks,
Dave

lbauer
Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear

Re: Java callable API Examples?

Post by lbauer » Wed Apr 21, 2010 8:15 pm

Are you looking for documentation on using the Java Command Line Client? If so, cd to the Java Command Line Client directory and type "vault help" or "Fortress help."

For help with a specific command, run 'vault/fortress HELP commandname'

You can get a printed copy here:

http://people.sourcegear.com/~bkieler/A ... %20CLC.doc
Linda Bauer
SourceGear
Technical Support Manager

davehub
Posts: 6
Joined: Tue Apr 07, 2009 7:28 am

Re: Java callable API Examples?

Post by davehub » Tue Apr 27, 2010 10:25 am

Hi,

We were actually looking for the 'Java Callable' part. It implies we could call these functions directly from a Java program. As an API.

Thanks,
Dave

lbauer
Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear

Re: Java callable API Examples?

Post by lbauer » Thu Apr 29, 2010 2:11 pm

According to our developer, you can hook into the jars from the Java CLC with much the same API that you would use for our C# examples.
Linda Bauer
SourceGear
Technical Support Manager

carlossalas
Posts: 8
Joined: Tue Oct 26, 2010 5:00 pm

Re: Java callable API Examples?

Post by carlossalas » Tue Oct 26, 2010 5:14 pm

I'm having an incredible issue on CLC capabilities, first of all I'm using Perl and trying to connect to a server but haven't found a lib or something related. So i managed myself to call commands over console and use the CLC instead, it work great but i was testing and testing and for some reason i don't find a way to manage items from it. From my perspective this console client as the desktop client work on the SourceControl side of the fortress server but i don't see any functionality or service to the Bug (item) tracking service.

lbauer
Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear

Re: Java callable API Examples?

Post by lbauer » Thu Oct 28, 2010 11:11 am

The Fortress API might have what you need. What are you trying to do? If we know that, we might be able to provide a better answer.
Linda Bauer
SourceGear
Technical Support Manager

carlossalas
Posts: 8
Joined: Tue Oct 26, 2010 5:00 pm

Re: Java callable API Examples?

Post by carlossalas » Thu Oct 28, 2010 4:19 pm

I want to be able to create new Items for an specific project. Also search for an item providing the Id or something like that and update info, status or anything else on the item i search for.

But if this API you say might work involves C# it wont work on my case. Because Im programing a module to an specific tool and this tool requires Perl coding. I was able to use the CLC because I can call console lines from the code so ill form a command on Perl and call the CLC you provide. That way i was able to use the CLC to use the Vault stuff.

lbauer
Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear

Re: Java callable API Examples?

Post by lbauer » Fri Oct 29, 2010 3:50 pm

The API does use C#. There may be ways to convert from C# to Perl and back.

http://www.perlmonks.org/?node_id=853949
http://broadcast.oreilly.com/2009/10/ge ... speak.html
Linda Bauer
SourceGear
Technical Support Manager

carlossalas
Posts: 8
Joined: Tue Oct 26, 2010 5:00 pm

Re: Java callable API Examples?

Post by carlossalas » Wed Nov 03, 2010 10:20 am

So should i assume the CLC client is not able to work the items on a Fortress server and forget about it.

But translating the C# code into Perl Code doesn't seem like an answer because ill still need to run the API. So calling the CLC fits for me.

lbauer
Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear

Re: Java callable API Examples?

Post by lbauer » Wed Nov 03, 2010 1:45 pm

The CLC only works for source control operations, not for bug tracking.

Maybe you could get your Perl to talk to .NET with this info:

http://www.developer.com/tech/article.php/1382961
Linda Bauer
SourceGear
Technical Support Manager

carlossalas
Posts: 8
Joined: Tue Oct 26, 2010 5:00 pm

Re: Java callable API Examples?

Post by carlossalas » Fri Nov 05, 2010 3:06 pm

Bottom line in here in my case i cannot involve .Net in compiling time, my tool allows me to run any script in the ec_perl console or the OS default console. So this solution don't allow me to run on a Linux or Mac console.

I was planing on build an console app to use the Client API you guys provide but i still will be forced to run this Client API on a win enviroment.

Now if i was able to migrate the Client API to perl scripts this would work but i don't feel this happening you guys told me not to mess with the web service myself http://support.sourcegear.com/viewtopic.php?t=237

jclausius
Posts: 3706
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
Contact:

Re: Java callable API Examples?

Post by jclausius » Sat Nov 06, 2010 7:37 am

The link you post to is related to Vault source code control operations, not work item operations.

There is a web service for work items, and while I personally haven't tried it out, it might be usable as an API. Look at http://server-hostname/vaultpro/dragnetwebservice.asmx (example for Vault Professional 5.1). You would have to first login to the web service, use the returned authentication token in all subsequent web service calls as a cookie, but it might work.

Note, none of this is documented, so you'll really need to look at the description of the web service calls for work items to get at what you need.

Good luck.
Jeff Clausius
SourceGear

carlossalas
Posts: 8
Joined: Tue Oct 26, 2010 5:00 pm

Re: Java callable API Examples?

Post by carlossalas » Wed Nov 10, 2010 2:06 pm

Im using the SourceGear Fortress Version 2.0.4.18845 on your site but you including vaultpro/dragnetwebservice.asmx to my server address and i don't get this address installed.
I should be missing something or maybe im using the wrong version of your product.

jclausius
Posts: 3706
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
Contact:

Re: Java callable API Examples?

Post by jclausius » Thu Nov 11, 2010 8:10 am

Since you are using Fortress, try the virtual directory "Fortress" instead of "VaultPro."
Jeff Clausius
SourceGear

carlossalas
Posts: 8
Joined: Tue Oct 26, 2010 5:00 pm

Re: Java callable API Examples?

Post by carlossalas » Tue Jan 11, 2011 3:09 pm

I'm here again after a lot of work and some other tasks i had pending i got a reply from the web service, that was great at beginning because i really need it but now i have another question the LoginPlainText call always return the same values it doesn't care about the user and pass, i'm getting strAuthTicket => ,LoginPlainTextResult => 1002, now this is bad because i really need the token for the rest of my calls and what i got was a null value even the 1002 is a bit confusing, maybe i missing some configurations on the server or something really weird is happening because this login suppose to work.

Post Reply