spyne How to get a list of soap action names? - soap

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()}

Related

Having different Paths in the same Rest API

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

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

How to design a SOAP call in MatLab

I'm not clear at all on how to call a web service from MatLab. I'm trying to apply this guide but I don't understand several parts. For instance this.
Where is is specified that it's GET or POST?
What is namespace?
How am I supposed to provide the WSDL file I have?
I'm quite lost so any hint will be appreciated.
If you have access to the web service definition list (WSDL), you can go like this:
wsdl = createClassFromWsdl('http://server.domain/NameOfMethod.asmx?WSDL')
calls = methods(NameOfMethod)
response = HelloWorld(NameOfMethod, "Konrad")
See this info. It's very easy to follow and straight-forward to grasp. I'm surprised myself.
Since you want to use WSDL, you are working from the wrong documentation. You linked to a guide about SOAP.
To learn about WSDL, read this: Access Web Services That Use WSDL Documents. When you use MATLAB's createClassFromWsdl, you don't need to worry about the SOAP implementation. The generated MATLAB class takes care of that.

Client Program for RestFul WebService?

HI, i Have developed a restful webservice sample application, i want to create a client for the webservice, can anyone tell me how to do this? i was used Rest WebService explorer, but i want to know how to create a client and call the methods ?
Please help ?
Since REST is talking HTTP and is language-agnostic, you can use most any language/tooling available. Of course the simplest test bed available to you is the browser itself.
Have a look at these tools:
http://code.google.com/p/rest-client/
https://github.com/cloudhead/http-console
https://tcpmon.dev.java.net/ (proxying is helpful for debugging)
You can also use Resty, which should make accessing your webservices very easy.
https://github.com/beders/Resty
(see Readme for examples)

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.