reverse proxy wcf endpoint hell

reverse proxy wcf endpoint hell

Old forum URL:

uwefms posted on Thursday, October 23, 2014

Hi everybody,

  for quite some days I am chewing on how to call a wcf service for a Silverlight app via apache reverse proxy correctly. The setting is as follows:

Apache reverse proxy called via https:

https://DmzServerURL/SL_App_01 is routed to

Everything is working fine (Silverlight app shows up) up to the moment I need data from the SQL server. Depending on how I configure the endpoint I get either no errors and nothing is happening up to "No server found" etc.

I can call the svc by:


and can see the correct svc URL using my internal server in the svcutil.exe call. I think I am missing some settings in web.config to use the internal svc adress.

After 3 days of reading the fog becomes thicker instead of getting a clue what to do.

Here are my Application_Startup and web.config:

The actual setting is in index.html - so I can change the endpoind without recompiling.

        private void Application_Startup(object senderStartupEventArgs e)
			string cDataPortalUrlString   = "";
			string cBasicHttpSecurityMode = "none";
			if (e.InitParams.ContainsKey("prodUrl")) 
				cDataPortalUrlString = e.InitParams["prodUrl"];
			if (e.InitParams.ContainsKey("BasicHttpSecurityMode")) 
				cBasicHttpSecurityMode = e.InitParams["BasicHttpSecurityMode"];							
			Csla.ApplicationContext.DataPortalUrlString = cDataPortalUrlString;			
			var binding = new BasicHttpBinding();
			binding.MaxBufferSize = int.MaxValue
                        // some more binding properties
			if (cBasicHttpSecurityMode.ToLower() == "none") 
				binding.Security.Mode = BasicHttpSecurityMode.None ;
				binding.Security.Mode = BasicHttpSecurityMode.Transport;
			Csla.DataPortalClient.WcfProxy.DefaultBinding = binding;
            this.RootVisual = new MainPage();
the crucial line in index.html is:
<param name="initParams" value="prodUrl=https://DmzServerURL/Sl_App_01/WcfPortal.svc, BasicHttpSecurityMode=None" />			

And this is my web.config:

<?xml version="1.0" encoding="utf-8"?>
		connectionString="Data Source=localhost;Initial Catalog=DB_Name;Integrated Security= false;User ID=UserID;Password=*****" 
		providerName="System.Data.SqlClient" />
	<!--serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" /-->
        <behavior name="WcfPortalBehavior">
		  <!--for http and https -->		  
		  <serviceMetadata httpsGetEnabled="true" httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="true" />
        <behavior name="">
			<!--for http and https -->
			<serviceMetadata httpsGetEnabled="true" httpGetEnabled="true" 
           externalMetadataLocation="" />
          <serviceDebug includeExceptionDetailInFaults="false" />
      <service behaviorConfiguration="WcfPortalBehavior" name="Csla.Server.Hosts.Mobile.WcfPortal">		  
		  <endpoint address="" binding="basicHttpBinding" bindingConfiguration="basicHttpBinding_IWcfPortal" contract="Csla.Server.Hosts.Mobile.IWcfPortal">
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
			   <binding name="basicHttpBinding_IWcfPortal" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
				   <!--for http -->
				   <security mode="None">				   
				   <!--for https -->
					   <!--security mode="Transport"-->


    <compilation targetFramework="4.5" />
    <authentication mode="Windows" />
    <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID" />
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
        <assemblyIdentity name="Csla" publicKeyToken="93be5fdc093e4c30" culture="neutral" />
        <bindingRedirect oldVersion="" newVersion="4.5.601.0" />
Needless to say that the app works perfectly in an  local environment or without the reverse proxy on a web server.

Sorry for the long post - maybe somebody can help or at least push me in the right direction.

Copyright (c) Marimer LLC