where the user name and password used to install a .net service using the serviceinstaller were incorrect. Would have
been nice if the message said something like the user name and password are incorrect.
Blog focused on software development, configuration management, Amazon, Microsoft and related technologies
<system.serviceModel>
<services>
<service name="MyNamespace.MyService" behaviorConfiguration="DefaultAspNet">
<endpoint address="" behaviorConfiguration="ServiceAspNetAjaxBehavior" binding="webHttpBinding" contract="MyNamespace.MyService"/>
<endpoint address="" behaviorConfiguration="ServiceAspNetAjaxBehavior" bindingConfiguration="Secure" binding="webHttpBinding" contract="MyNamespace.MyService"/>
</service>
</services>
<behaviors>
<endpointBehaviors>
<behavior name="ServiceAspNetAjaxBehavior">
<enableWebScript />
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="DefaultAspNet">
<serviceAuthorization impersonateCallerForAllOperations="false" />
<serviceMetadata httpGetEnabled="true" httpGetUrl="" />
<serviceDebug httpHelpPageEnabled="true" includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<webHttpBinding>
<binding name="Secure">
<security mode="Transport"/>
</binding>
</webHttpBinding>
</bindings>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
</system.serviceModel>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ServiceModel.Activation;
using System.ServiceModel;
//Your Namespace Here
public class IisServiceHostFactory : ServiceHostFactory
{
protected override System.ServiceModel.ServiceHost CreateServiceHost(Type serviceType, Uri[] baseAddresses)
{
ServiceHost result = null; if (baseAddresses != null && baseAddresses.Length > 0 && HttpContext.Current != null && HttpContext.Current.Request != null)
{
Uri baseAddress = baseAddresses.First();
UriBuilder httpUriBuilder = new UriBuilder(baseAddress);
httpUriBuilder.Scheme = Uri.UriSchemeHttp; httpUriBuilder.Port = 80;
httpUriBuilder.Host = HttpContext.Current.Request.Url.Host;
UriBuilder httpsUriBuilder = new UriBuilder(baseAddress);
httpsUriBuilder.Scheme = Uri.UriSchemeHttps; httpsUriBuilder.Port = 443;
httpsUriBuilder.Host = HttpContext.Current.Request.Url.Host; result = new ServiceHost(serviceType, httpUriBuilder.Uri, httpsUriBuilder.Uri);
}
else
{
result = new ServiceHost(serviceType, baseAddresses);
}
return result;
}
}
//Your Namespace Here