小编Vik*_*ram的帖子

未正确配置基本HTTP绑定

我已经使用wsHTTPBinding配置了WCF服务,但即使这样我也得到了错误

Contract requires Session, but Binding 'BasicHttpBinding' doesn't support it or isn't configured properly to support it.
Run Code Online (Sandbox Code Playgroud)

这是服务合同定义

<ServiceContract(SessionMode:=SessionMode.Required)>
Public Interface IPrivateService
Run Code Online (Sandbox Code Playgroud)

这是服务实现定义

<ServiceBehavior(InstanceContextMode:=InstanceContextMode.PerSession)>
Public Class PrivateService
    Implements IPrivateService
Run Code Online (Sandbox Code Playgroud)

这是配置设置

<services>
    <service behaviorConfiguration="behaviorAction" name="Viking.Service.PrivateService">
            <endpoint address="RequiredService" binding="wsHttpBinding" bindingConfiguration="bindingAction" contract="Viking.Service.IPrivateService">
              <identity>
                <dns value="localhost"/>
              </identity>
            </endpoint>
            <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
          </service>
</services>
<bindings>
          <wsHttpBinding>
            <binding name="bindingAction" transactionFlow="false" sendTimeout="00:30:00" receiveTimeout="00:30:00">
              <reliableSession enabled="true"/>
            </binding>
          </wsHttpBinding>
</bindings>
Run Code Online (Sandbox Code Playgroud)

真正感谢任何关于这个问题的建议.

wcf wcf-4

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

使用jQuery进行脱机数据存储和访问

有没有人在jquery上编写离线数据存储和访问应用程序的经验.我的服务器端应用程序将是一个ASP.Net应用程序.基本上,我将提供我的网络应用程序的精简版本,以便用户可以在离线时访问某些数据,并在再次连接时同步数据.我听说过谷歌齿轮,但想听听使用它的人或者对这个主题有更多了解的人.

jquery offline-mode google-gears

4
推荐指数
1
解决办法
3393
查看次数

从指令更新范围变量

指令更新的范围变量不会反映在{{variable}}页面上的位置,但是当我这样做时它们会显示为更新console.log(scope).

<script>
    var demoApp = angular.module('demoApp', []);

    demoApp.controller('demoController', function demoController($scope) {
      $scope.myElementId ="abcd";
      $scope.updateVals = function() {
        $scope.myElementClass = "";
      };
    });

    demoApp.directive('demoSelect', function() {
      return {
        restrict: 'A',
        controller: 'demoController',
        link: function(scope, element, attrs, controller) {
          element.on("click", function(event) {
            event.stopImmediatePropagation();
            event.preventDefault();
            scope.ele = angular.element(event.target);
            angular.element(".selected").removeClass("selected");
            $(scope.ele).addClass("selected");
            var mm = $(scope.ele).get(0);
            scope.myElementId = $(scope.ele).attr("id");
            scope.myElementClass = $(scope.ele).attr("class");
            scope.myElementType = mm.tagName;
          });
        }
      };
    });
  </script>
Run Code Online (Sandbox Code Playgroud)

这是的plunker.我错过了什么?

angularjs angularjs-directive angularjs-scope

4
推荐指数
1
解决办法
5329
查看次数

如何使用LINQ在对象列表上执行函数

我想使用LINQ在对象List中的所有对象上执行一个函数.我知道我之前看过类似的东西,但在几次失败的搜索尝试之后,我发布了这个问题

linq foreach

3
推荐指数
1
解决办法
6983
查看次数

使用safari,chrome创建一个cookie失败,即使用FF

我们使用以下代码来创建安全cookie.在Staging环境中一切正常,但在生产环境中,以下代码无法在Safari,Chrome或IE中创建cookie,但它确实在Firefox中成功创建了cookie.你们认为我遗失或错在这里的任何事情?

public static void SetAuthenticationCookie(CustomIdentity identity)
        {
            ConfigSettings configSettings = ConfigHelper.GetConfigSettings();

            string cookieName = configSettings.CookieName;
            if (cookieName == null || cookieName.Trim() == String.Empty)
            {
                throw new Exception("CookieName entry not found in Web.config");
            }

            string cookieExpr = configSettings.CookieExpiration.ToString();

            string encryptedUserDetails = Encrypt(identity);

            HttpCookie userCookie = new HttpCookie(cookieName.ToUpper());
            if (cookieExpr != null && cookieExpr.Trim() != String.Empty)
            {
                userCookie.Expires = DateTime.Now.AddMinutes(int.Parse(cookieExpr));
            }
            userCookie.Values["UserDetails"] = encryptedUserDetails;
            userCookie.Values["Culture"] = configSettings.Customer.Culture;

            MyContext.Current.Response.Cookies.Add(userCookie);
        }
Run Code Online (Sandbox Code Playgroud)

c# cookies cross-browser

3
推荐指数
1
解决办法
2477
查看次数

引导新鲜计算机毕业生成为程序员

新毕业生在第一次编程工作开始时应该接受哪些关键的实践概念,以及您希望他/她多久能够提高工作效率并实际提供您期望的代码?

language-agnostic

2
推荐指数
3
解决办法
542
查看次数

使用Angular Directive在iFrame上拖放

我需要一些控件才能在iFrame中使用Drag&Drop.我需要iframe中的功能的原因是因为我们正在构建的CMS以及"编辑页面"中的任何"绝对"css更改也将影响主站点.

我已经写了一个角度指令,并为此构建了一个小型原型,只要它在同一页面上它就完美无缺,但是当我试图在iframe中做同样的事情时,它只是不起作用.甚至从iFrame页面注册droppbale也不会显示在控制台中(当尝试登录指令时).

它是1个寻呼机代码,可在此查看 - http://78.110.163.229/angDnd/outer.html

任何指导/建议都会非常有帮助.

iframe jquery-ui jquery-ui-draggable jquery-ui-droppable angularjs

2
推荐指数
1
解决办法
2809
查看次数

Luis集成抛出错误

我已经开始将Luis集成到我的BOT中,LUIS查询在浏览器中运行良好,但似乎在通过代码调用时,从LUIS GetResult返回的内容会抛出错误.

LUIS查询在这里

对话框的源代码:

 [LuisModel("2d3e39d8-632a-4e00-bf2f-d98ea4b2ed79&", "subscription Key")]
    [Serializable]
    public class SupportDialog : LuisDialog<object>
    {

        [LuisIntent("")]
        public async Task None(IDialogContext context, LuisResult result)
        {
            await context.PostAsync("Sorry, I dont understand what you need");
            context.Wait(MessageReceived);
        }


        [LuisIntent("OrderStatus")]
        public async Task OrderStatus(IDialogContext context, LuisResult result)
        {
            var returnMsg = "You wanted to check the order status";
            var orderStatus = "Dispatched";
            var deliveryDate = DateTime.Now.AddDays(3);

            var entities = new List<EntityRecommendation>(result.Entities);
            if(entities.Any((entity)=> entity.Type == "Order"))
            {
                var orderEntity = entities.Where((entity) => entity.Type == "Order").FirstOrDefault();
                var …
Run Code Online (Sandbox Code Playgroud)

c# azure botframework azure-language-understanding azure-cognitive-services

2
推荐指数
1
解决办法
1731
查看次数

将字符串转换为JSON对象会引发意外的令牌

我试图将带有转义字符的字符串转换为JSON,但是会收到错误

  var str = '[{"name":"content","readonly":false,"value":"<div class=\"blueheading\"><h2>Free Gifts for Him</h2><h3><a href=\"http://abcd.com/free-gifts-with-purchase-for-him.aspx\">View all for Him</a></h3></div>"},{"name":"cached","readonly":true,"value":true}]';
            var myObj = JSON.parse(str);
Run Code Online (Sandbox Code Playgroud)

javascript json

0
推荐指数
1
解决办法
275
查看次数