currently I am optimizing my knowledge in SharePoint development while creating a custom service application for SharePoint 2010. My plan is to include multiple services in my solution for different tasks.
Currently I am at a problem where I can’t find any further informations, and hopefully someone here knows the answer and could help me out.
For example:
I have two contracts:
IServiceA
IServiceB
Both contracts has its own service
ServiceA.svc
ServiceB.svc
In the ServiceApplication itself, inherit SPIisWebServiceApplication, I need to include the abstract members, one of them is the VirtualPath. The virtual path is the path to the service itself. But now I have multiple service endpoints?!? How could I say that I have multiple service endpoints? Have I missunderstand something?
I put together a pretty detailed step by step on building service applications in SharePoint. You can check it out here http://www.mattjcowan.com/funcoding/tag/mycorp/.
Essentially, you just configure the endpoint in your custom SPIisWebServiceApplication as a “dummy.svc” (call it whatever you want). Then when you get your channel factory (I do this in an abstract base client class), do a simple “Replace” command on “dummy.svc” with whichever endpoint you want. My base client class exposes an EndpointSvcFile property, so each service client can have it’s own service and associated configuration.
Something like this: