小编use*_*166的帖子

WCF应用程序启动事件

首次启动WCF服务时获得通知的最佳方法是什么?

是否有类似于ASP.NET应用程序的Global.asax中的Application_Start方法?

wcf

55
推荐指数
5
解决办法
5万
查看次数

测试是否存在远程MessageQueue(使用C#)

如何判断远程消息队列是否存在?该文档指出"存在"方法不适用于远程计算机.

以下是无效的(我知道队列路径是准确的,因为我能够将消息发送到队列):

if (!MessageQueue.Exists(@"FormatName:Direct=TCP:192.168.2.58\Private$\MyQueue"))
  throw new InvalidOperationException("Queue does not exist");

问题是将消息发送到其后没有侦听队列的网络地址不会导致异常.为无效的队列地址抛出异常对我们的应用程序至关重要.

c# msmq

7
推荐指数
1
解决办法
1万
查看次数

配置WCF表单身份验证

在我的服务实施中,我有:

[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]

在我的.config文件中,我有:

<serviceHostingEnvironment aspNetCompatibilityEnabled="true" />

和:

  <system.web.extensions>
    <scripting>
      <webServices>
        <authenticationService enabled="true" requireSSL = "false"/>
      </webServices>
    </scripting>
  </system.web.extensions>

和:

<authentication mode="Forms" />

在我的服务的"登录"方法中,我有:

FormsAuthentication.SetAuthCookie(request.UserName, false);

但是,当我检查:

HttpContext.Current.User.Identity.Name

这是一个空字符串.我错过了什么?

wcf forms-authentication

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

标签 统计

wcf ×2

c# ×1

forms-authentication ×1

msmq ×1