CounterSoft User Forums

Welcome to CounterSoft User Forums Sign in | Join | Help
Home Forums

Exception has been thrown by the target of an invocation.

Last post 03-05-2010, 8:02 PM by Gent. 12 replies.
Sort Posts:
  •  03-05-2010, 5:11 PM

    Exception has been thrown by the target of an invocation.

    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?
  •  03-05-2010, 5:12 PM

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

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

  •  03-05-2010, 5:18 PM

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

    Gemini 3.5.4 (Build 2435)

    And nothing logged today.
  •  03-05-2010, 5:22 PM

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

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

  •  03-05-2010, 6:54 PM

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

    As soon as the call occurs
  •  03-05-2010, 7:03 PM

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

    Do you get an error when you try the GetUser or WhoAmI call?
  •  03-05-2010, 7:08 PM

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

    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.
  •  03-05-2010, 7:17 PM

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

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

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


  •  03-05-2010, 7:29 PM

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

    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)
  •  03-05-2010, 7:34 PM

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

    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.


  •  03-05-2010, 7:44 PM

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

    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
  •  03-05-2010, 7:48 PM

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

    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.
  •  03-05-2010, 8:02 PM

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

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

    Once the ProjectID field was set it went through fine.
View as RSS news feed in XML