MessageBodyWriter not found for media type=application/x-hl7



We try to post an XML doc on a web server using the following code and we receive the error message: "org.glassfish.jersey.message.internal.MessageBodyProviderNotFoundException: MessageBodyWriter not found for media type=application/x-hl7". What we do wrong? Any help we be appreciated.



private void postWebClientTypeVisit()
{
XmlDocument doc = new XmlDocument();
doc.LoadXml(createStringXML());
string myParameters = doc.InnerXml;

string URI = "http://ift.tt/1BBZKL0";

WebClient wc = new WebClient();
wc.Headers[HttpRequestHeader.Authorization] = "Bearer " + accessToken;
wc.Headers[HttpRequestHeader.Accept] = "application/x-hl7";

string HtmlResult = wc.UploadString(URI, myParameters);
}


...createStringXML() is something like that:



private static string createStringXML()
{
string str = @"<?xml version='1.0' encoding='UTF-8'?>" +
@"<ClinicalDocument xmlns='urn:hl7-org:v3' xmlns:xsi='http://ift.tt/ra1lAU' xsi:schemaLocation='urn:hl7-org:v3 CDA.xsd'>" +
//.....
@"<title>PRESCRIPTIONS</title><text /></section></component></structuredBody></component></ClinicalDocument>";

return str;
}

No comments:

Post a Comment