cancel
Showing results for 
Search instead for 
Did you mean: 

VBA Call WebServices: How to handle a returned empty complex array?

Former Member
0 Kudos

Hi,

These days I got a task to call a web service by VBA in Excel, but faced the following two problems about empty complex array.

<b>1. When the returned value of a web service contains empty array, it crashed with "SoapMapper: array dimensions do not match definition"</b>

Another guy faced the same question with me, detail at http://www.topxml.com/SOAPToolkit/rn-246726_SoapMapper-array-dimensions-do-not-match-definition.aspx

<b>2. When the input parameter contains empty array, it crashed with "Operation Not Supported"</b>

Dim arrayStudent() As Student

Call webservice.DoThings( arrayStudent )

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Use dummy row to avoid empty array.

former_member583013
Active Contributor
0 Kudos

Did you just answer yourself???

Greetings,

Blag.

Former Member
0 Kudos

I didn't find the answer of the this questions.

The dummy line is one solution so I posted it.

Thanks

gregorw
Active Contributor
0 Kudos

Hello,

we have faced the same Problem in our PHP / Typo3 solution. We used this switch:

	
$object_array = array();
if (is_object($salesorders->SALES_ORDERS_HEAD->item)) {
	$object_array[] = $salesorders->SALES_ORDERS_HEAD->item;
} else {
	$object_array = $salesorders->SALES_ORDERS_HEAD->item;
}

Best regards

Gregor

Former Member
0 Kudos

Hi Roy,

I know this was posted years ago, but could you tell me more in detail how you resolved this issue. How did you add a dummy row?