• Creating CustomBinding for WCFBasicHTTP for SSL and BasicAuthentication in BizTalk 转载自:http://geekswithblogs.net/mipsen


    Two posts on one day? Is he on his holidays? Yes!

    We had a lot of trouble with this error:

    ...Error Description: System.ServiceModel.CommunicationException: An error (The request was aborted: The request was canceled.) occurred while transmitting data over the HTTP channel....

    You find a few posts about it in the www but the answers are somewhat conflicting and not very nice. No, I will not tell you the answer in this post, because we still do not really have it, but I want to show you how to perform one step that might lead you closer to it.

    The error occurs under high load only in one of our environments. Of course the production environment.. Thank you, Mr. Murphy...

    We are using a rather complicated Orchestration structure and make a lot of WCF-calls from BizTalk to WCF-Services. As a binding we use WCFBasicHttpBinding with SSL and Basic Authentication. Most of the posts in the www point to setting the KeepAlive-flag to false. MS-Suport asked us to it, too. But this is not a property present in the usual WCFBasicHttpBinding. So we had to switch to customBinding in WCF-Custom Transport. I was not able to find posts about how to do that and had to try out a few things until I was successful. To save you some time, here is what worked:

    1. Import the custom-binding that was created when generating the service-reference (switching completely from DynamicPort to a static Port, but that is another story...)
    2. Configuring the Transport I switched the BindingType in Binding to "customBinding"
    3. Remove the "httpTransport" extension and add a "httpsTransport" extension, as you want to use SSL. You have to remove "httpTransport" first because otherwise "httpsTransport" will not show up in the extensions.
    4. Move "httpsTransport" to the last place of the extensions, otherwise BizTalk/WCF does not like it...
    5. In "httpsTransport" set "authenticationScheme" to "Basic"
    6. Here you can set "keepAliveEnabled" to "false" and other important properties like "maxReceivedMessageSize", too!
    7. In the "textMessageEncoding" node you have to set "messageVersion" from "Default" to "Soap11WSAddressingAugust2004" as you want to use basicHttp under the hood. Under "textMessageEncoding" you will find the "ReaderQuotas", too.
    8. In the "Credentials"-tab set username and password for basic authentication, or use SSO

    When trying for the first time with the newly created SendPort I got an error that communication with the service could not be established. The binding was changed to custom-binding so that was not too surprising...

    To make things a little easier I exported a web.config in the "Import/Export"-tab in the WCF-Custom Transport Properties and adjusted the web.config of the service I called based on the exported web.config. Here we were fortunate enough that the Service is under our control and it is a WCF-service...

    Now it works all fine. If it really helps us with error we will find out soon. To be continued...

    *****

    Update: All the work did not help with the error at all. It turned out it was the service on the other side producing the error. But I don't know what has been changed to get it working.

    posted on Friday, June 25, 2010 10:45 AM
    Filed Under [ BizTalk WCF ]
  • 相关阅读:
    记一次Jquery学习引发的学习思考
    时间管理记录11.26
    介绍几个可视化数据结构和算法的网站
    不靠电脑打字真的能弄懂代码吗?
    记学习品优购网站案例中遇到的问题
    仿小米logo案例
    HTML学习案例-仿慕课网网页制作(二)
    一个“MacBook”新手的Python“笨办法”自学之旅 #第十章预告:逻辑关系、布尔表达式、if/elif/else语句、循环for语句、while语句、列表及其相关
    一个“MacBook”新手的Python“笨办法”自学之旅 #第八章:参数、解包和变量、提示和传递、读取文件、读写文件
    一个“MacBook”新手的Python“笨办法”自学之旅 #第六章:常用的简易Python命令、符号、代码、格式化字符串
  • 原文地址:https://www.cnblogs.com/xcwytu/p/2744215.html
Copyright © 2020-2023  润新知