我正试图让这个工作变得绝对噩梦。有人可以指出我正确的方向或告诉我我哪里出错了吗?
我创建了一个位于LocalMachine\My
。
我已经关注了这个网站以及其他人和文档的建议,但似乎遗漏了一些东西,因为我的ASP.NET网站仍然可以在没有身份验证的情况下连接到WebService。
总结一下:网站连接到网络服务很好,表明身份验证不起作用,因为我还没告诉网站连接到网络服务需要哪些安全设置。
提前谢谢
以下是信息:
WebService Host(控制台应用)在
中使用以下代码ServiceHost host = new ServiceHost(typeof(MyService));
host.Open();
<services>
<service behaviorConfiguration="MetaDataBehaviour" name="MyService_Provider.MyService">
<clear />
<endpoint address="myService" binding="wsHttpBinding" contract="MyService_Provider.IMyService"
listenUriMode="Explicit" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:8080" />
</baseAddresses>
</host>
</service>
</services>
<system.serviceModel>
<bindings />
<client />
<services>
<service behaviorConfiguration="MyService_Provider.Service1Behavior"
name="MyService_Provider.MyService">
<endpoint address="" binding="wsHttpBinding" contract="MyService_Provider.IMyService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:8732/Design_Time_Addresses/MyService_Provider/Service1/" />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="MyService_Provider.Service1Behavior">
<serviceMetadata httpGetEnabled="True"/>
<serviceDebug includeExceptionDetailInFaults="False" />
<serviceCredentials>
<userNameAuthentication userNamePasswordValidationMode="Custom" customUserNamePasswordValidatorType="MyService_Provider.CredentialsValidator,MyService_Provider"/>
<serviceCertificate findValue="mycert" storeLocation="LocalMachine" storeName="My" x509FindType="FindBySubjectName"/>
</serviceCredentials>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>