You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Be...@VerizonWireless.com on 2005/05/04 17:21:54 UTC

struggling with typeMapping / beanMapping

Greetings, all -

I have been having a merry time indeed with Axis, deploying services,
creating Service objects by passing the URL of the automatically generated
WSDL file and then performing call() on them, all without any issue.  I then
started experimenting with serialization.

I have a class named "test.Configuration" used by a service called "SNIS".
This class started life as a fairly sophisticated animal so I wrote a
serializer (test.ConfigurationSerialzer) and deserializer
(test.ConfigurationDeserializer) for it so I could pass them around natively
via the Axis engine, and then wrote factories (test.ConfigurationSerFactory
and test.ConfigurationDeserFactory) to procure them.  I got all of this
information out of the Developer's Guide and again it all semed enormously
straightforward.

I wrote the SNIS service deployment as follows :

===========================================
<deployment xmlns="http://xml.apache.org/axis/wsdd/"
            xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">

<service name="SNIS" provider="java:RPC">
<typeMapping qname="ns1:Configuration" xmlns:ns1="test"
             type="java:test.Configuration"
             serializer="test.ConfigurationSerFactory"
             deserializer="test.ConfigurationDeserFactory"
             encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
  <parameter name="className" value="test.SNIS"/>
  <parameter name="allowedMethods" value="*"/>
  <parameter name="scope" value="application"/>
 </service>
</deployment>
===========================================

Axis seemed happy with it when I deployed it via the AdminTool, but I
noticed that when I checked out the WSDL file which Axis created for it
(http://myserver:8080/axis/services/SNIS?wsdl) it lacked any of the type
information I expected regarding the Configuration class, and when I
attempted to use the service, I got the following error:

=========================================================
     [java] - URL : http://myserver:8080/axis/services/SNIS?wsdl
     [java] - NAME : SNISService
     [java] - creating service with
[http://myserver:8080/axis/services/SNIS?wsdl, SNISService]
     [java] - creating qname with [http://myserver:8080/axis/services/SNIS,
SNISService]
     [java] - ServiceException : javax.xml.rpc.ServiceException: Error
processing WSDL document:
     [java] java.io.IOException: Type {test}Configuration is referenced but
not defined.
=========================================================

I have been experimenting with the deployment file for 3 days and have not
yet found the magic incantation required to make the serializers work.  One
interesting thing I notice is that if I remove the "typeMapping" section
entirely then suddenly the WSDL file contains the information I expected to
see regarding the Configiration class in the first place.  Also, the test
client runs, and can list the methods available in the SNIS service, but
when I attempt to call the method which uses the Configuration class, I of
course get this error:

=========================================================
     [java] - URL : http://myserver:8080/axis/services/SNIS?wsdl
     [java] - NAME : SNISService
     [java] - creating service with
[http://myserver:8080/axis/services/SNIS?wsdl, SNISService]
     [java] - creating qname with [http://myserver:8080/axis/services/SNIS,
SNISService]
     [java] name: setConfiguration
     [java] name: execPing
     [java] name: getConfiguration
     [java] name: addConfiguration
     [java] name: execTraceroute
     [java] - exception in serviceCall : java.io.IOException: No serializer
found for class test.Configuration in registry
org.apache.axis.encoding.TypeMappingDelegate@d5276a
     [java] AxisFault
=========================================================

This error makes perfect sense to me, it's what sent me scurrying to the
developer's guide to figure out how to make this work.  I've read the test
de/serializer and associated factory code, it all seemed to make sense,
only... I cannot make it work.  Nothing I do seemes correct.  If I do not
put the typeMapping section in the WSDD file, Axis seems to know the type
(it shows up in the WSDL file it generates) but can't find the serializer
for it.  If I put the typeMapping section in to describe the serializer,
Axis seems not to know anything about the type any more, and nothing I've
done makes this situation make any sense.

I even went so far as to lobotomize my Configuration class so I could use
the beanMapping, but that gives me exactly the same errors - if I don't put
the beanMapping section in then Axis knows about the Configuration class and
puts it into the WSDL.  If I put in the beanMapping section that type
information goes away and I get the "referenced but not defined" error.  I
could fill pages more with variations on the errors above as I've diddled
the WSDD file trying to make the thing work but it would be pointless - I'm
certain that I've missed something crucial, I just can't figure it out.

Any help is vastly appreciated!

Best Regards,

Ben
___________________________________________________________________
The information contained in this message and any attachment may be
proprietary, confidential, and privileged or subject to the work
product doctrine and thus protected from disclosure.  If the reader
of this message is not the intended recipient, or an employee or
agent responsible for delivering this message to the intended
recipient, you are hereby notified that any dissemination,
distribution or copying of this communication is strictly prohibited.
If you have received this communication in error, please notify me
immediately by replying to this message and deleting it and all
copies and backups thereof.  Thank you.