GithubHelp home page GithubHelp logo

Soap 1.2 & WSDL 2.0 support about pyws HOT 7 OPEN

stepank avatar stepank commented on August 16, 2024
Soap 1.2 & WSDL 2.0 support

from pyws.

Comments (7)

superflit avatar superflit commented on August 16, 2024

need that !

from pyws.

stepank avatar stepank commented on August 16, 2024

sorry to say that, but i don't think i will be able to implement this feature in the nearest future (at least a year) as it requires a substantial amount of work and i just don't have enough time for it

from pyws.

auvipy avatar auvipy commented on August 16, 2024

whats the update?

from pyws.

auvipy avatar auvipy commented on August 16, 2024

How can I help?

from pyws.

stepank avatar stepank commented on August 16, 2024

sorry, but unfortunately pyws is not very high in my priorities now. i only do some support and bug fixes if it is necessary. if you decide to implement this feature yourself, i can provide some guidance

from pyws.

auvipy avatar auvipy commented on August 16, 2024

if you can provide me some guidance I will try to implement and send pull for review :)

from pyws.

stepank avatar stepank commented on August 16, 2024

Hello again,

Sorry for the late answer, I was moving to another country and it took virtually all my attention.

So, about SOAP 1.2 and WSDL 2.0 support.

First of all, a short notice about SOAP 1.1 support. When I implemented support of SOAP 1.1, my intention was to offer a simple way to expose APIs that would have very high interoperability with various SOAP clients. To meet this requirement, I had to implement a rather narrow subset of SOAP, but test it with as many SOAP clients as possible. I suggest using the same approach with SOAP 1.2.

Since I haven't ever worked with SOAP 1.2, but only with SOAP 1.1, to make things easier, I would try to mimic the behavior of one of the existing SOAP engines, for instance, Apache Axis 2. To do this I would:

  1. Set up a simple SOAP server with only one function - string concatenation. As far as I can tell, a good starting point is http://axis.apache.org/axis2/java/core/docs/quickstartguide.html. The result of this step should not be a server that can only receive requests and produce responses, but rather it should be a server that is also able to generate its description via WSDL.
  2. Generate a SOAP client from the WSDL of your service using one of the existing libraries. Since you are interested in a SOAP 1.2 server, I assume you have at least one such library in mind, what is it, by the way?
  3. Make them work together.
  4. Write an implementation of this service using pyws.

The last step is, of course, the longest and the most difficult:

  1. First, make sure that you can run all (or at least suds based) pyws tests, read more about it here - http://stepank.github.io/pyws/dev/running_tests.html. This will guarantee that you can run a test server without any problems.
  2. Then I suggest creating a new class, Soap12Protocol, in src/pyws/protocols/soap/__init__.py. You should probably derive it from SoapProtocol because they will have quite a lot in common.
  3. Override attributes name (set it to soap12) and namespaces. As far as I understand, the latter should have only one element http://www.w3.org/2003/05/soap-envelope.
  4. Extend class SoapServer in src/pyws/server.py so that it defines not only an instance of the existing SoapProtocol, but also an instance of Soap12Protocol.
  5. At this point, provided that you set up everything correctly, you will be able to run a test server (go to project_root/examples/_wsgi and run make run), and send requests and receive responses. SOAP 1.2 endpoint will be at http://localhost:8000/api/soap12.
  6. There is also a chance that the client you generated earlier will be able to work with this server. If not, make it so by fiddling with the code of Soap12Protocol.
  7. Make your server generate WSDL. To do this, override the get_wsdl function of Soap12Protocol and write it the way that it generates the same WSDL as you got from the Axis2 server. You might want to look at src/pyws/protocols/soap/wsdl.py for some inspiration as well. Now you should be able to make the earlier generated client understand the WSDL and work with your server (WSDL will be at http://localhost:8000/api/soap12/wsdl).
  8. Finally, you will have to add an automated test for all of this. How exactly you will do this will depend on the client you will use, so we can discuss it later. Some examples can be found here: https://github.com/stepank/pyws/tree/develop/tests. Note however, that without an automated test I will not merge your pull request because such tests are absolutely necessary to ensure interoperability.

If you walk through all of these steps, you will have one function working with strings only implemented. You will have to do this for all other types as well (integers, floats, dicts, lists etc), but it will become a bit easier because you will be quite familiar with the code.

If after reading this remark, you still decide to embark on this venture, you will, I assume, have a lot of questions. Don't hesitate to ask them either here or via my e-mail, I'll try to help as much as I can.

from pyws.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.