Hi everyone,
I'm trying to create a custom REST service in Creatio 8.3.4 and am facing an issue accessing the service endpoint.
Service Implementation:
I have created a service that inherits from BaseService with the following attributes:
[ServiceContract]
[AspNetCompatibilityRequirements(
RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]
public class UsrClaimHoverService : BaseService
{
[OperationContract]
[WebInvoke(
Method = "POST",
BodyStyle = WebMessageBodyStyle.Bare,
RequestFormat = WebMessageFormat.Json,
ResponseFormat = WebMessageFormat.Json)]
public ClaimHoverResponse GetClaimPreview(ClaimHoverRequest request)
{
return new ClaimHoverResponse
{
ClaimName = "Test Claim"
};
}
}
The package compiles successfully.
Issue
When I try to access the endpoint:
/0/rest/UsrClaimHoverService/GetClaimPreview
I receive:
403 Forbidden
or
Endpoint not found
or
404 File or directory not found
depending on the URL used.
When calling the service from JavaScript using fetch(), the response is an HTML page instead of JSON.
Additional Information
I found several community posts mentioning the following attributes:
[DefaultServiceRoute]
[SspServiceRoute]
However, adding them results in compilation errors:
CS0246
The type or namespace name 'DefaultServiceRoute' could not be found.
CS0246
The type or namespace name 'SspServiceRoute' could not be found.
These attributes do not appear to exist in my Creatio installation.
What I have already verified
Service compiles successfully.
Inherits from BaseService.
Uses ServiceContract, OperationContract, and WebInvoke.
IIS application has been restarted.
Package has been compiled successfully.
Tried both:
/0/rest/UsrClaimHoverService/GetClaimPreview
/0/ssp/rest/UsrClaimHoverService/GetClaimPreview
Still unable to access the service.