【问题标题】:Servicestack Authentication namespace using SOAP使用 SOAP 的 Servicestack 身份验证命名空间
【发布时间】:2015-05-08 11:09:28
【问题描述】:

我在使用 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/'

这是我的 apphost 设置:

        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 期望错误的命名空间,谁能帮助我了解如何将预期的命名空间设置为正确的命名空间?

【问题讨论】:

    标签: .net api soap servicestack


    【解决方案1】:

    您在 wsdl 级别设置自定义 ns,但类型本身仍在使用自己的 ns,我假设它是默认的“http://schemas.servicestack.net/types”。不确定如何更改那些内置的 ns,甚至不确定这是否可能,但您可以使用自定义类型创建自己的身份验证提供程序,以便set your custom ns

    【讨论】:

    • 谢谢老兄。作为临时修复,我只是将所有内容设置回默认值:“schemas.servicestack.net/types”。我们将创建自己的身份验证提供程序。
    猜你喜欢
    • 2020-04-07
    • 2017-11-17
    • 2021-03-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-07-25
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多