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

    Problems with ComplexTypes

    Frederico Borelli Newbie


      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
          catfishtyphoon Newbie

          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 Bhiwandiwala Newbie

            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...

            <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 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 name='getCurrentDate' qname='ns1:getCurrentDate' returnQName='result' returnType='ns2:dateTime' xmlns:ns1='http://docfinity.com' xmlns:ns2='http://www.w3.org/2001/XMLSchema' >
             <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 name='getUser' qname='ns1:getUser' returnQName='result' returnType='ns1:UserObject' xmlns:ns1='http://docfinity.com' >
             <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 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/' />
             <!-- Class not found, ignore type mapping
             qname='ns1:ArrayOfUserObject' xmlns:ns1='http://docfinity.com'
             qname='ns1:UserObject' xmlns:ns1='http://docfinity.com'
             <elementDesc fieldName='name' xmlName='name'/>
             <element name='name'/>
             <!-- Class not found, ignore type mapping
             qname='ns3:map' xmlns:ns3='http://java.sun.com/jax-rpc-ri/internal'