Gemini Community Support Site

This Gemini community support site can be used to find solutions to product issues. You can log in using Open Id, Google Profile and even Facebook. Feel free to ask a question or browse FAQs and documentation. Product tour videos are also available along with how-to videos demonstrating key Gemini capabilities.




Exception has been thrown by the target of an invocation.

api

A few of the WS calls using the WS DLLs are constantly generating these generic exceptions.

Message: "Exception has been thrown by the target of an invocation."

StackTrace: at CounterSoft.Gemini.WebServices.BaseService.ThrowResponseException(WebResponse response) at CounterSoft.Gemini.WebServices.BaseService.ProcessResponse[T](String url, Object obj, RequestType requestType) at CounterSoft.Gemini.WebServices.BaseService.GetResponse[T](String url, Object o, RequestType r) at CounterSoft.Gemini.WebServices.UsersService.GetUsers() at (Past this is my application doing a UsersServices.GetUsers)

It also happens when trying to create a new timelog using IssuesService.CreateTimeLog()

Any Ideas as to what could be causing this?

Gent
· 1
Gent
Replies (12)
helpful
0
not helpful

Which version of Gemini?
Can you please check Gemini's system log for errors?


Mark Wing
· 9108
Mark Wing
helpful
0
not helpful

Gemini 3.5.4 (Build 2435)

And nothing logged today.


Gent
· 1
Gent
helpful
0
not helpful

Do you get the exception as soon as the call happens or is there a delay?


Mark Wing
· 9108
Mark Wing
helpful
0
not helpful

As soon as the call occurs


Gent
· 1
Gent
helpful
0
not helpful

Do you get an error when you try the GetUser or WhoAmI call?


Saar Cohen
· 5000
Saar Cohen
helpful
0
not helpful

The Stack Trace I have in the OP was from a GetUsers() call. However as i mentioned it is also happening for the IssuesServce.CreateTimeLog() call.


Gent
· 1
Gent
helpful
0
not helpful

Yes, I was asking about GetUser (singular)....

We have not seen this before and trying to establish a pattern.


Saar Cohen
· 5000
Saar Cohen
helpful
0
not helpful

Both of those Calls went off without a hitch.

Here is the exception information for the CreateTimeLog()

Data: {System.Collections.ListDictionaryInternal} Error: {CounterSoft.Gemini.Commons.Rest.RestError} Message: "Exception has been thrown by the target of an invocation." Source: "CounterSoft.Gemini.WebServices" StackTrace: at CounterSoft.Gemini.WebServices.BaseService.ThrowResponseException(WebResponse response) at CounterSoft.Gemini.WebServices.BaseService.ProcessResponse[T](String url, Object obj, RequestType requestType) at CounterSoft.Gemini.WebServices.BaseService.GetResponse[T](String url, Object o, RequestType r) at CounterSoft.Gemini.WebServices.IssuesService.CreateTimeLog(Int32 issueId, IssueTimeEntryEN time) at (My Application)


Gent
· 1
Gent
helpful
0
not helpful

Can you post a code sample of this?

Also, please inspect the exception (RestError)  and check the inner exception and error within it.

It might give a clue to what is going wrong.


Saar Cohen
· 5000
Saar Cohen
helpful
0
not helpful

InnerException is Nothing

Public Shared Function AddTimeEntry(ByVal TimeEntry As IssueTimeEntryEN) As Boolean

    Dim result As Boolean = False
    Dim newTimeEntry As IssueTimeEntryEN

    '~~~~~~~~~~~~~~~~~~~~~~~~~
    '~~~ Setup connection ~~~~
    '~~~~~~~~~~~~~~~~~~~~~~~~~
    Dim serviceMan As CounterSoft.Gemini.WebServices.ServiceManager
    serviceMan = New CounterSoft.Gemini.WebServices.ServiceManager(GEMINI_WS_URL, GEMINI_USERNAME, GEMINI_WEBSERVICE_AUTH_STRING, "", False)

    TimeEntry.TimeEntryDate = DateTime.Now

    '~~~~~~~~~~~~~~~~~~~~~~~~~
    '~~~~ Send Time Entry ~~~~
    '~~~~~~~~~~~~~~~~~~~~~~~~~
    newTimeEntry = serviceMan.IssuesService.CreateTimeLog(TimeEntry.IssueID, TimeEntry)

    If newTimeEntry.IssueID = TimeEntry.IssueID Then result = True
    '~~~~~~~~~~~~~~~~~~~~
    '~~ Return Result ~~
    '~~~~~~~~~~~~~~~~~~~~
    Return result

End Function

When building the object to pass into the function I am filling the following fields:

DateCreated IssueID Hours Minutes User UserID


Gent
· 1
Gent
helpful
0
not helpful

Please make sure that you set the ProjectID of the time entry and make sure it is the project for the issue. Also, make sure that the user that the service manager is using is allowed to log time.


Saar Cohen
· 5000
Saar Cohen
helpful
0
not helpful

Thank you my friend, it appears you have resolved my issue.

Once the ProjectID field was set it went through fine.


Gent
· 1
Gent