0

I have a ASP.NET WebApp that contains some ASMX webservices. We recently migrated to load balanced Windows 2008 servers from a Windows 2003 server. The new servers sit behind some F5 appliance for the load balancing (that's all I know about it!).

We can reach the built in ASP.NET POST test (example: http://webapp.company.com/webservices/Person.asmx?op=GetPerson) but invoking it from that test page fails (page not available). A new tab in the browser opens with the same url, but with a port number appended on the end: http://webapp.company.com:50831/webservices/Person.asmx?op=GetPerson. When I put that URL(with port) into my browser, it fails as well. Heck, http://webapp.company.com:50831 isn't reachable at all.

We didn't get that on our previous server. I setup my own personal webserver on a personal Windows 2012 server and tested the same code on there and it worked. So I'm thinking it has to do with the load balancing.

Unfortunately, I have no control over the web servers our company offers for hosting internal applications. I don't get to touch the IIS either. All I get is a file path to publish my files to. The hosting organization is telling me my ASP.NET WebApp code is appending the port number, but I don't think that's right. It only occurs on those load balanced servers!

Has anyone else ran into this before when invoking ASMX or WCF that's hosted behind a F5 appliance?

StoneJedi
  • 575
  • 1
  • 8
  • 19

1 Answers1

0

The IT group that maintains those servers didn't have any answers for us, but we were able to verify those odd ports were in fact being assigned by the F5 appliances. We ended up using a port rewriter as a workaround until the group that maintains the web servers can alter the configuration. The code we used is below which is taken straight from the URL below where they were discussing the same problem behind the same F5 appliance (BigIP).

http://www.justskins.com/forums/port-mapping-a-web-51075.html

  public class WSDLAddress : SoapExtensionReflector
  {
    bool bFirstTime = true;
    public override void ReflectMethod()
    {
      if (!bFirstTime) return;
      bFirstTime = false;

      SoapAddressBinding sabAddress = ReflectionContext.Port.Extensions.Find(typeof(SoapAddressBinding)) as SoapAddressBinding;

      string sPort = ConfigurationSettings.AppSettings["myPort"];

      UriBuilder uriLocation = new UriBuilder(sabAddress.Location);
      uriLocation.Port = Int32.Parse(sPort);

      sabAddress.Location = uriLocation.Uri.AbsoluteUri;
    }
  }
StoneJedi
  • 575
  • 1
  • 8
  • 19