I want to use WCF service in SharePoint 2010 but have problem.
First, in mapped Sp2010 folder(ISAPI) I created newfolder/myfile.svc and in that file I put a reference to my DLL:
<%@ServiceHost Language="C#" Factory="Microsoft.SharePoint.Client.Services.MultipleBaseAddressBasicHttpBindingServiceHostFactory,Microsoft.SharePoint.Client.ServerRuntime, Version=184.108.40.206, Culture=neutral, PublicKeyToken=71e9bce111e9429c" Service="ACIS.WCFService.GraphProccesor, ACIS.WCFService, Version=220.127.116.11, Culture=neutral, PublicKeyToken=c4ecbdc9be141501" %>
Then, in an additional folder (outside ISAPI) I created WCF service logic (class GraphProccesor, namespace ACIS.WCFService)
I compiled, deployed and everything seems ok. in my .dll (c4ecbdc9be141501) - I have namespace and class (same as in above directive), in C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\ISAPI\ACISWCFService - I have myfile.svc
But when i try to get url of service in IE i got:
The type 'ACIS.WCFService.GraphProccesor, ACIS.WCFService, Version=18.104.22.168, Culture=neutral, PublicKeyToken=c4ecbdc9be141501', provided as the Service attribute value in the ServiceHost directive could not be found.
Please, any suggestions? Did I forget something additional?
Edit #1: Ok, thank you for suggestion but that didn't help. What partially helped is that I added web.config (in first place i forgot that) in _vti_bin/myfolder. Now I getting error message: "Cannot create a file when that file already exists. (Exception from HRESULT: 0x800700B7)"
When I try to get my svc file with "svcutil.exe" in the way "http://dt-slavenl/sites/acis/_vti_bin/ACISWCFService/service.svc" i got message:
WS-Metadata Exchange Error URI: http://dt-slavenl/sites/acis/a1/_vti_bin/ACISWCFService/service.svc Metadata contains a reference that cannot be resolved: 'http://dt-slavenl/si tes/acis/a1/_vti_bin/ACISWCFService/service.svc'. The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'NTLM'. The remote server returned an error: (401) Unauthorized. HTTP GET Error URI: http://dt-slavenl/sites/acis/a1/_vti_bin/ACISWCFService/service.svc The HTML document does not contain Web service discovery information.
Edit #2: I manage to come "near" my webservice thanks to Marek link. New problem is that when I want to access to web service from IE i got:
Security settings for this service require 'Anonymous' Authentication but it is not enabled for the IIS application that hosts this service.
If somebody know how to configure SP app pool or web.config so that I can access from IE, that would be awesome! If not, my new strategy is to create web part (full trust) with image control which has property "imageurl" set to http handler (.ashx) WHICH then will communicate with my wcf service and give response (image) to image.imageurl. If somebody see some potential problems please let me know. Also any suggestion for best way how to implement proxy or client access (from .ashx) will be appreciated!