2 Replies Latest reply on Mar 20, 2006 10:40 AM by zoharat

    Problems with ComplexTypes

    fred_borelli

      Hi,

      i'm new to JBoss and trying to use with Web Services.

      I've made a session bean that has just a method Hello() that returns the "hello" string, and currently it is working, with help of XDoclet. Webservice files (WSDL, deployment descriptor) are generated with AXIS (Java2WSDL) and XDoclet. It's working, i can access it from a WS Client.

      But when i added a method in the same service with a complex type (a JavaBean "ExampleBean" with int and double fields) as a parameter, jboss deployment gives me the following error :

      ERROR [ServiceDeployer] Cannot startup webservice for: example.jar
      org.jboss.deployment.DeploymentException: Cannot deploy webservice; - nested throwable: (java.lang.IllegalArgumentException: Cannot find package type for: {urn:br.test.ejbtest}ExampleBean)
      


      What I am doing wrong ? Anyone can help me ?

      Thanks a lot for any help!

        • 1. Re: Problems with ComplexTypes

          You're probably way ahead of me, but I am doing the same kind of thing, looking at the instructions on http://wiki.jboss.org/wiki/Wiki.jsp?page=WSTypeMapping
          Oddly, without any configuration changes from my very simple web service, the server side is serializing my simple bean through introspection, as evidenced by the SOAP xml that comes through with all the properties it should have. The problem for me is on the client side:

          org.xml.sax.SAXException: Deserializing parameter 'result': could not find deserializer for type {http://com.internap.webservices.nubs/types}SimpleBean
          

          This seems a bit rude of the client since the server was able to figure it out and the client is compiled with a ref to the type. So how do I register the {http://com.internap.webservices.nubs/types} namespace to map to the com.internap.webservices.nubs package on the client side?

          • 2. Re: Problems with ComplexTypes
            zoharat

            Hey,
            I am trying to attain the same thing. I have a UserObject which serializable , and it has just one property called name. I did not have a ws4ee-deployment.xml in the web-inf folder.

            It yet serialized the UserObject.

            I had methods which returned an array of the UserObject and a Map of the UserObject.

            The generated wsdd did not find the serializers and deserializers for the Array OfUserObject nor for the map.

            When I created a static client, I could use methods which used UserObject as return and input types, even the Array of UserObjects worked. But Maps didn't work.

            When I switched over to dynamic clients the UserObject , Array of UserObject nor maps would work.

            Do I need to wrtie my own serializers/deserializers, if so could somone provide information on how they are to be done.

            Do I need to add more informaiton in to the deployement descritors..

            Have been struggling with this issue for a couple of days please help..

            This is the wsdd that gets generated...

            <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/2001/XMLSchema-instance'
             xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
            
            <service name='WebService_RPCEncoded.ear/WebService_RPCEncoded.war#TestWebService/WebServiceIntf' style='rpc' use='encoded' provider='Handler'>
            
             <parameter name='webserviceID' value='WebService_RPCEncoded.ear/WebService_RPCEncoded.war#TestWebService/WebServiceIntf' />
             <parameter name='handlerClass' value='org.jboss.webservice.server.InvokerProviderJSE' />
            
             <operation name='changeUser' qname='ns1:changeUser' returnQName='result' returnType='ns1:UserObject' xmlns:ns1='http://docfinity.com' >
             <parameter name='UserObject_1' qname='UserObject_1' mode='IN' type='ns1:UserObject' xmlns:ns1='http://docfinity.com' />
             </operation>
             <operation name='changeUsers' qname='ns1:changeUsers' returnQName='result' returnType='ns1:ArrayOfUserObject' xmlns:ns1='http://docfinity.com' >
             <parameter name='arrayOfUserObject_1' qname='arrayOfUserObject_1' mode='IN' type='ns1:ArrayOfUserObject' xmlns:ns1='http://docfinity.com' />
             </operation>
             <operation name='getCurrentDate' qname='ns1:getCurrentDate' returnQName='result' returnType='ns2:dateTime' xmlns:ns1='http://docfinity.com' xmlns:ns2='http://www.w3.org/2001/XMLSchema' >
             </operation>
             <operation name='getNextDate' qname='ns1:getNextDate' returnQName='result' returnType='ns2:dateTime' xmlns:ns1='http://docfinity.com' xmlns:ns2='http://www.w3.org/2001/XMLSchema' >
             <parameter name='Date_1' qname='Date_1' mode='IN' type='ns2:dateTime' xmlns:ns2='http://www.w3.org/2001/XMLSchema' />
             </operation>
             <operation name='getUser' qname='ns1:getUser' returnQName='result' returnType='ns1:UserObject' xmlns:ns1='http://docfinity.com' >
             </operation>
             <operation name='getUserMap' qname='ns1:getUserMap' returnQName='result' returnType='ns3:map' xmlns:ns1='http://docfinity.com' xmlns:ns3='http://java.sun.com/jax-rpc-ri/internal' >
             <parameter name='Integer_1' qname='Integer_1' mode='IN' type='ns4:int' xmlns:ns4='http://schemas.xmlsoap.org/soap/encoding/' />
             </operation>
             <operation name='getUsers' qname='ns1:getUsers' returnQName='result' returnType='ns1:ArrayOfUserObject' xmlns:ns1='http://docfinity.com' >
             <parameter name='Integer_1' qname='Integer_1' mode='IN' type='ns4:int' xmlns:ns4='http://schemas.xmlsoap.org/soap/encoding/' />
             </operation>
            
             <!-- Class not found, ignore type mapping
             <typeMapping
             qname='ns1:ArrayOfUserObject' xmlns:ns1='http://docfinity.com'
             type='java:com.docfinity.webservice.ArrayOfUserObject'
             serializer='null'
             deserializer='null'
             encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'>
             </typeMapping>
             -->
            
             <typeMapping
             qname='ns1:UserObject' xmlns:ns1='http://docfinity.com'
             type='java:com.docfinity.webservice.UserObject'
             serializer='org.jboss.webservice.encoding.ser.MetaDataBeanSerializerFactory'
             deserializer='org.jboss.webservice.encoding.ser.MetaDataBeanDeserializerFactory'
             encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'>
             <typeDesc>
             <elementDesc fieldName='name' xmlName='name'/>
             <elementOrder>
             <element name='name'/>
             </elementOrder>
             </typeDesc>
             </typeMapping>
            
             <!-- Class not found, ignore type mapping
             <typeMapping
             qname='ns3:map' xmlns:ns3='http://java.sun.com/jax-rpc-ri/internal'
             type='java:java.util.map'
             serializer='null'
             deserializer='null'
             encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'>
             </typeMapping>
             -->
            
            
            </service>
            </deployment>