Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- The authentication schemes configured on the host ('Basic') do not allow those configured on the binding 'BasicHttpBinding' ('Anonymous'). Please ensure that the SecurityMode is set to Transport or TransportCredentialOnly.
- <configuration>
- <system.web>
- <compilation debug="true" targetFramework="4.5" />
- <httpRuntime targetFramework="4.5" />
- </system.web>
- <system.serviceModel>
- <behaviors>
- <serviceBehaviors>
- <behavior name="">
- <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
- <serviceDebug includeExceptionDetailInFaults="false" />
- </behavior>
- </serviceBehaviors>
- </behaviors>
- <serviceHostingEnvironment aspNetCompatibilityEnabled="true"
- multipleSiteBindingsEnabled="true" />
- </system.serviceModel>
- </configuration>
- <configuration>
- <startup>
- <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
- </startup>
- <system.serviceModel>
- <bindings>
- <basicHttpBinding>
- <binding name="BasicHttpBinding_IMyServiceSvc" />
- </basicHttpBinding>
- </bindings>
- <client>
- <endpoint address="http://localhost/MyServiceSvc.svc"
- binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IMyServiceSvc"
- contract="MyServiceSvc.IMyServiceSvc"
- name="BasicHttpBinding_IMyServiceSvc" />
- </client>
- </system.serviceModel>
- </configuration>
- public class BlackHillsCompletionSvcTest
- {
- static void Main(string[] args)
- {
- using (var client = new MyServiceSvcClient())
- {
- var data = new Data
- {
- id = "1",
- description = "test data"
- };
- try
- {
- var result = client.receiveData(data);
- }
- catch (Exception ex)
- {
- var msg = ex.Message;
- }
- }
- }
- }
- <system.serviceModel>
- <bindings>
- <basicHttpBinding>
- <binding name="httpBinding">
- <security mode="TransportCredentialOnly">
- <transport clientCredentialType="Basic" />
- </security>
- </binding>
- </basicHttpBinding>
- </bindings>
- ...
- </system.serviceModel>
- The binding at system.serviceModel/bindings/basicHttpBinding does not have a configured binding named 'BasicHttpBinding_IMyServiceSvc'. This is an invalid value for bindingConfiguration.
- <system.serviceModel>
- <bindings>
- <basicHttpBinding>
- <binding name="BasicHttpBinding_IMyServiceSvc">
- <security mode="TransportCredentialOnly">
- <transport clientCredentialType="Basic" />
- </security>
- </binding>
- </basicHttpBinding>
- </bindings>
- ...
- </system.serviceModel>
- The username is not provided. Specify username in ClientCredentials.
- using (var client = new MyServiceSvcClient())
- {
- client.ClientCredentials.UserName.UserName = "myusername";
- client.ClientCredentials.UserName.Password = "mypassword";
- ...
- }
- The requested service, 'http://localhost/MyServiceSvc.svc' could not be activated. Which got me wondering. So I loaded the .svc page in my browser, was asked to log in, and after I did, I saw this:
- The authentication schemes configured on the host ('Basic') do not allow those configured on the binding 'BasicHttpBinding' ('Anonymous'). Please ensure that the SecurityMode is set to Transport or TransportCredentialOnly. Additionally, this may be resolved by changing the authentication schemes for this application through the IIS management tool, through the ServiceHost.Authentication.AuthenticationSchemes property, in the application configuration file at the <serviceAuthenticationManager> element, by updating the ClientCredentialType property on the binding, or by adjusting the AuthenticationScheme property on the HttpTransportBindingElement.
- <system.serviceModel>
- <bindings>
- <basicHttpBinding>
- <binding name="httpBinding">
- <security mode="TransportCredentialOnly">
- <transport clientCredentialType="Basic" />
- </security>
- </binding>
- </basicHttpBinding>
- </bindings>
- <services>
- <service
- name="MyServiceSvcNs.MyServiceSvc"
- behaviorConfiguration="ServiceWithMetaData"
- >
- <endpoint name="Default"
- address=""
- binding="basicHttpBinding"
- bindingConfiguration="httpBinding"
- contract="MyServiceSvcNs.IMyServiceSvc"
- />
- </service>
- </services>
- <behaviors>
- <serviceBehaviors>
- <behavior name="ServiceWithMetaData">
- <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
- <serviceDebug includeExceptionDetailInFaults="false" />
- </behavior>
- </serviceBehaviors>
- </behaviors>
- <serviceHostingEnvironment aspNetCompatibilityEnabled="true"
- multipleSiteBindingsEnabled="true" />
- </system.serviceModel>
- <configuration>
- <system.web>
- <compilation debug="true" targetFramework="4.5" />
- <httpRuntime targetFramework="4.5" />
- </system.web>
- <system.serviceModel>
- <behaviors>
- <serviceBehaviors>
- <behavior name="">
- <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
- <serviceDebug includeExceptionDetailInFaults="false" />
- </behavior>
- </serviceBehaviors>
- </behaviors>
- <serviceHostingEnvironment aspNetCompatibilityEnabled="true"
- multipleSiteBindingsEnabled="true" />
- </system.serviceModel>
- </configuration>
- <configuration>
- <system.web>
- <compilation debug="true" targetFramework="4.5" />
- <httpRuntime targetFramework="4.5" />
- </system.web>
- <system.serviceModel>
- <bindings>
- <basicHttpBinding>
- <binding name="httpTransportCredentialOnlyBinding">
- <security mode="TransportCredentialOnly">
- <transport clientCredentialType="Basic" />
- </security>
- </binding>
- </basicHttpBinding>
- </bindings>
- <services>
- <service
- name="MyServiceSvcNs.MyServiceSvc"
- behaviorConfiguration="ServiceWithMetaData"
- >
- <endpoint name="Default"
- address=""
- binding="basicHttpBinding"
- bindingConfiguration="httpTransportCredentialOnlyBinding"
- contract="MyServiceSvcNs.IMyServiceSvc"
- />
- </service>
- </services>
- <behaviors>
- <serviceBehaviors>
- <behavior name="ServiceWithMetaData">
- <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
- <serviceDebug includeExceptionDetailInFaults="false" />
- </behavior>
- </serviceBehaviors>
- </behaviors>
- <serviceHostingEnvironment aspNetCompatibilityEnabled="true"
- multipleSiteBindingsEnabled="true" />
- </system.serviceModel>
- </configuration>
- <configuration>
- <startup>
- <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
- </startup>
- <system.serviceModel>
- <bindings>
- <basicHttpBinding>
- <binding name="BasicHttpBinding_IMyServiceSvc" />
- </basicHttpBinding>
- </bindings>
- <client>
- <endpoint address="http://localhost/MyServiceSvc.svc"
- binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IMyServiceSvc"
- contract="MyServiceSvc.IMyServiceSvc"
- name="BasicHttpBinding_IMyServiceSvc" />
- </client>
- </system.serviceModel>
- </configuration>
- <?xml version="1.0" encoding="utf-8" ?>
- <configuration>
- <startup>
- <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
- </startup>
- <system.serviceModel>
- <bindings>
- <basicHttpBinding>
- <binding name="httpTransportCredentialOnlyBinding">
- <security mode="TransportCredentialOnly">
- <transport clientCredentialType="Basic" />
- </security>
- </binding>
- </basicHttpBinding>
- </bindings>
- <client>
- <endpoint
- address="http://localhost/MyServiceSvc.svc"
- binding="basicHttpBinding"
- bindingConfiguration="httpTransportCredentialOnlyBinding"
- contract="MyServiceSvc.IMyServiceSvc"
- name="BasicHttpBinding_IMyServiceSvc"
- />
- </client>
- </system.serviceModel>
- </configuration>
- <bindings>
- <basicHttpBinding>
- <binding name="httpBinding">
- <security mode="TransportCredentialOnly">
- <transport clientCredentialType="Basic" />
- </security>
- </binding>
- </basicHttpBinding>
- </bindings>
Add Comment
Please, Sign In to add comment