• Post Reply Bookmark Topic Watch Topic
  • New Topic

Java Object Serialization/Deserialization  RSS feed

 
Jeff Maki
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey guys,

I see a lot of questions on the Internet that are *close*, but not close enough to my question to answer it--and I'm getting tired of looking!

I'm writing a client/server SOAP system with Axis. Simple enough. It's a mapping system integrated with a GIS. I have an object which represents an object in the GIS system--name, icon, etc, and I also have an object which I use elsewhere that holds the extent information--lat/long coordinates of a bounding box to query objects with.

Being that these objects are used elsewhere, I wanted to avoid changing them--so I wrote a set of serializers and deserializers according to the example (#5) in the Axis user guide.

When I run my client, though, it seems that the objects are being serialized with the bean serializer--there are fields in the XML that I didn't "serialize" in my serializer. I added a typeMapping in the WSDD, too.

But that's no big deal--I have to extra fields. Okay, but then when the server gets the extent, it tells me that it can't find a deserializer?!?

How can I deserialize these objects with my deserializers so the methods on the server can be called to query the database?

I'm assuming that I extend some object that represents the server, and would allow me to tell it, "when you get a request for x, deserialize the objects, then call my funciton y(x)" or something, but I can't figure out how to do so!


Thanks!!!

WSDD:

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

<service name="MapHubServer" provider="java:RPC">
<parameter name="className" value="org.maphub.server.Server"/>
<parameter name="scope" value="request"/>
<parameter name="allowedMethods" value="*"/>

<namespace>org.maphub</namespace>
</service>

<typeMapping qname="ns1:MHExtent" xmlns:ns1="org.maphub" languageSpecificType="java rg.maphub.MHExtent" serializer="org.maphub.MHExtentSerializerFactory" deserializer="org.maphub.MHExtentDeserializerFactory" encodingStyle=""/>
<typeMapping qname="ns1:MHObject" xmlns:ns1="org.maphub" languageSpecificType="java rg.maphub.MHObject" serializer="org.maphub.MHObjectSerializerFactory" deserializer="org.maphub.MHObjectDeserializerFactory" encodingStyle=""/>
</deployment>

Server Prototypes:

public class Server {
public Server() {
}

private String getUsername() {
}

public boolean authenticate(String username, String password) {
}

public MHObject[] queryExtent(org.maphub.MHExtent boundingBox) }
}
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!