Skip to main content

WS-Discovery implementation for python

Project description

WS-Discovery in Python

This is WS-Discovery implementation for Python 2 & 3. It allows to discover services and to be discovered.

Authors and maintaining

Original version created by L.A. Fernando. Code was then forked and maintained by Andrei Kopats. Python3 port done by Pieter Jordaan. Packaging & major refactoring by Petri Savolainen. Python2 support fixes by Michael Leinartas.

Usage

A sample use of the module is shown below:

    from wsdiscovery import WSDiscovery, QName, Scope

    wsd = WSDiscovery()
    wsd.start()

    ttype = QName("abc", "def")

    ttype1 = QName("namespace", "myTestService")

    # Note: some devices scope services using onvif:// scheme, not http://
    scope1 = Scope("http://myscope")
    ttype2 = QName("namespace", "myOtherTestService_type1")
    scope2 = Scope("http://other_scope")

    xAddr = "localhost:8080/abc"
    wsd.publishService(types=[ttype], scopes=[scope2], xAddrs=[xAddr])

    #ret = wsd.searchServices(scopes=[scope1], timeout=10)
    ret = wsd.searchServices()

    for service in ret:
        print(service.getEPR() + ":" + service.getXAddrs()[0])

    wsd.stop()

Development state

This is not 100% complete and correct WS-Discovery implementation. It doesn't verify data received from the network. It may crash, and might contain security holes. No guarantees - test it carefully for your use case.

Changelog

1.0.0 (2018-12-18)

  • Improved packaging (petri)
  • Modularize & refactor (petri)
  • Better Python2 support (mleinart)

0.2 (2017-05-19)

  • First release @pypi (petri)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

WSDiscovery-1.0.0.tar.gz (14.7 kB view hashes)

Uploaded Source

Built Distributions

WSDiscovery-1.0.0-py3-none-any.whl (16.3 kB view hashes)

Uploaded Python 3

WSDiscovery-1.0.0-py2-none-any.whl (16.3 kB view hashes)

Uploaded Python 2

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page