Click here to Skip to main content
15,846,346 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
XML
<configuration>

  <system.serviceModel>
    <bindings>
      <!--<wsHttpBinding>
        <binding name="wsHttpEndpointBinding">
          <security mode="None" >
            <message clientCredentialType="Certificate" />
          </security>
        </binding>
      </wsHttpBinding>-->

    </bindings>
    <services>
      <service name="HelloService.HelloService" behaviorConfiguration="mexBehaviour">
        <endpoint address="HelloService" binding="basicHttpBinding" contract="HelloService.IHelloService"></endpoint>
        <endpoint address="mex" binding="mexHttpBinding" contract="HelloService.IHelloService"></endpoint>
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:8181/HelloService"/>
          </baseAddresses>
        </host>
      </service>

    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="mexBehaviour">
          <serviceMetadata  httpGetEnabled="true"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>
</configuration>
Posted
Comments
PIEBALDconsult 7-Nov-14 21:46pm    
Don't you need that wsHttpBinding ?
Member 11143223 7-Nov-14 23:25pm    
I modified the code by uncommenting wsHttpBinding still its not working. when I add the servicereference its giving the following error.

There was an error downloading 'http://localhost:8181/HelloService'.
Unable to connect to the remote server
No connection could be made because the target machine actively refused it 127.0.0.1:8181
Metadata contains a reference that cannot be resolved: 'http://localhost:8181/HelloService'.
There was no endpoint listening at http://localhost:8181/HelloService that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.
Unable to connect to the remote server
No connection could be made because the target machine actively refused it 127.0.0.1:8181
If the service is defined in the current solution, try building the solution and adding the service reference again.
khurram ali lashari 7-Nov-14 22:34pm    
you are not exploring meta data that is why you are not able to browse your WCF Service
Member 11143223 7-Nov-14 23:27pm    
I changed that code still I am not able to get..

<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange">
khurram ali lashari 8-Nov-14 7:43am    
Did you rebuild after changing ?

1 solution

you are making some mistake in your configuration file

Modify You Configuration like this

HTML
<endpoint address="mex">
                  binding="mexHttpBinding"
                  contract="IMetadataExchange" /></endpoint>


i hope it will help you......
 
Share this answer
 
Comments
Member 11143223 7-Nov-14 23:24pm    
I modified the code, still not working. when I add the service its giving the error as below. can you help me..


There was an error downloading 'http://localhost:8181/HelloService'.
Unable to connect to the remote server
No connection could be made because the target machine actively refused it 127.0.0.1:8181
Metadata contains a reference that cannot be resolved: 'http://localhost:8181/HelloService'.
There was no endpoint listening at http://localhost:8181/HelloService that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.
Unable to connect to the remote server
No connection could be made because the target machine actively refused it 127.0.0.1:8181
If the service is defined in the current solution, try building the solution and adding the service reference again.
PIEBALDconsult 7-Nov-14 23:27pm    
Is port 8181 open?
khurram ali lashari 8-Nov-14 7:41am    
comment host element and try

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