使用带有webHttpBindingType的WCF自定义传输 [英] Using the WCF-Custom Transport with webHttpBindingType

查看:86
本文介绍了使用带有webHttpBindingType的WCF自定义传输的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在发送端口上使用WCF-Custom Transport类型,使用"webHttpBinding"的绑定类型。  这是因为我需要控制maxBufferSize和transferMode设置,这在标准的
WCF-WebHttp传输类型上似乎不可能,但是在WCF-Custom Transport上。

I want to use the WCF-Custom Transport type on a send port, using the Binding Type of "webHttpBinding".  This is because I need to control the maxBufferSize and transferMode settings, and this doesn't appear to be possible on the standard WCF-WebHttp transport type, but is on the WCF-Custom Transport.

在标准的WCF-WebHttp传输类型上有一个"Http方法和URL映射"。领域。  但是,在使用WCF-Custom传输时,这不可用。

On the standard WCF-WebHttp transport type there is a "Http Method and Url Mapping" field.  However this isn't available when using the WCF-Custom transport.

如何设置http方法和网址映射。  

How do I go about setting the http method and url mappings.  

谢谢

推荐答案

Hello Bill,



在WCF-Custom端口的配置属性中,设置如下操作映射:

Hello Bill,

In the configuration properties for the WCF-Custom port, set up your operation mapping like so:

<BtsHttpUrlMapping>
  <Operation Name='OpName' Method='POST' Url='/OpName?param1={param1}&amp;id={id}' />
</BtsHttpUrlMapping>




如有必要,请更改方法属性。名称应与您接收或发送端口上的操作名称匹配(就像BizTalk的任何其他WCF操作映射一样)。然后,您可以单击变量映射...部分中的编辑按钮。

Change the method attribute if necessary. Name should match the operation name on you receive or send port (just like any other WCF action mapping for BizTalk). Then, you can click on the edit button in the Variable Mapping... section.






/*Creating a new output message */
   output = input;                                       
   output(*)= input(*); 

/*this part of the code defines how to set the variable mapping. The APC variable will contain the promoted property value. */
   output(WCF.VariablePropertyMapping)= @"<?xml version=’1.0′ encoding=’utf-16′?>
   <BtsVariablePropertyMapping xmlns:xsi=’http://www.w3.org/2001/XMLSchema-instance’ xmlns:xsd=’http://www.w3.org/2001/XMLSchema’>
   <Variable Name=’APC’ PropertyName=’AirportCode’ PropertyNamespace=’https://TestDynamicPort.PropertySchema’ />
   </BtsVariablePropertyMapping>";

/*Next we define the Outbound Message Property as in the Messages Tab in the send port */
   output(WCF.SuppressMessageBodyForHttpVerbs)="GET"; 

/*Define transport properties */
   output(WCF.SecurityMode)="transport"; 

/*Here we define the Action as we define in the General tab. Here my port is names as Port_2*/
   output(WCF.HttpMethodAndUrl)=@"<BtsHttpUrlMapping> <Operation Method=’GET’ Url=’status/{APC}?format=xml’ /></BtsHttpUrlMapping>"; 

   Port_2(Microsoft.XLANGs.BaseTypes.Address)=System.String.Format("http://services.faa.gov/airport/");
   Port_2(Microsoft.XLANGs.BaseTypes.TransportType)="WCF-WebHttp"; 




这篇关于使用带有webHttpBindingType的WCF自定义传输的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆