public CompositeType GetDataUsingDataContract(CompositeType composite) { if (composite == null) { throw new ArgumentNullException("composite"); } if (composite.BoolValue) { composite.StringValue += "Suffix"; } return composite; }
public CompositeType GetAnImage() { WebOperationContext.Current.OutgoingResponse.Headers.Add("Cache-Control", "no-cache"); var result = new CompositeType(); result.StringValue = "Here's a pic for ya"; var f = File.OpenRead(@"C:\Users\Consultant4\Pictures\2011-09-18 AnnetteLake\AnnetteLake 006.jpg"); byte[] buffer = new byte[f.Length]; f.Read(buffer, 0, (int)f.Length); result.Image = buffer; return result; }