title: Configure WCF client endpoint to use a relative address (for Azure)
body: <p>I have a Windows Azure Cloud Service project containing <strong>multiple Web Roles</strong> to host some services. I want to use <strong>ServiceX</strong> in <strong>ServiceY</strong> (each running on <strong>diffrent roles</strong>) using an <strong>relative</strong> URL. </p>
  
  <p>Thats the way I host ServiceX:</p>
  
  <pre><code>&lt;service name="ServiceX"&gt;
      &lt;endpoint address="" binding="basicHttpBinding" contract="ServiceX" /&gt;
      &lt;endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/&gt;
  &lt;/service&gt;
  </code></pre>
  
  <p>Now I want to use that service in ServiceY. With an absolute URL it works fine:</p>
  
  <pre><code>&lt;system.serviceModel&gt;
      &lt;client&gt;
        &lt;endpoint name="ServiceXProxy"
            address="http://mycloudservice.cloudapp.net:8080/ServiceX.svc"
            binding="basicHttpBinding"
            contract="ServiceX"/&gt;
  ...
  </code></pre>
  
  <p>But how can I use the ServiceX in ServiceY with a relative address? Isn't that possible since they running on the same cloud service?</p>