Click here to Skip to main content
15,889,116 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Im trying to consume a WCF service in Sharepoint 2010 through Webparts. I followed this link for doing it.

http://www.c-sharpcorner.com/Forums/Thread/182472/how-to-create-deploy-and-consume-wcf-service-in-sharepoint.aspx

But I'm not able to discover the Service.svc while adding service reference in the client. It shows error regarding metadata.

Can anyone help Please??
This is my web.config file
XML
<configuration>
 
  <system.servicemodel>
 
    <behaviors>
 
      <servicebehaviors>
 
        <behavior name="WcfService.RevertServiceServiceBehavior">
 
          <servicemetadata httpgetenabled="true" />
 
          <servicedebug includeexceptiondetailinfaults="false" />
 
        </behavior>
 
      </servicebehaviors>
 
    </behaviors>
 
    <services>
 
      <service behaviorconfiguration="WcfService.RevertServiceServiceBehavior">
 
          name="WcfService.RevertService">
 
        <endpoint address="" binding="basicHttpBinding" contract="WcfService.IRevert">
 
          <identity>
 
            <dns value="localhost" />
 
          </identity>
 
        </endpoint>
 
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
 
      </service>
 
    </services>
 
  </system.servicemodel>
 
</configuration>



Thanks Suresh
Posted
Updated 7-Feb-13 17:54pm
v3

1 solution

 
Share this answer
 
Comments
Sureshbalajin 7-Feb-13 6:13am    
Thanks Rohit.
But, When I followed it I got stuck up at step 23. Im not able to discover the MyService.svc. Say my site URL is http://VM11:2505/sites/SPDemoSite , my project name is WCFSPProject1 ,namespace WcfServiceLibrary1 and my serice file name is MyService.svc. Then what could be the possible location where the .svc file can be discovered. What is that _vti_bin ? Does it apply for all machines?? Pls can u Help ??

Thanks
Suresh
[no name] 7-Feb-13 7:11am    
your web.config is correct ??
Sureshbalajin 7-Feb-13 10:30am    
Ya i hope so...




<configuration>

<system.servicemodel>

<behaviors>

<servicebehaviors>

<behavior name="WcfServiceLibrary1.Service1ServiceBehavior">

<servicemetadata httpgetenabled="true">

<servicedebug includeexceptiondetailinfaults="false">







<services>

<service behaviorconfiguration="WcfServiceLibrary1.Service1ServiceBehavior"

="" name="WcfServiceLibrary1.Service1">

<endpoint address="" binding="basicHttpBinding" contract="WcfServiceLibrary1.IService1">

<identity>

<dns value="localhost">





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







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