Having different Paths in the same Rest API - rest

We are using Spring. Is it possible to have different paths in the same REST service. We have one service and we want to have two different endpoints like following in the same REST API. I don't want to follow the best prictices. My question is if it is possible and how? thanks.
http_//domain.com/product/{id}
http_//domain.com/user/{id}

It is possible like below.
#RequestMapping({ "/product/{id}", "/user/{id}" })
Refer multiple-requestmapping-value-with-path-variables

Related

spyne How to get a list of soap action names?

I have two soap applications implementing different, soap actions which I want to route accordingly. How can I get the listing of the soap actions available in my spyne service? Is it available through spyne.interface.xml_schema or Application?
I do not want to hardcode a list of soap actions in my app if possible.
You should look inside the Interface class.
I think you can use ctx.app.interface.method_id_map
If it doesn't help you, try one of the members initialized here:
https://github.com/arskom/spyne/blob/4ae0653e1e426e8c2ee4e3044bb85d5b48c8c10b/spyne/interface/_base.py#L65
Thanks this helped.
I used soap_actions = {k.split("}")[1] for k in spyne_app.interface.service_method_map.keys()}

How to search with multiple entities in Axios Assyst?

I am using making two http calls to Assyst REST api to fetch Priority value and closure action value like as follows.
> http://localhost:8989/assyst/assystGOLD/Priority?shortCode=%225%22&fields=name,shortCode&fmt=xml
> http://localhost:8989/assyst/assystGOLD/ActionType?shortCode=%22closure%22&fmt=xml
Now I want to merge these two url's to work in a single call. So I made below URL, but no luck.
http://localhost:8989/assyst/assystGOLD/ActionType?shortCode=%22closure%22&Priority?shortCode=%225%22&fields=name,shortCode&fmt=xml
Can anyone help me on this?
This isn't possible I'm afraid. The REST API only works with a single resource (Priority and Action Type in your example) in each request. You need to make two requests to get these two unrelated pieces of information.
Your example is using the legacy API's syntax. I recommend using the new REST API for new development - it is embedded within the main assyst Enterprise application and has much improved performance.
Paul

WSO2 APIM: Merge multiple SOAP WSDLs

We have a different number of services that have specific WSDLs, although we wanted to merge them into a single one, are we able to do that?
To clarify the question we will provide an example of a backend:
http://mytest.ws.com/resource/v2/service.asmx
http://mytest.ws.com/resource/v2/service.asmx?wsdl
http://mytest.ws.com/resource/v2/service2.asmx
http://mytest.ws.com/resource/v2/service2.asmx?wsdl
What we are trying to achieve is to join these services in a single base resource, such as:
http://mywso2apim.com/resource/v2/service.asmx
http://mywso2apim.com/resource/v2/service2.asmx
Is this possible to achieve via WSO2 API Manager?
Thanks for your time!

How to share a common mapping template at AWS API Gateway?

I'm having a lot of duplicated mapping templates across endpoints on my AWS API Gateway implementation.
I would like to have a single template defined, and then just tell an endpoint to use that particular template.
Is this possible?
This is not currently supported, but definitely something we can consider in the future as we update the service.
Update: My apologies. Templates are exposed as their own resource. Can you tell me how you are creating your API? I may be able to advise on how to re-use them correctly.

REST pass multiple inputs to GET method

I have deployed a simple REST based application in RAD.
A simple URL is accessed using http://localhost/<contextroot>/users/<username> where <username> is accessed using reqeust.getAttributes(). Now, how do i pass more than one attribute to the REST service?
Usually you'll use query parameters:
http://localhost/<contextroot>/users/<username>?a=10&b=hello
You haven't indicated which language or framework you are using so I can't tell you how to do this in code.
You could also use URLs of the style http://localhost/<contextroot>/comments/<username>/after/<date>, but that tends to get messy if you wish to include a large number of options.