Click here to Skip to main content
15,890,557 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
HI,
I have created WCF Service library in VS 2010 with reference to WCF Service Sample article from codeproject.com.
Interface is IBookService
Class which implements interface is BookService
Namespace which contains class as well Interface WCFCodeProjectSampleService

Please help me to solve this issue.I have tried so many ways but i am not able to solve it.

Below is App.config file which currently i am using:


XML
<system.serviceModel>
    <bindings>
      <wsHttpBinding>
        <binding name="NewBinding0" />
      </wsHttpBinding>
    </bindings>
    <services>
      <service behaviorConfiguration="WCFCodeProjectSampleService.ServiceBehaviour" name="WCFCodeProjectSampleService.BookService">
        <endpoint address="" binding="wsHttpBinding" bindingConfiguration="NewBinding0"
          contract="WCFCodeProjectSampleService.IBookService">
          <identity>
            <dns value="localhost" />
            <certificateReference storeLocation="LocalMachine" />
          </identity>
        </endpoint>
        <endpoint address="mex" binding="mexHttpBinding" bindingConfiguration=""
          contract="IMetadataExchange" />
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:8732/Design_Time_Addresses/WCFCodeProjectSampleService/BookService/" />
          </baseAddresses>
        </host>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="WCFCodeProjectSampleService.ServiceBehaviour">
          <!-- To avoid disclosing metadata information, 
          set the value below to false and remove the metadata endpoint above before deployment -->
          <serviceMetadata httpGetEnabled="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>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>
Posted
Updated 24-Aug-13 7:17am
v5
Comments
Mahesh Bailwal 24-Aug-13 13:39pm    
can you provide url from where you picked this code?
Tushar Urade 24-Aug-13 13:46pm    
I have not copied the whole code.I have tried to implement by my own by seeing code available there.
When we are creating WCF Service Library in VS 10,i have deleted old classes IService.cs and Service.cs ,and added my Own new classes which i have provided in above question.Though,
i am providing URl...
http://www.codeproject.com/Articles/123067/A-Simple-Sample-WCF-Service

1 solution

Your service should be run,then, you can set the endpoint address as your webservice address in the target application.
Additionally, When there are multi endpoints which are associated with a WCF service, you can define a primary address and then address those endpoints through a relative address. The primary address is called Base Address. You can define the base addresses as below:
XML
<host>
<baseAddresses>
<add baseaddress="http://localhost:8080/QuickReturns" />
<add baseaddress="net.pipe://localhost/QuickReturns" />
</baseAddresses>
</host>

And the relative addresses for endpoint would be like this:
XML
<endpoint>
name="BasicHttpBinding"
address="Exchange"
bindingsSectionName="BasicHttpBinding"
contract="IExchange" />
<endpoint>
name="NetNamedPipeBinding"
address="Exchange"
bindingsSectionName="NetNamedPipeBinding"
contract="IExchange" />
</endpoint></endpoint>

You current address is empty and this is why it is not available when you call it.
 
Share this answer
 

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