The Solution Builder provides a bunch of generic approaches which allow you to implement business logic even without coding. Very often the logic is tricky and cannot be implemented by standard means. The universal solution is implementing a custom Web Service and registering it in the Solution Builder Web Service Repository.
To introduce a custom web service registered in Solution Builder Web Service Repository, ready to be used in standard Solution Builder scenarios.
Step 1: Implement Web Service Controller
Solution Builder works with REST services, which can be hosted anywhere.
If you have no plans to create independent Web Application which takes care of hosting the custom Web Service and you want to share the Web Application Environment of a Solution Builder, you need to follow the same technological stack used for system Solution Builder Web Services implementation, or use MVC Web API.
The Web Service Class has to have the name suffix "Controller", otherwise the Service Layer does not detect as Web Service, and also it has to inherit ApiController class. It is highly important that the Project where you implement the service references the System.Web.Http with the same version as the App Server you are going to deploy to. To exclude the possibility of visioning problem, you can reference this Assembly directly from the Application (..\svc\bin\System.Web.Http)
Using Data Layer API in Service
In case you want use Data Layer directly in your custom Web Service, you need to add a reference to ..\svc\bin\update4u.SPS.DataLayer.dll assembly to your Project.
Step 2: Deploy new Web Service to Host
Copy the assembly(-ies) which contains the implementation of a new Web Service (Web API Controller) to the "bin" folder of a Web Application where you are going to host the Web Service. In case you plan to share the same application as Solution Builder (Service Management), copy assemblies to "svc/bin" folder. To instruct the Service Layer to analyze the new added assembly for available Web Service controllers, you need to add the reference to uploaded DLL in svs/host.config file.
The IIS automatically detects the new available Web Service, but due to security reasons the endpoints for it are not created automatically, and if you try access your methods you will get "The resource not found" error message.
Step 3: Synchronize Web Host
Nevertheless the new Web Service available already in IIS, is still can not be executed and therefore not visible in Solution Builder. To solve that, you need to trigger the synchronization procedure to update metadata for available Web Services.
- Open Solution Builder application, Administration Home page and initiate the recording of the Customization Changes.
- Proceed to Administration/Integration/Web Servers management area.
- Select the object which represents the Web Server to which the new Web Service has been deployed.
- Run the "Synchronize Server" action.
Once the Web Server is synchronized, and the new Web Service is added to Service Repository, the Service Layer automatically creates endpoints, and Service can be used as independently as in Solution Builder.
Step 4: Setup permissions
All new Web Services and Operations added to Repository on Synchronization by default are granted only to Administrators. Please use standard "Set Audience" action to configure right permissions for people who are allowed to execute the Web Operation. See Set Audience