Quantcast
Channel: Microsoft Dynamics CRM
Viewing all articles
Browse latest Browse all 71679

Forum Post: RE: Crm plugins

$
0
0
can u show me the code for the write file interface? i need help showing this is implemented for the interface. It's not clear to me where or how you are using the writefile method. I keep running into all sorts of errors. please help ,thank you Iservice1 file namespace TESSTCRMLibrary { // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IService1" in both code and config file together. [ServiceContract] public interface IService1 { [OperationContract] string GetData(int value); [OperationContract] CompositeType GetDataUsingDataContract(CompositeType composite); // TODO: Add your service operations here } // Use a data contract as illustrated in the sample below to add composite types to service operations. // You can add XSD files into the project. After building the project, you can directly use the data types defined there, with the namespace "WCF_CRMLibrary.ContractType". [DataContract] public class CompositeType { bool boolValue = true; string stringValue = "Hello "; [DataMember] public bool BoolValue { get { return boolValue; } set { boolValue = value; } } [DataMember] public string StringValue { get { return stringValue; } set { stringValue = value; } } } public class writeFile { void WriteFile(string filePath, string fileName) { if (File.Exists(fileName)) File.Create(filePath + "\\" + fileName + DateTime.Now.ToShortDateString()); else File.Create(filePath + "\\" + fileName); } } interface WriteFile { void WriteFile(string filePath, string fileName); } } Service 1 file public class Service1 : IService1 { public string GetData(int value) { return string.Format("You entered: {0}", value); } public CompositeType GetDataUsingDataContract(CompositeType composite) { if (composite == null) { throw new ArgumentNullException("composite"); } if (composite.BoolValue) { composite.StringValue += "Suffix"; } return composite; } public WriteFile WriteFile(string filePath, string fileName) { void; } } Plugin file WCFCrmLibrary.IService1 cs = new WCFCrmLibrary.IService1();

Viewing all articles
Browse latest Browse all 71679

Trending Articles