1 Reply Latest reply on Oct 5, 2005 1:38 PM by Thomas Diesler

    jbossWS-ws4ee type mapping of java.util.Map problem

    Mirek Kopriva Newbie

      Hi,
      I'm using jboss 4.0.2 and I'm having problem deploying/using webservices the ws2ee way.
      I could manage to make webservices work with SessionBeans, using the the supported parameters like String etc. but can not do it when having java.util.Map as a parameter.
      Here is what I tried to do:
      -Generate jaxrpc-mapping.xml + wsdl + webservices.xml from the ServiceEndpoint and a config by using wscompile from JWSDP 1.6.

      -Add type mapping for java.util.Map to META-INF/ws4ee-deployment.xml
      as described in http://wiki.jboss.org/wiki/Wiki.jsp?page=WSTypeMapping&version=6
      I'm using org.jboss.axis.encoding.ser.MapSerializerFactory.

      I noticed that in generated wsdl, the map is lowecase and that when I deploy the bean it complains about not finding java.util.map (lowercase all)

      Any help would be greately appreciated.

      Here is the config snipet I pass into wscompile: (tried type mappings here, but without any sucess)

      <configuration
       xmlns="http://java.sun.com/xml/ns/jax-rpc/ri/config">
       <service name="ConstructionService"
       targetNamespace="http://www.xxx.com/Construction"
       typeNamespace="http://www.xxx.com/Construction"
       packageName="com.xxx.ws">
       <interface name="com.xxx.ws.ConstructionEndpoint" />
      </configuration>


      Here is ws4ee-deployment.xml I use:
      <deployment
       xmlns='http://xml.apache.org/axis/wsdd/'
       xmlns:java='http://xml.apache.org/axis/wsdd/providers/java'
       xmlns:soap='http://schemas.xmlsoap.org/soap/encoding/'
       xmlns:xsi='http://www.w3.org/2000/10/XMLSchema-instance'
       xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
      
       <typeMapping
       xmlns:ns="http://www.xxx.com/Construction"
       qname="ns:map"
       type="java:java.util.Map"
       serializer="org.jboss.axis.encoding.ser.MapSerializerFactory"
       deserializer="org.jboss.axis.encoding.ser.MapDeserializerFactory"
       encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
       />
      </deployment>
      

      I checked the final wsdd generate by jboss is merged and looks fine.

      When I deploy the EJB I see this:
      ...
      16:17:43,265 WARN [JavaWsdlMapping] Cannot find jaxrpc-mapping for type: {http://java.sun.com/jax-rpc-ri/internal}map
      16:17:43,281 WARN [JavaWsdlMapping] Cannot find jaxrpc-mapping for type: {http://xml.apache.org/xml-soap}ArrayOfmap
      16:17:43,359 WARN [TypeMappingDescription] Class not found: java.util.map
      16:17:43,359 WARN [TypeMappingDescription] Class not found: java.util.ArrayOfmap
      16:17:43,375 INFO [AxisService] WSDD published to: C:\java\jboss-4.0.2\server\default\data\wsdl\ConstructionEjb.jar\ConstructionEndpoint.wsdd
      ...

      finaly snipet of the generated wsdl:
      ...
      <types>
      <complexType name="map">
       <complexContent>
       <restriction base="soap11-enc:Array">
       <attribute ref="soap11-enc:arrayType" wsdl:arrayType="tns:mapEntry[]"/>
      </restriction></complexContent></complexType>
       <complexType name="mapEntry">
       <sequence>
       <element name="key" type="anyType"/>
       <element name="value" type="anyType"/></sequence></complexType></schema>
       </types>

      ...