Windows Communication Foundation WCF, servis-yönelimli mimariyi temel alarak dağıtık-uygulamalar geliştirmek için kullanılan, dağıtık mimari modelleri ve teknolojileri tek çatı altında birleştiren ve içerisinde bir çok hazır bileşen barındıran bir Framework API‘sidir. (Bknz. Service Oriented Architecture)
Ayrıca WCF mimarisi, .NET Remoting, XML Web Servisleri, Web Service Enhancements (WSE), Enterprise Services/COM+ ve Microsoft Message Queue(MSMQ) gibi bir çok dağıtık uygulama geliştirme modelinin tek bir programlama modeli içerisinde geliştiriciye sunmaktadır.
Kaynak: http://www.kazimcesur.com/wcf/
<serviceBehaviors>
<behavior name="<name>">
<!-- Other options would go here -->
<useRequestHeadersForMetadataAddress>
<defaultPorts> <!-- Use your own port numbers -->
<add scheme="http" port="81" />
<add scheme="https" port="444" />
</defaultPorts>
</useRequestHeadersForMetadataAddress>
</behavior>
</serviceBehaviors>
Kaynak: https://stackoverflow.com/questions/5007270/how-to-change-wsdl-url-from-internal-machine-name-to-public?answertab=votes#tab-top
try
{
IncomingWebRequestContext request = WebOperationContext.Current.IncomingRequest;
WebHeaderCollection headers = request.Headers;
foreach (string headerName in headers.AllKeys)
{
if (headerName != "X-Forwarded-For") { continue; }
return headers[headerName];
}
}
catch (Exception)
{
}
System.serviceModel içine eklenecek olan,
</system.serviceModel>
<diagnostics>
<messageLogging logMalformedMessages="true" logMessagesAtTransportLevel="true" />
</diagnostics>
</system.serviceModel>
Web config içine System.diagnotics içeriği,
<system.diagnostics>
<sources>
<source name="System.ServiceModel.MessageLogging" switchValue="Warning,ActivityTracing">
<listeners>
<add type="System.Diagnostics.DefaultTraceListener" name="Default">
<filter type="" />
</add>
<add name="ServiceModelMessageLoggingListener">
<filter type="" />
</add>
</listeners>
</source>
<source propagateActivity="true" name="System.ServiceModel" switchValue="Warning,ActivityTracing">
<listeners>
<add type="System.Diagnostics.DefaultTraceListener" name="Default">
<filter type="" />
</add>
<add name="ServiceModelTraceListener">
<filter type="" />
</add>
</listeners>
</source>
</sources>
<sharedListeners>
<add initializeData="x:\Log\Client.dll_messages.svclog"
type="System.Diagnostics.XmlWriterTraceListener, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
name="ServiceModelMessageLoggingListener" traceOutputOptions="Timestamp">
<filter type="" />
</add>
<add initializeData="x:\Log\Client.dll_tracelog.svclog"
type="System.Diagnostics.XmlWriterTraceListener, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
name="ServiceModelTraceListener" traceOutputOptions="Timestamp">
<filter type="" />
</add>
</sharedListeners>
</system.diagnostics>