Skip to content

FAQ and .asmx support #24

Description

@lscorcia

The FAQs mention that asmx support should work - I'd be happy to discover I'm wrong, but from my tests on this regard, it seems that they do not.

A valid workaround is mentioned at https://www.milestonetg.com/blog/development/2018/02/17/adding-new-microsoft-extensions-to-legacy-wcf-and-asmx-web-services.html , i.e. use constructor chaining with the service locator:

    [WebService(Namespace = "http://com.github/ws/myheadspins/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    public class MyHeadSpinsWsAdapter : System.Web.Services.WebService
    {
        private ILogger log { get; }
        private MyBusinessService srvBusiness { get; }

        public MyHeadSpinsWsAdapter(): this(
            (ILoggerFactory)HttpRuntime.WebObjectActivator?.GetService(typeof(ILoggerFactory)),
            (MyBusinessService)HttpRuntime.WebObjectActivator?.GetService(typeof(MyBusinessService)))
        {

        }

        public MyHeadSpinsWsAdapter(ILoggerFactory loggerFactory, MyBusinessService srvBusiness)
        {
            log = loggerFactory.CreateLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
            this.srvBusiness = srvBusiness;
        }
...

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions