我正在创建一个COM可见的C#对象,用于代理VB6应用程序对Web服务的调用。 我有一个返回对象数组的方法。
public DocActionReport[] DocActionReportByDateRange(System.DateTime reportStartDate, System.DateTime reportEndDate)
{
object[] results = this.Invoke("DocActionReportByDateRange", new object[] {
reportStartDate,
reportEndDate});
return ((DocActionReport[])(results[0]));
}
当我通过VB6调用此方法,如下所示:
Dim proxy As New QueueMovementServiceClient.ReadQueueInfo
Dim report() As QueueMovementServiceClient.DocActionReport
report = proxy.DocActionReportByDateRange(startDate, reportEndDate)
该方法已经成功执行(我可以通过web服务的日志看到),但没有任何数据返回给VB6对象(LBound(report) == 0, UBound(report) == -1
)。
我尝试了几种不同的方法(将方法更改为void方法并将集合作为ref
参数传递),但是目前都没有成功。
我需要怎么做才能将对象数组(列表,集合或其他)返回给VB6消费者?