I am getting below exception while running the below program. I am trying to use the future of "Send Fax" via easylink API.
Please response ASAP.
"Client found response content type of 'text/html', but expected 'text/xml'.
The request failed with the error message:"
--
Code follows ;
static void Main(string[] args)
{
//JobSubmitRequest Fax
// setup EMsgAPI object - EM
JobSubmitService EM = new JobSubmitService();
// setup Authentication objects
RequestAuthentication reqAuth = new RequestAuthentication();
XDDSAuthType XDDSAuth = new XDDSAuthType();
UIDType uid = new UIDType();
// init Authentication objects
XDDSAuth.Password = _password; uid.Value = _userId; XDDSAuth.RequesterID = uid; reqAuth.Item = XDDSAuth;
// Setup MessageObject
MessageType[] JS_Message = new MessageType[1];
JS_Message[0] = new MessageType();
// Setup JobOptions - CREF, Billing Code, FAX
JobOptionsType JS_JobOptions = new JobOptionsType();
EncodableStringType JS_CRef = new EncodableStringType();
EncodableStringType JS_BCode = new EncodableStringType();
FaxOptionsType JS_FaxOptions = new FaxOptionsType();
// set CREF and Billing Code
JS_BCode.Value = "BillCode";
JS_JobOptions.BillingCode = JS_BCode;
JS_CRef.Value = "CREF";
JS_JobOptions.CustomerReference = JS_CRef;
// Set FaxOptions
JS_FaxOptions.FaxMode = FaxModeType.standard;
JS_FaxOptions.FaxModeSpecified = true;
// Set JobOptions as FaxOptions
JS_JobOptions.FaxOptions = JS_FaxOptions;
// Set Message Object
JS_Message[0].JobOptions = JS_JobOptions;
// Free Objects
JS_JobOptions = null;
JS_FaxOptions = null;
JS_CRef = null;
JS_BCode = null;
// Setup Documents
DocumentType[] JS_Documents = new DocumentType[1];
JS_Documents[0] = new DocumentType();
// Setup reusable variables for the document
DocDataType DocData = new DocDataType();
string File;
//// Setup Document 1 - PDF
File = ReadAndEncodedFile(_file);
DocData.format = DocEncodingFormat.base64;
DocData.Value = File; JS_Documents[0].Item = DocData;
EncodableStringType myFileName = new EncodableStringType();
myFileName.Value = _file.Split("\\".ToCharArray()).Last(); // "Invoices_PDF.pdf";
JS_Documents[0].Filename = myFileName;
JS_Documents[0].DocType = _file.Split(".".ToCharArray()).Last(); //"PDF";
JS_Documents[0].ItemElementName = ItemChoiceType.DocData;
JS_Documents[0].@ref = "Doc1";
DocData = null;
// Setup Content
ContentsType EM_Content = new ContentsType();
EM_Content = new ContentsType();
ContentPartType[] JS_Content = new ContentPartType[1];
JS_Content[0] = new ContentPartType();
// Setup references to documents
JS_Content[0].Item = "Doc1";
JS_Content[0].Treatment = TreatmentType.body;
JS_Content[0].TreatmentSpecified = true;
// Setup List Object
FaxType[] faxtype = new FaxType[1];
faxtype[0] = new FaxType();
faxtype[0].Phone = _fax; JS_Message[0].Destinations = faxtype;
faxtype = null;
//EM_Content.DynamicContent = JS_Content;
EM_Content.Part = JS_Content; JS_Message[0].Contents = EM_Content;
JS_Message[0].MessageId = System.Environment.MachineName + DateTime.Now;
JS_Content = null;
// Everything is Setup Prepare to Launch Job
// Setup Request and JobSubmitRequest object
Request Request = new Request();
Response Response = new Response();
JobSubmitRequest JS_Request = <span style="color: #0000ff; font-family: Cons