Skip to content

Instantly share code, notes, and snippets.

@djfr
Last active December 24, 2015 16:28
Show Gist options
  • Save djfr/6827866 to your computer and use it in GitHub Desktop.
Save djfr/6827866 to your computer and use it in GitHub Desktop.
public class DocumentClient : IDocumentService
{
public string InsertDocument(string documentClass, string filePath)
{
using (var service = new WcfService<IDocumentService>())
{
return InsertDocument(documentClass, filePath, service);
}
}
internal static string InsertDocument(string documentClass, string filePath, WcfService<IDocumentService> service)
{
try
{
return service.Channel.InsertDocument(documentClass, filePath);
}
catch (FaultException<CALFault> ex)
{
throw new DocumentCALException(ex);
}
catch (Exception ex)
{
throw new ServiceUnavailableException(ex.Message, ex);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment