Click here to Skip to main content
15,888,610 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i have created a wcf service when ever i click that url directly i am getting output properly but when ever i am consuming that service using proxy or adding service reference its giving below error.please help.

adding service reference giving error like :

+		$exception	{"Could not find default endpoint element that references contract 'ServiceReference1.IAuthenticateService' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element."}	System.InvalidOperationException



while adding proxy client giving below error:

+		$exception	{"Manual addressing is enabled on this factory, so all messages sent must be pre-addressed."}	System.InvalidOperationException


What I have tried:

<system.servicemodel>
    <services>
      <service behaviorConfiguration="ServiceBehaviour" name="WcfService.AuthenticateService">
        <endpoint  address="" behaviorConfiguration="web" binding="webHttpBinding" contract="WcfService.IAuthenticateService" />
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
        <host>
          <baseaddresses>
            <add baseAddress="http://localhost/WcfService" />
          
        
      
    
    
    <bindings>
      <webhttpbinding>
        <!--<binding name="web">         
          <security mode="TransportCredentialOnly">
            <transport  clientCredentialType="Basic"/>
          
        -->
      
    
    <behaviors>
      <servicebehaviors>
        <behavior>
          <!-- To avoid disclosing metadata information, set the values below to false before deployment -->
          <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
          <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
          <serviceDebug includeExceptionDetailInFaults="false" />
        
        <behavior name="ServiceBehaviour">
          <serviceMetadata httpGetEnabled="true"  />
          <serviceDebug includeExceptionDetailInFaults="false" />
          <servicecredentials>
            <userNameAuthentication userNamePasswordValidationMode="Custom"
                                    customUserNamePasswordValidatorType="WcfService.AuthenticationValidation, WcfService"/>
          
        
      
      <endpointbehaviors>
        <behavior name="web">
          <webHttp helpEnabled="true" />
        
      
    
    <protocolmapping>
     
    
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
  



  <system.servicemodel>
    <bindings>
      <webhttpbinding>
        <binding name="webHttpBinding_IAuthenticateService" />
      
    
    <client>
      <endpoint address="http://localhost/WcfService"
                       binding="webHttpBinding"
                       bindingConfiguration="webHttpBinding_IAuthenticateService"
                       contract="WcfService.IAuthenticateService"
                       name="webHttpBinding_IAuthenticateService">
Posted
Updated 20-Nov-18 0:28am
v2
Comments
johannesnestler 12-Nov-18 8:10am    
I'd try not to use a base-address, try direct addressing
Member 14049190 13-Nov-18 1:18am    
even i have tried by that also same result

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900