Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XML Serialization: object not serialized

I'm getting an "Unspecified error" when I try to call a particular web-service method. Using XMLSpy I discover that the parameter object just hasn't been serialized.

In the generated serializer source I note the lines:

if (!needType) {
  System.Type t = o.GetType();
  if (t == typeof(global::moonraker1.Conference)) {
  }
  else {
    throw CreateUnknownTypeException(o);
  }
}

However, the wsdl import had created a unit called moonraker1.BookingService, so the type of the parameter object is actually moonraker1.BookingService.Conference. It seems entirely possible that this is why the object isn't serialised, although I don't understand why the message still appears to be passed to the web service.

Please can anyone shed any light on this? Or am I on entirely the wrong track?

like image 316
Tim Radford Avatar asked Dec 09 '10 16:12

Tim Radford


1 Answers

Now I'm not sure if this is it, but it looks like some .NET code. Maybe the answer is as simple as you need to have a default constructor in your type.

My own experience from serialization in .NET is that most of the time it's just because I have written a custom constructor and then forgot to write a default constructor afterwards..

like image 91
Nicklas Møller Jepsen Avatar answered Oct 07 '22 23:10

Nicklas Møller Jepsen