private void TestProcessNodes(int nodeId) { imagelinks.ImageLinksClient imageLinksClient = new imagelinks.ImageLinksClient(); imageLinksClient.Endpoint.Address = new System.ServiceModel.EndpointAddress(imagelinksUri); imagelinks.OTAuthentication imagelinksAuthentication = new imagelinks.OTAuthentication(); try { imagelinks.Size originalSize = new imagelinks.Size(); originalSize.Height = 768; originalSize.Width = 1024; imagelinks.Size thumbSize = new imagelinks.Size(); thumbSize.Height = 120; thumbSize.Width = 160; imagelinks.Size previewSize = new imagelinks.Size(); previewSize.Height = 720; previewSize.Width = 1280; imagelinks.Size splashSize = new imagelinks.Size(); splashSize.Height = 480; splashSize.Width = 640; imagelinks.ProcessNodesParams testImagelinksParams = new imagelinks.ProcessNodesParams(); testImagelinksParams.OriginalNodeId = nodeId; testImagelinksParams.OriginalSize = originalSize; testImagelinksParams.PreviewSize = previewSize; testImagelinksParams.SplashSize = null; testImagelinksParams.ThumbSize = thumbSize; imagelinksAuthentication.AuthenticationToken = contentServerToken; imagelinks.ProcessNodesResult testProcessNodesResult = imageLinksClient.ProcessNodes(ref imagelinksAuthentication, testImagelinksParams); } catch (Exception ex) { System.Windows.Forms.MessageBox.Show(ex.Message); } finally { } }
private void TestProcessNodesWithUpload(int nodeId) { imagelinks.ImageLinksClient imageLinksClient = new imagelinks.ImageLinksClient(); imageLinksClient.Endpoint.Address = new System.ServiceModel.EndpointAddress(imagelinksUri); imagelinks.OTAuthentication imagelinksAuthentication = new imagelinks.OTAuthentication(); String[,] iptc = new String[30, 2]; String[,] exif = new String[50, 2]; String[,] gps = new String[5, 2]; String[,] icc = null; //new String[1, 2]; gps[0, 0] = "x-achse"; gps[1, 0] = "y-achse"; gps[2, 0] = "datum"; gps[3, 0] = "z-achse"; gps[4, 0] = "real"; gps[0, 1] = "15"; gps[1, 1] = "28"; gps[2, 1] = "13.06.2012"; gps[3, 1] = "56"; gps[4, 1] = "ja"; //Dictionary<String, String> t = new Dictionary<string, string>(); //t.Count try { imagelinks.Size originalSize = new imagelinks.Size(); originalSize.Height = 768; originalSize.Width = 1024; imagelinks.Size thumbSize = new imagelinks.Size(); thumbSize.Height = 120; thumbSize.Width = 160; imagelinks.Size previewSize = new imagelinks.Size(); previewSize.Height = 720; previewSize.Width = 1280; imagelinks.Size splashSize = new imagelinks.Size(); splashSize.Height = 480; splashSize.Width = 640; imagelinks.ProcessNodesParams testImagelinksParams = new imagelinks.ProcessNodesParams(); testImagelinksParams.OriginalNodeId = nodeId; testImagelinksParams.OriginalSize = originalSize; testImagelinksParams.PreviewSize = previewSize; testImagelinksParams.SplashSize = null; testImagelinksParams.ThumbSize = thumbSize; imagelinks.ArrayValues[] gpsValues2 = new imagelinks.ArrayValues[5]; gpsValues2[0] = getArrayValue(gps[0, 0], gps[0, 1]); gpsValues2[1] = getArrayValue(gps[1, 0], gps[1, 1]); gpsValues2[2] = getArrayValue(gps[2, 0], gps[2, 1]); gpsValues2[3] = getArrayValue(gps[3, 0], gps[3, 1]); gpsValues2[4] = getArrayValue(gps[4, 0], gps[4, 1]); List <imagelinks.ArrayValues> gpsValues = new List <imagelinks.ArrayValues>(); gpsValues.Add(getArrayValue(gps[0, 0], gps[0, 1])); gpsValues.Add(getArrayValue(gps[1, 0], gps[1, 1])); gpsValues.Add(getArrayValue(gps[2, 0], gps[2, 1])); gpsValues.Add(getArrayValue(gps[3, 0], gps[3, 1])); gpsValues.Add(getArrayValue(gps[4, 0], gps[4, 1])); testImagelinksParams.GPS = gpsValues2; imagelinks.Metadata previewMetadata = new imagelinks.Metadata(); imagelinks.Metadata thumbnailMetadata = new imagelinks.Metadata(); imagelinksAuthentication.AuthenticationToken = contentServerToken; imagelinks.ProcessNodesResult testProcessNodesResult = imageLinksClient.ProcessNodesWithUpload( ref imagelinksAuthentication, testImagelinksParams, previewMetadata, thumbnailMetadata, null); ContentServerContentService.ContentServiceClient contentServiceClient = new ContentServerContentService.ContentServiceClient(); contentServiceClient.Endpoint.Address = new System.ServiceModel.EndpointAddress(contentServiceUri); ContentServerContentService.OTAuthentication contentServiceAuthentication = new ContentServerContentService.OTAuthentication(); String fileName = @"C:\Users\Public\Pictures\Sample Pictures\preview.jpg"; ContentServerContentService.FileAtts testFileAtts = new ContentServerContentService.FileAtts(); FileInfo testFileInfo = new FileInfo(fileName); testFileAtts.CreatedDate = testFileInfo.CreationTime; testFileAtts.FileName = testFileInfo.Name; testFileAtts.FileSize = testFileInfo.Length; testFileAtts.ModifiedDate = testFileInfo.LastWriteTime; Stream content = File.Open(fileName, FileMode.Open); contentServiceAuthentication.AuthenticationToken = contentServerToken; contentServiceClient.UploadContent(ref contentServiceAuthentication, testProcessNodesResult.PreviewContext, testFileAtts, content); content.Close(); content.Dispose(); fileName = @"C:\Users\Public\Pictures\Sample Pictures\thumbnail.jpg"; testFileAtts = new ContentServerContentService.FileAtts(); testFileInfo = new FileInfo(fileName); testFileAtts.CreatedDate = testFileInfo.CreationTime; testFileAtts.FileName = testFileInfo.Name; testFileAtts.FileSize = testFileInfo.Length; testFileAtts.ModifiedDate = testFileInfo.LastWriteTime; content = File.Open(fileName, FileMode.Open); contentServiceAuthentication.AuthenticationToken = contentServerToken; contentServiceClient.UploadContent(ref contentServiceAuthentication, testProcessNodesResult.ThumbnailContext, testFileAtts, content); content.Close(); content.Dispose(); /* * fileName = @"C:\Users\Public\Pictures\Sample Pictures\splash.jpg"; * testFileAtts = new ContentServerContentService.FileAtts(); * testFileInfo = new FileInfo(fileName); * testFileAtts.CreatedDate = testFileInfo.CreationTime; * testFileAtts.FileName = testFileInfo.Name; * testFileAtts.FileSize = testFileInfo.Length; * testFileAtts.ModifiedDate = testFileInfo.LastWriteTime; * * content = File.Open(fileName, FileMode.Open); * * contentServiceAuthentication.AuthenticationToken = contentServerToken; * contentServiceClient.UploadContent(ref contentServiceAuthentication, testProcessNodesResult.SplashContext, testFileAtts, content); * content.Close(); content.Dispose(); */ } catch (Exception ex) { System.Windows.Forms.MessageBox.Show(ex.Message); } finally { } }