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.




Trouble creating issue via Webservice

web-app

I am having issues with the new webservice code, specifically the Components collection/array. the C# sample works fine (pointing at our webservice) but our VB code application has issues.

We have tried several methods and all seem to have issues. For example

ReDim Result.Components(0)
Result.Components(0) = New Countersoft.Gemini.Commons.IssueComponentEN
Result.Components(0).ComponentID = SomeFunctionReturningID()

line 3 says object reference not set to an instance of an object. Result.Components is length 1, but its nothing. Despite being initialised the line above to a new instance.


Have also tried declaring a new array of IssueComponentEN (size 1) and instantiating etc, but there are issues assiging Result.Components = MyNewArrayOfIssueComponentEN, I get the error unable to compare array (or something like that)

Any thoughts what's going wrong?

Simon@MailboxPro
· 1
Simon@MailboxPro
Replies (6)
helpful
0
not helpful

Is Result an IssueEN?

If so, then note that Components is an array of ComponentEN[]. So you must assign the same type and not an ArrayList for example.


Mark Wing
· 9108
Mark Wing
helpful
0
not helpful

Result is: Dim Result As New Countersoft.Gemini.Commons.IssueEN

I don't know why when i set Result.Components(0) = New Countersoft.Gemini.Commons.IssueComponent

when i hover over Result.Components, and interogate that, Result.Components(0) is nothing. Therefore result.Components(0).ComponentID = 3 (for example) failes because it is not set to an object.


Simon@MailboxPro
· 1
Simon@MailboxPro
helpful
0
not helpful

That is due to the internal working of the IssueEN class.

You should create the array yourself and then assign it.

Dim c(0) as IssueComponentEN

set c(0) = new IssueComponentEN

....

set Result.Components = c


Mark Wing
· 9108
Mark Wing
helpful
0
not helpful

Ok I will give that a try later, I did something similar and got errors on assigning to the Result.Components (it was trying to do an equality test rather than assignment, from what i could tell) I'll let you know how it goes in a few hours.


Simon@MailboxPro
· 1
Simon@MailboxPro
helpful
0
not helpful

Thanks, that seemed to work. I have similar issue with attachments, but will be the same issue i suspect. One question that now comes to mind, once you have added the array of FileEN to the attachments property, how should you go about adding more? Obviously, not being an IList(Of FileEN) for example, there is no .Add() method? How can more be added?


Simon@MailboxPro
· 1
Simon@MailboxPro
helpful
0
not helpful

The best way is to create a new List of the type and add to it, at the end assign it back to the issue (C# code):

List<IssueComponentEN> lst =new List<IssueComponentEN>(issue.Components);

lst.Add(....);

issue.Components = lst.ToArray();


Mark Wing
· 9108
Mark Wing