Skip to content
This repository was archived by the owner on Feb 5, 2019. It is now read-only.
This repository was archived by the owner on Feb 5, 2019. It is now read-only.

JAXB doesn't support collection classes as top level objects #223

Open
@glassfishrobot

Description

@glassfishrobot

JAXB 2.0 has no provision of handling any collection class as a top-level
object. It can only handle them as properties of beans. To use jax-ws without
the need for wrapper classes for collections, jaxb needs to support this.

Scenario:
If you try to build a webservice with JAX-WS 2.0 and use a collection class in a
service method directly, the generated schema is useless.

Example:

@webservice
@SOAPBinding(style = Style.RPC)
public class CollectionAsParamTestService
{
public void testCollections(ArrayList stringList)
{

}
}

If I generate the wsdl and the corresponding schema with wsgen, the wsdl is
generated with the following message fragment:

So far so good. Now the generated schema:

<xs:schema version="1.0"
targetNamespace="http://impl.service.webservice.fss.portal.o2.com/"
xmlns:xs="http://www.w3.org/2001/XMLSchema">

<xs:complexType name="arrayList">
xs:complexContent
<xs:extension base="ns1:abstractList"
xmlns:ns1="http://impl.service.webservice.fss.portal.o2.com/">
xs:sequence/
</xs:extension>
</xs:complexContent>
</xs:complexType>

<xs:complexType name="abstractList" abstract="true">
xs:complexContent
<xs:extension base="ns2:abstractCollection"
xmlns:ns2="http://impl.service.webservice.fss.portal.o2.com/">
xs:sequence/
</xs:extension>
</xs:complexContent>
</xs:complexType>

<xs:complexType name="abstractCollection" abstract="true"/>
</xs:schema>

So the xsd:string is missing inside the xs:sequence from the service call.

See also https://jax-ws.dev.java.net/issues/show_bug.cgi?id=28

Environment

Operating System: All
Platform: All

Affected Versions

[2.0.2]

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions