private void cmdCFSUpload_Click(object sender, EventArgs e) { //CFSUploadRequest // setup EMsgAPI object - EM EMsgAPI_Demo.EMsgAPI_CFSUpload_201101.CFSUploadService EM = new EMsgAPI_Demo.EMsgAPI_CFSUpload_201101.CFSUploadService(); // setup Authentication objects EMsgAPI_CFSUpload_201101.RequestAuthentication reqAuth = new EMsgAPI_CFSUpload_201101.RequestAuthentication(); EMsgAPI_CFSUpload_201101.XDDSAuthType XDDSAuth = new EMsgAPI_CFSUpload_201101.XDDSAuthType(); EMsgAPI_CFSUpload_201101.UIDType uid = new EMsgAPI_CFSUpload_201101.UIDType(); // init Authentication objects XDDSAuth.Password = txtAccessCode.Text; uid.Value = txtUserId.Text; XDDSAuth.RequesterID = uid; reqAuth.Item = XDDSAuth; // Setup Premiere Connect Request / Response and CFSDownload Request / Result EMsgAPI_Demo.EMsgAPI_CFSUpload_201101.Request Request = new EMsgAPI_Demo.EMsgAPI_CFSUpload_201101.Request(); EMsgAPI_Demo.EMsgAPI_CFSUpload_201101.Response Response = new EMsgAPI_Demo.EMsgAPI_CFSUpload_201101.Response(); EMsgAPI_Demo.EMsgAPI_CFSUpload_201101.CFSUploadRequest Submit_Request = new EMsgAPI_Demo.EMsgAPI_CFSUpload_201101.CFSUploadRequest(); EMsgAPI_Demo.EMsgAPI_CFSUpload_201101.CFSUploadResult Submit_Result = new EMsgAPI_Demo.EMsgAPI_CFSUpload_201101.CFSUploadResult(); // Setup reusable variables for the document EMsgAPI_Demo.EMsgAPI_CFSUpload_201101.DocDataType DocData = new EMsgAPI_Demo.EMsgAPI_CFSUpload_201101.DocDataType(); string File; File = ReadAndEncodedFile(txtCSFFileUpload.Text, true); DocData.format = EMsgAPI_Demo.EMsgAPI_CFSUpload_201101.DocEncodingFormat.base64; DocData.Value = File; // Setup Proxy server and EMsgAPIConnect URL for posting data Set_Server_and_Proxy(EM); // Setup Reqeust Object // Setup Reqeust Object Request.ReceiverKey = EM.Url; Request.Authentication = reqAuth; // Assign Reqeust and Response objects to EM Object EM.RequestValue = Request; EM.ResponseValue = Response; Submit_Request.RelativePath = "/testfile.html"; //Submit_Request.FileData = DocData; Submit_Request.Item = DocData; Submit_Request.ReplaceExistingSpecified = false; try { Submit_Result = EM.CFSUpload(Submit_Request); } catch (Exception ex) { System.Console.WriteLine(ex.Message); System.Console.Read(); return; } if (Submit_Result != null) { if (Submit_Result.Status.StatusCode != "0") { MessageBox.Show(Submit_Result.Status.StatusMessage, "Error"); } } string emfilename = "emresponse.xml"; string resfilename = "result.xml"; //string reqfilename = "request.xml"; try { //This will output the response, result and request(if uncommented) to XML files in the //installed directory. This can be very usefull for debugging or ir help is requested from //the EMAPI support team if (chkResult) { serializeResult(emfilename, EM.ResponseValue); serializeResult(resfilename, Submit_Result); //serializeResult(reqfilename, Submit_Request); } } catch (IOException io_error) { MessageBox.Show("Error - " + io_error, "Error", MessageBoxButtons.OK); } }