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 Pamela Fong <pa...@reuters.com> on 2002/06/18 22:50:09 UTC
object serialization
I have couple questions regarding object serialization.
1) Is there an easy way to serialize a java HashMap without having to write
my own custom serializer? I only need to pass some key-value pairs as
strings. I guess I can pass them as two string arrays if it's easier.
2) I have a simple Java bean that has 2 member Strings:
public class MyTestObject {
private String A;
private String B;
// getters and setters...
}
I wrote a simple service that does this:
String echoObject(MyTestObject obj)
I did make sure I have the <BeanMapping> attribute set in my deployment
descriptor.
I then use WSDL2Java to generate my client program. When running my
client program, I got this error:
<SOAP-ENV:Fault>
<faultcode
xmlns:ns1="http://xml.apache.org/axis/">ns1:Server.userException</faultcode>
<faultstring>org.xml.sax.SAXException: Invalid element in
test.myservice.MyTestObject - A</faultstring>
<detail>
<ns2:stackTrace
xmlns:ns2="http://xml.apache.org/axis/">org.xml.sax.SAXException: Invalid
element in test.myservice.MyTestObject - A
at
org.apache.axis.encoding.ser.BeanDeserializer.onStartChild(BeanDeserializer.
java:208)
Maybe I'm missing something really obvious. Does anyone know what it's
complaining about when it said "Invalid element"?
-pam