Can Swagger be used for SOAP?

2020-02-05 05:52发布

I was exploring Swagger and I must acknowledge I'm loving it.

I understand Swagger is primarily for RESTful web services, but I was wondering if we can make it work with SOAP web services as well. May be translate SOAP based web services to RESTful? Or simply call SOAP based services via Swagger UI? Some hack? Has anyone done it?

3条回答
兄弟一词,经得起流年.
2楼-- · 2020-02-05 06:29

Based on the present spec, I do not think so. It would not be easily possible to mention various aspects of a WSDL in swagger

To name a few:

  1. PortTypes
  2. Schemas and namespaces of request and response messages
  3. SOAP encodings (RPC/Literal etc.)
查看更多
劳资没心,怎么记你
3楼-- · 2020-02-05 06:29

This might be worth a try: Swagger connector and Preparing the API for consumption.

There is a module for pointing at a SOAP WSDL to expose it through a Loopback server: http://strongloop.com/strongblog/soap-into-rest-apis-with-loopback-node-js/

As an API server to glue existing and new data sources, LoopBack is designed to facilitate your backend data integration. With the release of loopback-connector-soap module, you can now easily consume SOAP web services and transform them into REST APIs.

I can't yet confirm that it works, but it looks like a way of exposing a SOAP service using Swagger.

查看更多
Emotional °昔
4楼-- · 2020-02-05 06:39

online "translate SOAP based web services to RESTful" is what exactly DreamFactory does. Open Source API management tool based on Swagger. Here you can read about SOAP-to-REST functionality.

查看更多
登录 后发表回答