Hi,
I'm using MVC5AJ. I'm trying to added WSDL service into my MVC5AJ1.
But I'm getting exception of my WSDL service class injection when I using swagger to called my App Service.
This is shown how I injected my WSDL service class in my App Service: [attachment=0:2ixby69b]WhatsApp Image 2018-08-13 at 2.27.13 PM.jpeg[/attachment:2ixby69b]
The below code is shown what exception I'm getting:
{
"message": "An error has occurred.",
"exceptionMessage": "ComponentActivator: could not proxy Abp.WebApi.Controllers.Dynamic.DynamicApiController`1[[MVC5AJ1Demo.CRMAuthentication.ICrmAuthenticationAppService, MVC5AJ1Demo.Application, Version=5.6.0.0, Culture=neutral, PublicKeyToken=null]]",
"exceptionType": "Castle.MicroKernel.ComponentActivator.ComponentActivatorException",
"stackTrace": " at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.CreateInstance(CreationContext context, ConstructorCandidate constructor, Object[] arguments)\r\n at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.Instantiate(CreationContext context)\r\n at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.InternalCreate(CreationContext context)\r\n at Castle.MicroKernel.ComponentActivator.AbstractComponentActivator.Create(CreationContext context, Burden burden)\r\n at Castle.MicroKernel.Lifestyle.AbstractLifestyleManager.CreateInstance(CreationContext context, Boolean trackedExternally)\r\n at Castle.MicroKernel.Lifestyle.AbstractLifestyleManager.Resolve(CreationContext context, IReleasePolicy releasePolicy)\r\n at Castle.MicroKernel.Handlers.DefaultHandler.ResolveCore(CreationContext context, Boolean requiresDecommission, Boolean instanceRequired, Burden& burden)\r\n at Castle.MicroKernel.Handlers.DefaultHandler.Resolve(CreationContext context, Boolean instanceRequired)\r\n at Castle.MicroKernel.Handlers.AbstractHandler.Resolve(CreationContext context)\r\n at Castle.MicroKernel.DefaultKernel.ResolveComponent(IHandler handler, Type service, IDictionary additionalArguments, IReleasePolicy policy)\r\n at Castle.MicroKernel.DefaultKernel.Castle.MicroKernel.IKernelInternal.Resolve(Type service, IDictionary arguments, IReleasePolicy policy)\r\n at Castle.MicroKernel.DefaultKernel.Resolve(Type service, IDictionary arguments)\r\n at Castle.Windsor.WindsorContainer.Resolve(Type service)\r\n at Abp.Dependency.IocManager.Resolve(Type type)\r\n at Abp.Dependency.IocResolverExtensions.ResolveAsDisposable[T](IIocResolver iocResolver, Type type)\r\n at Abp.WebApi.Controllers.AbpApiControllerActivator.Create(HttpRequestMessage request, HttpControllerDescriptor controllerDescriptor, Type controllerType)\r\n at System.Web.Http.Controllers.HttpControllerDescriptor.CreateController(HttpRequestMessage request)\r\n at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__15.MoveNext()",
"innerException": {
"message": "An error has occurred.",
"exceptionMessage": "ComponentActivator: could not proxy MVC5AJ1Demo.CRMAuthentication.CrmAuthenticationAppService",
"exceptionType": "Castle.MicroKernel.ComponentActivator.ComponentActivatorException",
"stackTrace": " at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.CreateInstance(CreationContext context, ConstructorCandidate constructor, Object[] arguments)\r\n at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.Instantiate(CreationContext context)\r\n at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.InternalCreate(CreationContext context)\r\n at Castle.MicroKernel.ComponentActivator.AbstractComponentActivator.Create(CreationContext context, Burden burden)\r\n at Castle.MicroKernel.Lifestyle.AbstractLifestyleManager.CreateInstance(CreationContext context, Boolean trackedExternally)\r\n at Castle.MicroKernel.Lifestyle.AbstractLifestyleManager.Resolve(CreationContext context, IReleasePolicy releasePolicy)\r\n at Castle.MicroKernel.Handlers.DefaultHandler.ResolveCore(CreationContext context, Boolean requiresDecommission, Boolean instanceRequired, Burden& burden)\r\n at Castle.MicroKernel.Handlers.DefaultHandler.Resolve(CreationContext context, Boolean instanceRequired)\r\n at Castle.MicroKernel.Handlers.AbstractHandler.Resolve(CreationContext context)\r\n at Castle.MicroKernel.Resolvers.DefaultDependencyResolver.ResolveFromKernelByType(CreationContext context, ComponentModel model, DependencyModel dependency)\r\n at Castle.MicroKernel.Resolvers.DefaultDependencyResolver.ResolveFromKernel(CreationContext context, ComponentModel model, DependencyModel dependency)\r\n at Castle.MicroKernel.Resolvers.DefaultDependencyResolver.ResolveCore(CreationContext context, ISubDependencyResolver contextHandlerResolver, ComponentModel model, DependencyModel dependency)\r\n at Castle.MicroKernel.Resolvers.DefaultDependencyResolver.Resolve(CreationContext context, ISubDependencyResolver contextHandlerResolver, ComponentModel model, DependencyModel dependency)\r\n at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.CreateConstructorArguments(ConstructorCandidate constructor, CreationContext context)\r\n at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.Instantiate(CreationContext context)\r\n at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.InternalCreate(CreationContext context)\r\n at Castle.MicroKernel.ComponentActivator.AbstractComponentActivator.Create(CreationContext context, Burden burden)\r\n at Castle.MicroKernel.Lifestyle.AbstractLifestyleManager.CreateInstance(CreationContext context, Boolean trackedExternally)\r\n at Castle.MicroKernel.Lifestyle.AbstractLifestyleManager.Resolve(CreationContext context, IReleasePolicy releasePolicy)\r\n at Castle.MicroKernel.Handlers.DefaultHandler.ResolveCore(CreationContext context, Boolean requiresDecommission, Boolean instanceRequired, Burden& burden)\r\n at Castle.MicroKernel.Handlers.DefaultHandler.Resolve(CreationContext context, Boolean instanceRequired)\r\n at Castle.MicroKernel.Handlers.AbstractHandler.Resolve(CreationContext context)\r\n at Castle.Core.InterceptorReference.Castle.MicroKernel.IReference<Castle.DynamicProxy.IInterceptor>.Resolve(IKernel kernel, CreationContext context)\r\n at Castle.Windsor.Proxy.AbstractProxyFactory.ObtainInterceptors(IKernel kernel, ComponentModel model, CreationContext context)\r\n at Castle.Windsor.Proxy.DefaultProxyFactory.Create(IKernel kernel, Object target, ComponentModel model, CreationContext context, Object[] constructorArguments)\r\n at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.CreateInstance(CreationContext context, ConstructorCandidate constructor, Object[] arguments)",
"innerException": {
"message": "An error has occurred.",
"exceptionMessage": "Exception has been thrown by the target of an invocation.",
"exceptionType": "System.Reflection.TargetInvocationException",
"stackTrace": " at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)\r\n at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)\r\n at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)\r\n at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)\r\n at System.Activator.CreateInstance(Type type, Object[] args)\r\n at Castle.DynamicProxy.ProxyGenerator.CreateClassProxyInstance(Type proxyType, List`1 proxyArguments, Type classToProxy, Object[] constructorArguments)\r\n at Castle.DynamicProxy.ProxyGenerator.CreateClassProxy(Type classToProxy, Type[] additionalInterfacesToProxy, ProxyGenerationOptions options, Object[] constructorArguments, IInterceptor[] interceptors)\r\n at Castle.Windsor.Proxy.DefaultProxyFactory.Create(IKernel kernel, Object target, ComponentModel model, CreationContext context, Object[] constructorArguments)\r\n at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.CreateInstance(CreationContext context, ConstructorCandidate constructor, Object[] arguments)",
"innerException": {
"message": "An error has occurred.",
"exceptionMessage": "Could not find default endpoint element that references contract 'BasicHttpBinding_ICrmUserService' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element.",
"exceptionType": "System.InvalidOperationException",
"stackTrace": " at System.ServiceModel.Description.ConfigLoader.LoadChannelBehaviors(ServiceEndpoint serviceEndpoint, String configurationName)\r\n at System.ServiceModel.ChannelFactory.ApplyConfiguration(String configurationName, Configuration configuration)\r\n at System.ServiceModel.ChannelFactory.ApplyConfiguration(String configurationName)\r\n at System.ServiceModel.ChannelFactory.InitializeEndpoint(String configurationName, EndpointAddress address)\r\n at System.ServiceModel.ChannelFactory`1..ctor(String endpointConfigurationName, EndpointAddress remoteAddress)\r\n at System.ServiceModel.ConfigurationEndpointTrait`1.CreateSimplexFactory()\r\n at System.ServiceModel.ConfigurationEndpointTrait`1.CreateChannelFactory()\r\n at System.ServiceModel.ClientBase`1.CreateChannelFactoryRef(EndpointTrait`1 endpointTrait)\r\n at System.ServiceModel.ClientBase`1.InitializeChannelFactoryRef()\r\n at System.ServiceModel.ClientBase`1..ctor()\r\n at MVC5AJ1Demo.CrmDemoAuthenticationService.CrmUserServiceClient..ctor() in C:\\Users\\FTS01\\Desktop\\Demo Projects\\MVC5AJ1Demo\\src\\MVC5AJ1Demo.Application\\Connected Services\\CrmDemoAuthenticationService\\Reference.cs:line 156\r\n at MVC5AJ1Demo.CRMAuthentication.CrmAuthenticationAppService..ctor() in C:\\Users\\FTS01\\Desktop\\Demo Projects\\MVC5AJ1Demo\\src\\MVC5AJ1Demo.Application\\CRMAuthentication\\CrmAuthenticationAppService.cs:line 15\r\n at Castle.Proxies.CrmAuthenticationAppServiceProxy..ctor(IInterceptor[] )"
}
}
}
}
So, what I need to know is how do I call WSDL service class method in my App Service?
<cite>hikalkan: </cite> Answered here: <a class="postlink" href="http://forum.aspnetboilerplate.com/viewtopic.php?f=3&t=784&p=2709#p2709">http://forum.aspnetboilerplate.com/view ... 2709#p2709</a>
@hikalkan this link is not working. Pls advice the correct link.
Thanks /tommy
<cite>hikalkan: </cite> Hi,
Check this: <a class="postlink" href="http://www.aspnetboilerplate.com/Pages/Documents/Background-Jobs-And-Workers#disabling-job-execution">http://www.aspnetboilerplate.com/Pages/ ... -execution</a> Disable job execution for web application.
Create a Windows service and just add Abp package since this is only needed package. But if you used Hangfire, you should also add hangfire module. Windows Services are similar to console apps, there is one sample: <a class="postlink" href="https://github.com/aspnetzero/aspnet-zero-samples/tree/master/PhoneBook/src/Acme.PhoneBook.ConsoleApp">https://github.com/aspnetzero/aspnet-ze ... ConsoleApp</a> Note: You should also add your application's modules like in this sample console app.
@hikalkan the github link can longer be found. Pls kindly where I could refer to as I am exploring how implement Window Services that enable external interfaces to existing aspnetzero application.
Thanks. /tommy
<cite>ismcagdas: </cite> Hi,
Actually 2FA is implemented in Token auth as well, see <a class="postlink" href="https://github.com/aspnetzero/aspnet-zero-core/blob/dev/aspnet-core/src/MyCompanyName.AbpZeroTemplate.Web.Core/Controllers/TokenAuthController.cs#L136">https://github.com/aspnetzero/aspnet-ze ... er.cs#L136</a>.
You can check angular app to see how it works. If a 2FA token is required, API returns RequiresTwoFactorVerification = true. Then, user need to pass TwoFactorVerificationCode (<a class="postlink" href="https://github.com/aspnetzero/aspnet-zero-core/blob/dev/aspnet-core/src/MyCompanyName.AbpZeroTemplate.Web.Core/Models/TokenAuth/AuthenticateModel.cs#L18">https://github.com/aspnetzero/aspnet-ze ... del.cs#L18</a>) to TokenAuthController's Authenticate action again.
@ismcagdas the link you provided on the implementation is on aspnetzero core template but for our case, we are using non-core template.
We ended up requiring to implement 2FA by leveraging on the libraries provided by Identity Framework. Taking the 2FA for the web login as reference and reimplement UserDeviceManager and MobileSignInManager under the WebApi project.
Thanks. /tommy
<cite>maliming: </cite> This may be some of the problems with the VS compiler, and I am not very clear about this.
Hi maliming, Ok. Thank you for helping me.
Thanks. /Tommy
<cite>tteoh: </cite> Hi maliming,
Just wonder to know why is this happening to me? Is it because of I have 2 version of VS running in my machine? I have VS 2015 Community and VS 2017 Community running on my machine.
Why the solution provided in the link is not working? How to: Enable and Disable Automatic Binding Redirection
Thanks. /Tommy
Hi maliming,
I'm still waiting answer of these questions.
Thanks. /Tommy
<cite>maliming: </cite> You can see detailed information in the VS output window: E.g:
3> Consider app.config remapping of assembly "System.Runtime.Serialization.Xml, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" from Version "4.0.10.0" [C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\Facades\System.Runtime.Serialization.Xml.dll] to Version "4.1.3.0" [C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Runtime.Serialization.Xml.dll] to solve conflict and get rid of warning. 3> Consider app.config remapping of assembly "System.Data.Common, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" from Version "0.0.0.0" [] to Version "4.2.0.0" [C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Data.Common.dll] to solve conflict and get rid of warning. 3> Consider app.config remapping of assembly "System.Net.Requests, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" from Version "4.0.10.0" [C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.6.1\Facades\System.Net.Requests.dll] to Version "4.0.11.0" [C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\System.Net.Requests.dll] to solve conflict and get rid of warning.
I manually follow the output information to add dependentAssembly under App.Config to eliminate this prompt. E.g:
<dependentAssembly> <assemblyIdentity name="System.Runtime.Serialization.Xml" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-4.1.3.00" newVersion="4.1.3.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Data.Common" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-4.2.0.00" newVersion="4.2.0.0" /> </dependentAssembly>
Maybe after adding all the items, you can completely eliminate the warning, of course, warning that these will not affect the function of the program.
Hi maliming,
This suggestion is able to eliminate the warning. Thank you very much.
Thanks. /Tommy
Hi maliming,
Just wonder to know why is this happening to me? Is it because of I have 2 version of VS running in my machine? I have VS 2015 Community and VS 2017 Community running on my machine.
Why the solution provided in the link is not working? How to: Enable and Disable Automatic Binding Redirection
Thanks. /Tommy
<cite>maliming: </cite> Ok, I will download it and check it out.
Hi maliming, Ok thank you very much.
Thanks. /Tommy
Hi maliming,
Same to other computer. I have copy the project to my Google drive: [https://drive.google.com/open?id=1wd9V6MjygFGkEn7tIQpii3BmuqvvlTKw])
Please help me see if it can to be fixed.
Thanks. /Tommy