您的位置:首页 > 理论基础 > 计算机网络

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

2012-10-29 09:19 746 查看
Creating CustomBinding for WCFBasicHTTP for SSL and BasicAuthentication in BizTalk

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:

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...)

Configuring the Transport I switched the BindingType in Binding to "customBinding"

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.

Move "httpsTransport" to the last place of the extensions, otherwise BizTalk/WCF does not like it...

In "httpsTransport" set "authenticationScheme" to "Basic"

Here you can set "keepAliveEnabled" to "false" and other important properties like "maxReceivedMessageSize", too!

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.

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

]
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐