I am trying to develop a web service with JBossWS 3.1.2 that has a HashMap as one of its arguments. I am using this version of JBossWS because that is what is distributed with the version of JBoss that I am using. I am using wsprovide to generate the WSDL and wsconsume to create WS client stubs.
A simplified version of my WebService is:
@WebService(targetNamespace = "http://localhost/ping", serviceName = "Ping")
@SOAPBinding(style = SOAPBinding.Style.RPC)
public class Ping {
@WebMethod
@WebResult(name="result")
public String ping(@WebParam(name="arguments") HashMap arguments) {
return "pong";
}
}
The WSDL created by wsprovide contains:
<types>
<xs:schema targetNamespace='http://localhost/ping' version='1.0' xmlns:tns='http://localhost/ping' xmlns:xs='http://www.w3.org/2001/XMLSchema'>
<xs:complexType name='hashMap'>
<xs:complexContent>
<xs:extension base='tns:abstractMap'>
<xs:sequence/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType abstract='true' name='abstractMap'>
<xs:sequence/>
</xs:complexType>
</xs:schema>
</types>
The generated client code contains an empty abstract class AbstractMap.java and an empty class HashMap.
I would have expected WSDL similar to the following to have been generated:
<complexType>
<sequence>
<element name="key" type="anyType" />
<element name="value" type="anyType" />
</sequence>
</complexType>
I also tried wrapping HashMap with a custom class (ParameterMap) but just got more of the same.
Is there a next step that I'm not seeing? Am I missing something or is this a limitation to the bottom up approach to developing Web Services with JBossWS?