none
Using the WCF-Custom Transport with webHttpBindingType RRS feed

  • Question

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

    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.

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

    Thanks

    Friday, October 28, 2016 10:45 AM

All replies

  • 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>


    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.


    variable mapping sample

    You can also achieve this using Dynamic ports.

    Refer: https://blogs.msdn.microsoft.com/biztalknotes/2014/09/24/how-to-call-restfull-service-using-dynamic-ports-with-variable-mapping-in-wcf-webhttp-adapter/

    /*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”; 


    Rachit Sikroria (Microsoft Azure MVP)

    Friday, October 28, 2016 10:53 AM
    Moderator
  • Thanks for your quick response Rachit.

    I have looked at the WCF-Custom port and there is nowhere to put the BtsHttpUrlMapping information.

    There is a SOAP Action header field, however it this field does not accept BtsHttpUrlMapping information, only BtsActionMapping.

    You can put BtsHttpUrlMapping information on a send port when it is of type "WCF-WebHttp", but I can't see anywhere to put it on "WCF-Custom".

    Thanks

    Friday, October 28, 2016 11:30 AM
  • Well....why do you need to control maxBufferSize and transferMode?

    Friday, October 28, 2016 11:45 AM
    Moderator
  • Azure storage only allows files of up to 64mb to be written in a single put operation.  After that size the file must be chunked into blocks of no more than 4mb and then committed when all the blocks have been uploaded.  I was hoping that using the buffer might achieve this.

    But anyway my original question relates to why it is not possible to utilise BtsHttpUrlMapping settings on a wcf-custom transport type with webHttpBinding but perhaps only Microsoft may be able to answer that...

    Friday, October 28, 2016 2:29 PM