How to dynamically get the IP Address of the remote Server

Home Page Forums BizTalk 2004 – BizTalk 2010 How to dynamically get the IP Address of the remote Server How to dynamically get the IP Address of the remote Server

#14692

The HTTP adapter does put the originating IP address into the message context. Probably because this info may not be relevant if you are behind a reverse proxy or hardware load balancer as Iggi has pointed out.

One possibility is to use a reverse proxy that will set the [b:33c12af0b3]x-forwarded-for[/b:33c12af0b3] http header.

The HTTP headers are available in the HTTP.InboundHttpHeaders property of the message context. Although they arrive a string so you will have to parse out the header value you want.

Create a helper class with a static method that will parse and return the [b:33c12af0b3]x-forwarded-for[/b:33c12af0b3] header and assign this value to a distinguished field in you message in a message assignment shape of an orchestration.

[code:1:33c12af0b3]newmessage.IPAddress = Mynamespace.MyHelper.GetForwardedForHeader(inboundmessage(HTTP.InboundHttpHeaders));[/code:1:33c12af0b3]