I hope i am explaining this correctly.
I am getting the error below, and thinking it has something to do with the namespace (see highlighted)
Is there a way to strip off the namespace when I build up my object to serialize to XML.
So when i build up the object (see below)
I thing the issue is the namespace that is showing up before the "HCIM_IN_GetDemographics"
Here is my debugging code on when i serialize:
System.Diagnostics.Debug.WriteLine(Serialize(batchRequest));
public static string Serialize(Object obj)
{
try
{
using (var sw = new StringWriter())
{
string objType = obj.GetType().Name.ToString();
var serializer = new XmlSerializer(obj.GetType(), new Type[] { obj.GetType() });
XmlSerializerNamespaces namespaces = new XmlSerializerNamespaces();
namespaces.Add("hl7", "urn:hl7-org:v3");
serializer.Serialize(sw, obj, namespaces);
return sw.GetStringBuilder().ToString();
}
}
catch (Exception e) { return e.Message; }
}I guess my question is, (assuming the Namespace is the issue) Is there anyway to remove that namespace, so that when i serialize the object, it won't give me that error?
Any ideas are greatly appreciated.
Thanks in advance !