The rewrite-uri policy helps in transforming the inbound URLs to the format expected by backend or client systems. In our scenario, we need to convert the public REST URL, https://shipnywhere.azure-api/Products/v1/CreateProduct, to a backend SOAP URL, https://shipanywhereproducts.azurewebsites.net/ProductService.svc.
The policy can be written as follows. Note that the service URL is relative path to the backend service configured when creating the APIM service:
Rewrite-uri policies can be used to expose alternative, clean, user-friendly, RESTful, and SEO-friendly URLs.
When we run the APIs in the test console, we can see the rewrite policy execution in the trace: