public long CreateIssue(Issue issue) { //Create a new issue long issueID = 0; CRMServiceClient client = new CRMServiceClient(); try { issueID = client.CreateIssue(issue); client.Close(); } catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); } catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); } catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); } return(issueID); }
public static long CreateIssue(Issue issue) { // long id = 0; CRMServiceClient client = null; try { client = new CRMServiceClient(); id = client.CreateIssue(issue); client.Close(); } catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); } catch (FaultException <CustomersFault> cfe) { client.Abort(); throw new ApplicationException(cfe.Detail.Message); } catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); } catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); } return(id); }