This chapter explains how to run pyws interoperability tests, for detailed description of the test bench, refer to Test bench. These tests can also be treated as examples of how different clients work with pyws.
You can run all the tests (except WS-I Basic Profile ones, about which read below) using one single command:
make
However, each set of tests has it own requirements, which you can learn below.
In any case we need a pyws server running, but all tests deal with it themselves, so don’t bother yourself with it and just keep reading.
Base directory is [pyws_dir]/tests/php.
Surely, we need to have PHP installed, I use PHP 5.3.6. We need to have PHPUnit installed as well, I use PHPUnit 3.6.9. To generate PHP classes from a WSDL file, I use my fork of wsdl2php project ( https://github.com/stepank/wsdl2php).
Running PHP tests is easy:
make
Note: I could not make native PHP SOAP client work with WSDL that is suitable for other clients, so a special version is generated (rpc=1 param is added to WSDL URL).
Base directory is [pyws_dir]/tests/java/axis.
Of course, we need to have Java installed, I use Java 1.6.0_23. We also need to have Apache Axis and JUnit4 installed, I use Apache Axis 1.4 and JUnit 4.8.2. Probably, you may also need to edit common.sh and change JAVA_DIR to the directory containing Java libraries. In my case it is /usr/share/java.
To run Java tests, again, just run:
make
Base directory is [pyws_dir]/tests/mono.
Of course, we need to have Mono SDK installed, I use 2.10.5. We also need NUnit installed, I use 2.5.10.
To run Mono tests, again, just run:
make
Base directory is [pyws_dir]/tests/python/suds.
We need to have suds and unittest2 installed.
You might have guessed:
make
This test checks if WSDL file generated by pyws is compliant with WS-I Basic Profile 1.1.
Base directory is [pyws_dir]/tests/java/ws-i/bp11.
Requirements are the same as for Axis integration tests, except that we don’t need JUnit.
Run the test:
make
It will download WS-I Test Tools (about 4MB) and generate report.xml file. All we have to do is to open it (for example, with Mozilla Firefox Web browser) and check the status in summary section. If there you see green passed, then it’s OK. In the case of problems, you can find further in the document some details about them, it would be great if you report them to me.
To clean generated report files:
make clean_report
This test checks if WSDL file generated by pyws is compliant with WS-I Basic Profile 1.2.
Base directory is [pyws_dir]/tests/java/ws-i/bp12.
Requirements are the same as for Axis integration tests, except that we don’t need JUnit, but we do need an XSLT 2.0 processor. I use Saxon B 0.9, if you use another one, you should specify it in xslt.sh in variable SAXON.
Run the test:
make
It will download WS-I Test Tools (about 6MB) and generate report.xml file. All we have to do is to open it (for example, with Mozilla Firefox Web browser) and check if there are any “failed” assertions. If there ain’t any, then it’s OK. Otherwise, you can find further in the document the causes of the failure and report them to me :). But I find it unlikely, I usually run this test too.
To clean generated report files:
make clean_report
In rare cases, a pyws server is not halted after the tests (have not figured why so far), so you’ll have to kill it yourself, this command might help:
ps ax | grep 'python __init__.py' | grep -v grep