Using a returned SOAP array

This feels like a ridiculous question, but Google is not being any help.

How do I actually use a value returned as an instance of a subclass of

org.xmlsoap.schemas.soap.encoding.Array

? I am trying to use XFire for the client code calling another system. I have the code generating properly from the WSDL, and I can make the call that is supposed to return an instance of a class that extends Array. There is a Holder<Integer> parameter which is returning with the right size of the output. And sniffing the SOAP messages, the data is being returned in the XML document. But the API for Array doesn't seem to give me any way to access the elements. And this class adds nothing I can see to the API:

@XmlAccessorType(XmlAccessType.FIELD)

@XmlType(name ="arEventList")

publicclass ArEventList

extends Array

{

}

In the test code, I try the entire API, and get back nothing of value I can see, except for the size of the array, which isn't actually stored in the Array itself but in a mutable parameter.

EventsServiceClient client =new EventsServiceClient();

Events events = client.getEventsPort(getServerUrl());

Holder<Integer> countHolder =new Holder<Integer>();

ArEventList list = events.getEventListById(getSessionToken(), 0,

100000, 44, false, countHolder);

System.out.println(list.getAny());// => []

System.out.println(list.getOtherAttributes());// => {}

System.out.println(list.getArrayType());// => null

System.out.println(list.getHref());// => "#0"

System.out.println(list.getId());// => null

System.out.println(list.getOffset());// => null

System.out.println(countHolder.value);// => 788

So how can I get at the actual elements returned in the Array?

-- Scott

[2296 byte] By [Scott_Sauyeta] at [2007-11-27 11:27:45]
# 1

Check the XFire docs.

Axis just maps WS arrays to corresponding Java arrays of the correct type for you, I'd be highly surprised if XFire can't do the same.

jwentinga at 2007-7-29 16:17:58 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2

Thanks for the response.

> Check the XFire docs.

So far, they haven't been much help.

> Axis just maps WS arrays to corresponding Java arrays

> of the correct type for you, I'd be highly surprised

> if XFire can't do the same.

I think there are underlying problems beyond this. Even simple types aren't coming back correctly. It may be a miscommunication between the Delphi-based server and XFire on the format of the SOAP documents. I'm looking into that now.

But when you say Axis maps the arrays, how do you get at them; it's not a simple cast, is it? The generated code is of a class that extends but doesn't add any behavior to the WS Array. The API of that class doesn't seem to allow any way to get at the Array of my type, unless that's what this does:

List<Object> getAny()

At a guess, that's what's going on, and the data, which I can see in the SOAP document, is not formatted by the server in a way that XFire can recognize. But I'm going to have to chew on that one some more.

Thanks again,

-- Scott

Scott_Sauyeta at 2007-7-29 16:17:58 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...