protected XmlObjectSerializer GetSerializer (WebContentFormat msgfmt, bool isWrapped, MessagePartDescription part)
{
switch (msgfmt) {
case WebContentFormat.Xml:
if (xml_serializer == null)
xml_serializer = isWrapped ? new DataContractSerializer (part.Type, part.Name, part.Namespace) : new DataContractSerializer (part.Type);
return xml_serializer;
case WebContentFormat.Json:
// FIXME: after name argument they are hack
if (json_serializer == null)
#if MOONLIGHT
json_serializer = new DataContractJsonSerializer (part.Type);
#else
json_serializer = isWrapped ? new DataContractJsonSerializer (part.Type, BodyName ?? part.Name, null, 0x100000, false, null, true) : new DataContractJsonSerializer (part.Type);
#endif
return json_serializer;
default:
throw new NotImplementedException ();
}
}