Wrapping a SOAP API in REST

694 views
Skip to first unread message

Tharshan

unread,
Feb 11, 2015, 7:43:56 AM2/11/15
to django-res...@googlegroups.com
Hi, 

I was hoping this group could give me some advice on what the best way to approach wrapping a SOAP API through DRF and expose the resources found in the SOAP Schemas as REST endpoints. One of the issues is the creation of the classes and fields required for a each resource. Is there a way to generate classes by parsing the XML Schema of the SOAP API? Would you write a serialiser that translated back and forth between XML? To send the response in XML but also to receive a response in XML but send it back to the client as JSON.

Any ideas or suggestions are welcome.

Thanks

Marcos Dione

unread,
Oct 26, 2016, 5:18:40 AM10/26/16
to Django REST framework
On Wednesday, February 11, 2015 at 1:43:56 PM UTC+1, Tharshan wrote:
I was hoping this group could give me some advice on what the best way to approach wrapping a SOAP API through DRF and expose the resources found in the SOAP Schemas as REST endpoints. One of the issues is the creation of the classes and fields required for a each resource. Is there a way to generate classes by parsing the XML Schema of the SOAP API? Would you write a serialiser that translated back and forth between XML? To send the response in XML but also to receive a response in XML but send it back to the client as JSON.

    I have a similar problem, I'll be providing an API that uses another RESTful API as its backend, but with semantics more useful to our organization. So far what I'm doing is to do the requests directly in the ViewSet, but not having any Model or Serializer, Should I create a custom DB backend, or is DRF not aimed at such type of projects?

Jani Tiainen

unread,
Oct 26, 2016, 6:31:12 AM10/26/16
to django-res...@googlegroups.com

Hi,

You're really trying to mix apples and oranges.

SOAP, is it says is "simple object access protocol" which is mainly meant to do RPC calls.

Now RESTful is just an architecture.

You just need to map several RPC calls to REST calls and you're done.

Calling SOAP from Python isn't easy task since depending on end SOAP point some libs do work better than other.

And in worst case I've seen so poorly generated SOAP that none of the Python SOAP libs couldn't talk to that.

So you have to think SOAP being something that you just call like functions in Python to return you some data. Which you then transform in proper format with DRF.
--
You received this message because you are subscribed to the Google Groups "Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-rest-fram...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
Jani Tiainen
Reply all
Reply to author
Forward
0 new messages