How to use Soap API and configure backend credential

Amy Z 301 Reputation points
2022-05-23T12:05:57.873+00:00

Hi, we're testing a SOAP API, test with hard-code in portal is successful.
Now we want to know how to allow API consumer to use this API in the real world.

Setting : SOAP pass-through
Test WSDL : in my prior post here


## Requirement 1 :

How does API consumer provide subscription key at their end ?
We download the WSDL and use SoapUI to test it, not sure how to map the subscription key to the XML request.
204711-image.png


## Requirement 2 :

How do we parameterize the backend credential info by policy ?
Different operation is asked to use different credential to hit the backend, and credentials are stored in APIM.
Ex : Edit Operation should use EditUserAccount to access the backend, Get Operation should use GetUserAccount

Here's a valid payload from current test via portal , where \

Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
2,447 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Ben Gimblett 4,560 Reputation points Microsoft Employee
    2023-05-12T08:51:52.3633333+00:00

    Hi Amy - thanks for the question . I appreciate this is a very long time since you asked and hopefully you resolved the issue. I'm adding an answer for the first question above, for the benefit of anyone else who sees this

    APIM Subscription key is set on the http request, the SOAP payload (envelope) is part of the request body. So it should work find by the client adding the required http header and correct value to the incoming http request as documented here https://learn.microsoft.com/en-us/azure/api-management/api-management-subscriptions#use-a-subscription-key

    On the second point you should be able to transform the body from the client, before sending on to the backend using XSLT. So you could try that to amend an envelope header REF https://learn.microsoft.com/en-us/azure/api-management/xsl-transform-policy I would use named values for any secrets and integrate these with Key Vault as described here (dont hard code secrets in policy expressions) https://learn.microsoft.com/en-us/azure/api-management/api-management-howto-properties?tabs=azure-portal

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.