C# Can you use E10 web services to import a BPM Directive file programmatically

Hi,

I’ve been tasked to create a wizard to configure E10 and our integrated app to work with our customization’s. Everything has been going well so far except for one thing, doing a BPM directive import through web services. I have tried consuming the “BpDirectiveImport.svc” located in “/ERP100700/Erp/BO/BpDirectiveImport.svc”. But I get an exception even when hitting it directly in a browser, “The ServiceHostBase object returned from the CreateServiceHost method of type ‘Erp.Services.BO.BpDirectiveImportSvc, Erp.Services.BO.BpDirectiveImport’ is null.”

Any suggestions or Is this even possible?

Thanks!

Two parts…

First, honestly never tried going at that service like that directly. I am curious the use case if you don’t mind sharing.

Second that specific error is usually when the dll is not in Bin or ‘Assemblies’ - wherever the modules are configured to be within the web.config. Double check the dll is actually there. Also check the flight data recorder :wink:

Thanks for your reply!

The use case is, our development team has created a BPM customization file. Currently our installation documentation imports the BPM file through the UI (System Management > Business Process Management, open Directive Import Window). I would like to automate this if possible.

Currently, through web services, I’ve been able to automate the creation of Document Types, and Document Association Maintenance. The BPM import is the last thing we need to automate if it’s even possible.

The missing file is an interesting bit. In the Assemblies folders, I don’t see a “Erp.Services.BO.BpDirectiveImport.dll” or anything similar. But i’m not sure if the exception is specifying the namespace instead of an assembly. I’ll dig around the web.config file to see if it’s specified any where.

I have enabled all tracing in the AppServer.config

In the event Viewer, I don’t see any entries in the “Epicor App Server”. In the Application section, it provides a stack trace:

"WebHost failed to process a request.
Sender Information: System.ServiceModel.Activation.HostedHttpRequestAsyncResult/24416912
Exception: System.ServiceModel.ServiceActivationException: The service ‘/ERP100700/Erp/BO/BpDirectiveImport.svc’ cannot be activated due to an exception during compilation. The exception message is: The ServiceHostBase object returned from the CreateServiceHost method of type ‘Erp.Services.BO.BpDirectiveImportSvc, Erp.Services.BO.BpDirectiveImport’ is null… —> System.InvalidOperationException: The ServiceHostBase object returned from the CreateServiceHost method of type ‘Erp.Services.BO.BpDirectiveImportSvc, Erp.Services.BO.BpDirectiveImport’ is null.
at System.ServiceModel.ServiceHostingEnvironment.HostingManager.CreateService(String normalizedVirtualPath, EventTraceActivity eventTraceActivity)
at System.ServiceModel.ServiceHostingEnvironment.HostingManager.ActivateService(ServiceActivationInfo serviceActivationInfo, EventTraceActivity eventTraceActivity)
at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath, EventTraceActivity eventTraceActivity)
"

Thanks again!