У меня есть собственный сервис WCF.
Я думаю, что сервис работает нормально, но когда я пытаюсь получить доступ к URL из IE, ничего не происходит.
Я добавил некоторую отладку и похоже, что сервис сам по себе не проблема.
Любая помощь будет оценена.
С уважением
Ash
Код службы хоста с отладкой
Type serviceType = typeof(MessageHandlerServer);
Uri serviceUri = new Uri("http://localhost:8080/");
ServiceHost host = new ServiceHost(serviceType, serviceUri);
host.Open();
#region Output dispatchers listening
foreach (Uri uri in host.BaseAddresses)
{
Console.WriteLine("\t{0}", uri.ToString());
}
Console.WriteLine();
Console.WriteLine("Number of dispatchers listening : {0}", host.ChannelDispatchers.Count);
foreach (System.ServiceModel.Dispatcher.ChannelDispatcher dispatcher in host.ChannelDispatchers)
{
Console.WriteLine("\t{0}, {1}", dispatcher.Listener.Uri.ToString(), dispatcher.BindingName);
}
Console.WriteLine();
Console.WriteLine("Press <ENTER> to terminate Host");
Console.ReadLine();
#endregion
Вывод
Number of dispatchers listening : 2
http://localhost:8080/, http://tempuri.org/:WSDualHttpBinding
http://localhost:8080/, ServiceMetadataBehaviorHttpGetBinding
Press <ENTER> to terminate Host
Вот конфигурация службы, игнорируйте бит загрузчика модуля (если только вы не думаете, что это вызывает проблему), на данный момент он не актуален.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<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 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:\Users\Ash\Documents\Visual Studio 2010\Projects\FrameworkPrototype\Driver\App_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="C:\Users\Ash\Documents\Visual Studio 2010\Projects\FrameworkPrototype\Driver\App_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>
<system.serviceModel>
<diagnostics>
<messageLogging logMalformedMessages="true" logMessagesAtTransportLevel="true" />
</diagnostics>
<bindings>
<wsDualHttpBinding>
<binding name="WSDualHttpBinding_IMessageHandlerServer" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00" />
<security mode="Message">
<message clientCredentialType="UserName" />
</security>
</binding>
</wsDualHttpBinding>
<basicHttpBinding>
<binding name="HttpStreaming" maxReceivedMessageSize="67108864"
transferMode="Streamed"/>
</basicHttpBinding>
</bindings>
<services>
<service name="MessageHandlerServer" behaviorConfiguration="defaultProfile" >
<endpoint address="http://localhost:8080" binding="wsDualHttpBinding"
bindingConfiguration="WSDualHttpBinding_IMessageHandlerServer" contract="IMessageHandlerServer" />
</service>
<service name="ModuleDownloader" behaviorConfiguration="defaultProfile" >
<endpoint address="http://localhost:8082" binding="basicHttpBinding"
bindingConfiguration="HttpStreaming" contract="IModuleDownloader" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="defaultProfile">
<serviceMetadata httpGetEnabled="True"/>
<serviceCredentials>
<serviceCertificate findValue="MyServerCert" x509FindType="FindBySubjectName" storeLocation="LocalMachine" storeName="My" />
<userNameAuthentication userNamePasswordValidationMode="Custom" customUserNamePasswordValidatorType="UsernameValidator, MessageHandlerServer" />
</serviceCredentials>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>