How to add services in the same API with different path?

hsnbilgen
Participant III

I have two different services, I would like to att those services under same API but different path. Forexample one API path calls temperature converter service other path calls currency converter example. Can I have that capabilities on on-premise model of Edge? Can anyone help me on this?

0 5 429
5 REPLIES 5

Hi Hasan,

In your ProxyEndpoint (something like apiproxy/proxies/default.xml) you can change the BasePath. Hope this helps!

Sean

Actually its not what i expect. basePath will be one but other paths for example /basepath/path1 : calls temperature converter service . and /basepath/path2: will calls currency converter service. but base path is going to be my API proxy. Hope this is more clear

Using your example, it sounds like you would have two separate API proxies. Currency API and Temperature API.

In this case, the BasePath might be set to something like "/v1/currency". You would then use the path suffix to identify resources within that API. E.g. you might have a flow like this...

<Flow name="Convert Currency">
<Condition>proxy.pathsuffix MatchesPath "/convert"</Condition>
<Step> ...... </Step>
</Flow>

and this would be called for {host}/v1/currency/convert.

If you would like Currency and Temperature API's to be in separate bundles, they need different base paths. If you want them to be different resources in the same bundle, then just the conditions as above.

Does that make sense? Let me know if you need an example of the latter.

yea same bundle but different path. Here is my problem i did everything but i couldn't add any of rest service link on the path for example you showed me. Its not possible or can you do that?

here is example links:

http://www.w3schools.com/xml/tempconvert.asmx?wsdl ------> make this as /temp

http://www.webservicex.com/CurrencyConvertor.asmx?wsdl -------> make this as /currency

Can you make that bundle for me i would like to see the results so thanks