0

I am working on a django/python project. i want to create an api (webservices). What i want is to call a remote function from a python client. I was used to work with WSDL and WCF in ASP.Net. Is there something like this in django/python ? I started to work with djangorestframework but i do not think this is the right way. This framework allows me to put, read, insert or update objects in a database. I think REST is only dedicated to those operations. What i want is to call a remote function, without storing data on the server (this is just calculation).

Thanks

1 Answer 1

1

You don't have to strictly handle CRUD operations when using REST. In terms of technology, there's nothing stopping you from doing calculation with any method (GET, POST, PUT, DELETE, etc). In terms of methodology, you could do a calculation using a GET request since GET is used to retrieve information, which is exactly what you're doing. You don't necessarily have to handle resources.

If you still don't feel comfortable with REST, you can always switch back to SOAP and WSDL, there's a nice SOAP library for python soaplib

Sign up to request clarification or add additional context in comments.

5 Comments

Thanks. Is there a way to invoke soap functions from bash command line, without having to write a python client program ?
I was thinking that CRUD was the definition of REST.
More than CRUD, a REST API should be compliant to HTTP methods. So, in the case of a calculation, a GET method is appropriate since it is retrieving a resource (which is not necessarily a database record).
About the command line, I'm not sure about it but you could give SOAP UI a go. It's a nice SOAP client
And just for sake of completeness, a really good SOAP consumer library is suds-jurko

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.