मैं दो आधार पतों मेरी WCF सेवा कॉन्फ़िग फ़ाइल में परिभाषित किया गया है:WCF सेवा बेस पता Http और netTcp
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.diagnostics>
<sources>
<source name="System.ServiceModel" switchValue="Warning, ActivityTracing"
propagateActivity="true">
<listeners>
<add type="System.Diagnostics.DefaultTraceListener" name="Default">
<filter type="" />
</add>
<add name="ServiceModelTraceListener">
<filter type="" />
</add>
</listeners>
</source>
</sources>
<sharedListeners>
<add initializeData="C:\WCF Service Logs\app_tracelog.svclog"
type="System.Diagnostics.XmlWriterTraceListener, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
name="ServiceModelTraceListener" traceOutputOptions="DateTime, Timestamp">
<filter type="" />
</add>
</sharedListeners>
</system.diagnostics>
<system.serviceModel>
<bindings>
<netTcpBinding>
<binding name="netTcp" maxBufferPoolSize="50000000" maxReceivedMessageSize="50000000">
<readerQuotas maxDepth="500" maxStringContentLength="50000000" maxArrayLength="50000000" maxBytesPerRead="50000000" maxNameTableCharCount="50000000" />
<security mode="None"></security>
</binding>
</netTcpBinding>
</bindings>
<services>
<service behaviorConfiguration="ReportingComponentLibrary.TemplateServiceBehavior"
name="ReportingComponentLibrary.TemplateReportService">
<endpoint address="TemplateService" binding="netTcpBinding" bindingConfiguration="netTcp"
contract="ReportingComponentLibrary.ITemplateService"></endpoint>
<endpoint address="ReportService" binding="netTcpBinding" bindingConfiguration="netTcp"
contract="ReportingComponentLibrary.IReportService"/>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:8001/TemplateReportService" />
<add baseAddress="http://localhost:8181/TemplateReportService" />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="ReportingComponentLibrary.TemplateServiceBehavior">
<serviceMetadata httpGetEnabled="True"/>
<serviceDebug includeExceptionDetailInFaults="True" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>
और हालांकि मैं endpoint netTcpBinding के रूप में बाध्यकारी निर्धारित किया है,
मैं सिर्फ अपने WCF का उपयोग करने में सक्षम हूँ आधार पते के साथ सेवा:
http://localhost:8181/TemplateReportService
और नहीं के साथ
net.tcp://localhost:8001/TemplateReportService
मैं नेटटीसीपी पते के साथ अपनी सेवा कैसे पहुंच सकता हूं?
आप मार्क धन्यवाद, तो इसका मतलब यह है कि भले ही मैं दोनों अंतिमबिंदुओं के लिए netTcpBinding निर्धारित किया है, लेकिन अगर मैं है मेटाडाटा HttpBinding के लिए अवगत कराया उसके HTTP पते पर सेवा सामने आ जाएगी। – iniki
यह http पते पर सेवा के लिए मेटाडेटा का खुलासा करेगा - जिसका अर्थ है कि आप केवल अपने ब्राउज़र के साथ नेविगेट कर सकते हैं। नेटटीसीपी एंडपॉइंट्स सक्रिय हैं और उपयोग करने के लिए तैयार हैं - आप वहां जाकर ब्राउज़र में कोई भी संकेत नहीं प्राप्त कर सकते हैं .... –