Skip to main content

List when sent across SOAP

1 reply [Last post]
Joined: 2005-07-12

Hi everyone,

I have a schema that needs to be sent across in SOAP message. I have attached an abridged version of this schema. The purpose for such a complicated schema is:
If A1 is present, it can also have A2
But if A1 is not present A2 has to be there
The schema for the same is attached at the end.

On trying Jaxws the Arg class generated does not have a structure but has a List which is expected behaviour as clear from my earlier question. But when I start using this Arg class to generate client and server, I see that though the client is able to successfully generate the list the server always miss them. Using the same piece of code for a modified wsdl i.e. use A3 instead of A2 in second sequence works fine.

Is there a working example where List is used? For reference I am attaching the relevant client and server code also. In client the response I receive is 'Length of List is-0'.

The WSDL structure:

public Resp getSoapResponse(Arg request){
StringBuffer str = new StringBuffer();
ArrayList> list = ( ArrayList>) request.getContent();
str.append("Length of List is- " + request.getContent().size());
Resp resp = new Resp();
return resp;

try {
ServiceFactory serviceFactory = ServiceFactory.newInstance();

Nic1Service service = (Nic1Service) serviceFactory.createService((, Nic1Service.class);

Nic1ServicePortType port = service.getNic1ServicePort();

ObjectFactory objf = new ObjectFactory();

Arg request = new Arg();



System.out.println("Input Size is: " + request.getContent().size());

Resp resp = port.getSoapResponse(request);
System.out.println("The response is: " + resp.getR1()) ;

} catch (RemoteException ex) {

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2003-06-16

We will look into this as soon as we can.