使用 SOAP 的 Servicestack 身份验证命名空间

Servicestack Authentication namespace using SOAP

我在使用 SOAPUI 向我的 ServiceStack API 发送身份验证请求时遇到此错误。

Expecting element 'Authenticate' from namespace 'http://schemas.servicestack.net/types'.. Encountered 'Element'  with name 'Authenticate', namespace 'http://correctnamespace.com/schemas/2015/05/MyAPI/'

这是我的应用主机设置:

        SetConfig(new HostConfig
        {
            HandlerFactoryPath = "api",
            DefaultContentType = "application/json",
            WsdlServiceNamespace = "http://correctnamespace.com/schemas/2015/05/MyAPI/",
            DebugMode = false,
            UseHttpsLinks = Core.Config.UserRemoteConfig()
        });

        Plugins.Add(new AuthFeature(
            () => new AuthUserSession(),
            new IAuthProvider[]
            {
                new CustomAuthProvider()
            })
        {
            IncludeAssignRoleServices = false,
            IncludeAuthMetadataProvider = false,
            HtmlRedirect = null
        });

我不明白为什么 servicestack 需要错误的命名空间,谁能帮助我理解如何将预期的命名空间设置为正确的命名空间?

您在 wsdl 级别设置了自定义 ns,但类型本身仍在使用自己的 ns,我认为这是默认的“http://schemas.servicestack.net/types". Not sure how you could change those built-in ns, not even sure if that's possible, but you might create your own auth provider with your custom types so you can set your custom ns