Quantcast
Channel: Discussion Forum > Connect Data Services
Viewing all articles
Browse latest Browse all 2504

delete incident attachments with SOAP Api (3 Comments)

$
0
0

Topic by ilamukky

Hello  :)

I would like to delete incident file attachment through SOAP Api.

I tried this code, but I receive the error "The content type text/html; charset=UTF-8 of the response message does not match the content type of the binding (text/xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly."

publicvoid deleteIncidentAttachments(long incidentID, FileAttachmentIncident[] fattachs)
{
Incident incident = newIncident();
incident.ID = newID(); ;
incident.ID.id = incidentID;  // input
incident.ID.idSpecified = true;
 
incident.FileAttachments = fattachs;  // input, retrieved beforeforeach (FileAttachmentIncident x in incident.FileAttachments)
{
   x.action = SOAP.ActionEnum.remove;
}
RNObject[] objects = newRNObject[] { incident };

UpdateProcessingOptions options = newUpdateProcessingOptions();
options.SuppressExternalEvents = false;
options.SuppressRules = false;
 
ClientInfoHeader clientInfoHeader = newClientInfoHeader();
clientInfoHeader.AppID = "Incident update";
 
try
{
   client.Update(clientInfoHeader, objects, options);
} catch (Exception ex) {
   MessageBox.Show(string.Format("EXCEPTION:\n{0}\n{1}", ex.Message, ex.InnerException != null ? ex.InnerException.Message : ""));
 }
}

Viewing all articles
Browse latest Browse all 2504

Trending Articles