Giter Site home page Giter Site logo

python-ws-discovery's Introduction

WS-Discovery in Python

This is WS-Discovery implementation for Python 2 & 3. It allows to both discover services and publish discoverable services.

Usage

A simple wsdiscover command-line client is provided for discovering WS-Discovery compliant devices and systems. Run wsdiscover --help for usage instructions.

Here's an example of how to use the package in your Python code. The following code first publishes a service and then discovers it:

    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.

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 & command-line client by Petri Savolainen.

Python2 support fixes by Michael Leinartas.

python-ws-discovery's People

Contributors

andreikop avatar climax777 avatar hlamer avatar hunterjm avatar jordiolivares avatar mleinart avatar petri avatar scop avatar

Watchers

 avatar

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.