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

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

Re: Java callable API Examples?

Post by jclausius » Tue Jan 11, 2011 4:55 pm

I don't know how the perl stuff will work, but the method will take two input parameters and one output parameter for the authentication ticket.

1002 is the MantisStatusCode.FailInvalidUser define.

I don't know if you need to do anything in the web service call to help IIS, but your call will create a session. I don't know if you need to do anything on the perl side to work with IIS sessions, but tracking the session id will be required by IIS and Vault Pro/Fortress.
Jeff Clausius
SourceGear

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

Re: Java callable API Examples?

Post by carlossalas » Fri Jan 14, 2011 3:52 pm

For now i achieve to get a token (big mess) but the return on the LoginPlainTextResult was a 0 now for all the rest of the services i need a VaultSessionID and im not sure where do i get this value.

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

Re: Java callable API Examples?

Post by jclausius » Mon Jan 17, 2011 9:01 am

IIS assigns one automatically to any web request to a browser. This is handled by a cookie.

You'll need to figure out how to handle cookies and web service calls within Perl or whatever you are using to make the web request.
Jeff Clausius
SourceGear

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

Re: Java callable API Examples?

Post by jclausius » Mon Jan 17, 2011 10:03 am

Here is an interpretation of what happens when using the ItemTrackingOperations class within the API:
  • Operations calls -> InitDragetService()
    • InitDragnetService
    • creates a .NET WebService class from the DragnetWebService definition.
    • Sets the proxy from options on that web service.
    • Creates a cookie handler to handle any cookies sent from IIS on that web service.
    • Sets the URL to the correct server on that web service.
    • Sets the cookie _authHdr for the login token on that web service.
    • Sets the web service's members for VaultAuthValue -> again from the authentication header from login, and set's VaultAuthValue.VaultSessionID to the cookie value of "ASP.NET_SessionId".
  • Next it calls the web service's method AddItem( with the reference to the Mantis Item struct ).
I don't know if that helps you translate things, but ItemTrackingOperations.ProcessCommandAddForFortressItem() is the wrapper function around these operations.

HTH
Jeff Clausius
SourceGear

Post Reply