wcf- basichttprelay deep dive - microsoft adapter deep dive contents wcf-basichttprelay deep dive 0...

Download WCF- BasicHTTPRelay Deep Dive - Microsoft  Adapter Deep Dive Contents WCF-BasicHTTPRelay Deep Dive 0 About the Author

Post on 17-Mar-2018

217 views

Category:

Documents

4 download

Embed Size (px)

TRANSCRIPT

  • WCF-

    BasicHTTPRelay

    Deep Dive

    Publication of

    http://www.biztalk360.com

    http://www.biztalk360.com/

  • About the Author Writen By Steef-Jan Wiggers [Microsoft Integration MVP]

    Steef-Jan is an information architect working for a consultancy firm in the Netherlands (Inter Access). He has almost 15 years experience as a technical lead developer, application architect and consultant, specializing in custom applications, enterprise application integration (BizTalk), Web services and Windows Azure. Steef-Jan is very active in the BizTalk community as a blogger, Wiki

    author/editor, forums, writer and public speaker in the Netherlands and Europe. He has been a BizTalk MVP for 4 years.

  • WCF-BasicHttpRelay Adapter Deep Dive

    Contents WCF-BasicHTTPRelay Deep Dive.................................................................................................................... 0

    About the Author ........................................................................................................................................... 1

    BizTalk Server 2013: WCF-BasicHttpRelay Adapter .......................................................................................................... 3

    Purpose of this document................................................................................................................................................. 4

    Possible solution architecture using WCF-BasicHttpRelay Adapter in BizTalk Server 2013 ............................................. 5

    WCF-BasicHttpRelay adapter characteristics.................................................................................................................... 7

    Configuring the WCF-BasicHttpRelay adapter .................................................................................................................. 8

    A basic scenario with the new BizTalk WCF-BasicHttpRelay .......................................................................................... 13

    How it works ................................................................................................................................................................... 14

    Wrap-up .......................................................................................................................................................................... 21

    Acknowledgements ........................................................................................................................................................ 22

  • BizTalk Server 2013: WCF-BasicHttpRelay Adapter BizTalk Server 2013 offers a few new adapters. Three of them enable connectivity with the Windows Azure Service Bus.

    These adapters are the WCF-BasicHttpRelay, WCF-NetTcpRelay, and SB-Messaging. The first two leverage the ability to

    use the Service Bus Relay. The relay service is one of the entities within the Windows Azure Service Bus. Benefits of using

    the relay service are that:

    you can share data between an on premise application, Line-of-Business system or databases with a service

    hosted elsewhere (in the cloud or other enterprise)

    you have a secure connection between both sender and receiver of data with simplified networking (less dealing

    with firewalls, dynamic IP addresses or Network Area Translation (NAT))

    you can easily set up a listener in Windows Azure Service Bus through BizTalk Server 2013 or .NET using WCF-

    BasicHttpRelay or WCF-NetTcpRelay.

  • WCF-BasicHttpRelay Adapter Deep Dive

    Purpose of this document This article will discuss the WCF-BasicHttpRelay adapter, its characteristics, how to configure it, and how to use it within

    a basic hybrid scenario. You will learn how to setup an endpoint in BizTalk Server without using the BizTalk Service

    Publishing Wizard. This is article will strictly confine to BizTalk Server Administration console to configure a receive port

    with a location configured with WCF-BasicHttpRelay adapter. Why this can be useful and what happens in the

    background when a message is sent to configured endpoint.

  • Possible solution architecture using WCF-BasicHttpRelay Adapter in

    BizTalk Server 2013 Below you will find a possible solution architecture, where one enterprise (X) will collect data from another enterprise

    (Y).

    BizTalk Server

    Receive Port

    BasicHttpRelay Binding

    Relay Service

    Register Endpoint

    Database View

    Connect to Service

    Bus Namespace

    Soap Envelope

    Header: RelayAccessToken

    Body: request payload

    Soap Envelope

    Body: request payload

    Enterprise X

    Enterprise Y

    Issuer Name

    Issuer Secret

    Scope

    RelayAccessToken

    Access Control ServiceService Bus

    HTTPS/SOAP

    Windows Azure

    1

    Token issuing

    endpoint

    2

    3

    4

    5

    6

    RelayAccessToken

    Issuer Name

    Issuer Secret

    Scope

    Figure 1. Sample architecture with a relay between two enterprises.

    Connection is opened to Access Control Service (ACS) and then authentication credentials using the OAuth WRAP

    Protocol. BizTalk Server sends a request to ACS using a HTTPS form POST. ACS issues and returns a security token (1).

    Within the token permissions are included like listen.

    The same mechanism applies for the client that wants to send messages to the relay endpoint (2). Again ACS issues and

    returns a security token. Within the token permissions are included like send.

    The client extracts the RelayAccessToken from the security token issued by ACS and uses that for the header in the soap

    envelope of message it be sending. The body of the message will contain the payload, which can be a query for a database

    view (3).

  • WCF-BasicHttpRelay Adapter Deep Dive

    The Service Bus Relay Service validates and remove the security token from the message and will then forward it to the

    registered listener(4); the address configured in the BizTalk receive location.

    BizTalk will process the message by making a call to the database view based on the payload and will return the result to

    relay service (5).

    The Service Bus Relay service will forward the response back to the client (6).

    The underlying technology behind the described architecture will be discussed in more detail in this article.

  • WCF-BasicHttpRelay adapter characteristics The WCF-BasicHttpRelay adapter can be used with BizTalk to send and receive messages from the Service Bus relay

    endpoints using the BasicHttpRelayBinding. This is a binding that BizTalk can use to configure endpoints, which can

    communicate with ASMX-based Web services and other services that conform to the WS-I Basic Profile 1.1.

    The BasicHttpRelayBinding is derived from the standard BasicHttpBinding, part of the System.ServiceModel

    namespace. The key difference between BasicHttpBinding and its cloud related relative BasicHttpRelayBinding is that

    with the latter you can create an endpoint which can be reachable from outside your organization, by utilizing the Azure

    Service Bus, in a secure way. This endpoint is, if required, a publicly discoverable HTTP listener endpoint listening on the

    Windows Azure Service Bus. The BasicHttpBinding listens through the standard HTTP.sys listener on the local Windows

    computer.

    Note: Technically you can expose a BasicHttpBinding endpoint and expose it in a secure way (using SSL, Certs, Firewalls

    etcetera). However with the BasicHttpRelayBinding the steps required to provide an externally accessible endpoint are

    simplified.

    http://msdn.microsoft.com/en-us/library/microsoft.servicebus.basichttprelaybinding.aspxhttp://www.ws-i.org/profiles/basicprofile-1.1-2004-08-24.htmlhttp://msdn.microsoft.com/en-us/library/system.servicemodel.basichttpbinding.aspxhttp://msdn.microsoft.com/en-us/library/ms229710.aspx

  • WCF-BasicHttpRelay Adapter Deep Dive

    Configuring the WCF-BasicHttpRelay adapter With BizTalk Server 2013 you can easily register an endpoint in the Windows Azure Service Bus. You can create a receive

    port and within that port you can create one or more receive locations. The receive location can be configured choosing

    the WCF-BasicHttpRelay. You configure the adapter through a dialog WCF-BasicHttpRelay Transport Properties that has

    four tabs.

    The first tab is named General (see Figure 1). In this tab you can specify the endpoint address that will be registered in

    the Windows Azure Service Bus. When specifying the address the "http" or "https" URI scheme can be used depending

    on the means of security that will be applied.

    Figure 2: Specifying the Endpoint address.

    The next tab of the WCF-BasicHttpRelay Transport Properties is the Binding tab. In this tab you can specify the time-out

    and encoding-related properties. As seen in the screenshot below (Figure 2), depending on your requirements, you can

    adjust the defaults and specify different values.

  • Figure 3. Specifying the Binding properties.

    The third tab of the WCF-BasicHttpRelay Transport Properties is the Security tab. Here you can specify the security

    mode. In case you choose Transport than the created channel will be SSL-protected. The endpoint URI scheme in the

    address of the endpoint will be https. When setting the mode to None than the scheme will be http.

    Note: Setting it to none could possibility expose a vulnerability.

    The other t