小编ale*_*xbf的帖子

将大型XML从Silverlight发送到WCF

我想从Silverlight向WCF SVC服务发送一个大的XML字符串.

看起来大约50k以下的任何东西都被正确发送但是如果我尝试发送超过该限制的东西,我的请求到达服务器(调用BeginRequest)但从未到达我的SVC.我得到了经典的"NotFound"异常.

关于如何提高这个限制的任何想法?

如果我不能提高它?我还有什么其他选择?

这是我的绑定配置

<bindings>
        <customBinding>
            <binding name="customBinding0" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" maxBufferPoolSize="2147483647">
                <binaryMessageEncoding>
        <readerQuotas
            maxArrayLength="2147483647"
            maxBytesPerRead="2147483647"
            maxDepth="2147483647"
            maxNameTableCharCount="2147483647"
            maxStringContentLength="2147483647" />

      </binaryMessageEncoding>
                <httpTransport/>
            </binding>
            <binding name="customBindingSecure" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" maxBufferPoolSize="2147483647">
                <binaryMessageEncoding>
        <readerQuotas
            maxArrayLength="2147483647"
            maxBytesPerRead="2147483647"
            maxDepth="2147483647"
            maxNameTableCharCount="2147483647"
            maxStringContentLength="2147483647" />
                </binaryMessageEncoding>
                <httpsTransport/>
            </binding>
        </customBinding>
    </bindings>
Run Code Online (Sandbox Code Playgroud)

编辑:更多细节:如果我打破Global.asax Endrequest,我在响应"Bad Request 400"中看到

编辑:再次提供更多详细信息:我激活了跟踪,我可以看到以下错误:已超出传入邮件的最大邮件大小配额(65536).要增加配额,请在相应的绑定元素上使用MaxReceivedMessageSize属性.

但是,我的maxReceivedMessageProperty已设置为2147483647.

.net silverlight wcf

5
推荐指数
1
解决办法
9350
查看次数

使用 Azure AD 保护的 Azure Functions - 从本机应用程序调用时获取 HTTP 401

我的目标是使用 Azure AD 保护我的 Azure Functions 并从 WPF 应用程序调用它们。

我有一个具有以下定义的 Azure 函数:

public IActionResult Run(
        [HttpTrigger(AuthorizationLevel.Anonymous, "get", Route = null)]
        HttpRequest req,
        ILogger log,
        ExecutionContext context,
        ClaimsPrincipal claimsPrincipal)
Run Code Online (Sandbox Code Playgroud)

我注册了一个 Azure AD 应用程序并配置了本机应用程序身份验证的设置:

Azure AD 应用程序注册设置

我在“公开 API”blad 中配置了我的应用程序 公开 API

我还添加了一个API权限

API权限

我将我的应用程序关联到身份验证/授权边栏选项卡中的 Azure Functions 应用程序中。

Azure Functions 授权设置

我在 WPF 应用程序中从 Azure AD 获取令牌(使用 Microsoft.Identity.Client 库)

            string applicationID = "***"; // My AppID Guid
            PublicClientApp = PublicClientApplicationBuilder.Create(applicationID)
                .WithRedirectUri("https://login.microsoftonline.com/common/oauth2/nativeclient")
                .Build();

            var listScopes = new List<string>
            {
                //"user.read" - Removed based on @tony-yu recommendation
                $"api://{applicationID}/MyScope"
            };

            var authResult = await …
Run Code Online (Sandbox Code Playgroud)

authentication azure azure-functions

5
推荐指数
1
解决办法
973
查看次数

标签 统计

.net ×1

authentication ×1

azure ×1

azure-functions ×1

silverlight ×1

wcf ×1