WCF service in SharePoint 2010

Just created custom WCF service in SharePoint 2010.

Incredibly straightforward which is just brilliant.

1. Followed this article on msdn

2. I also needed to add the following attributes to the service class

[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
    [BasicHttpBindingServiceMetadataExchangeEndpoint]

From here on it works and can be referenced (“Add Service reference” in Visual Studio) from a client application.

Just remember to add mex to the end of the url to find the end point

for example

http://servername/_vti_bin/basicservice.svc/mex

Without the “mex” you will get a HTTP: 400 internal error.

Yorum Gönder

0 Yorumlar

Ad Code

Responsive Advertisement