mvantellingen / python-zeep

A Python SOAP client
http://docs.python-zeep.org
Other
1.9k stars 586 forks source link

should create_message require default service to be defined in wsdl? #833

Open fried-sausage opened 6 years ago

fried-sausage commented 6 years ago

Please provide the following information:

  1. The version of zeep: 3.1.0
  2. The WSDL you are using: https://www.onvif.org/ver10/events/wsdl/event.wsdl
  3. And most importantly, a runnable example script
    
    import zeep
    from zeep.cache import SqliteCache
    from zeep.transports import Transport

WSDL_LOCATION = 'https://www.onvif.org/ver10/events/wsdl/event.wsdl' ONVIF_SERVER = 'http://127.0.0.1:8787'

client = zeep.Client(WSDL_LOCATION, transport=Transport(cache=SqliteCache()))

event_service = client.create_service( '{http://www.onvif.org/ver10/events/wsdl}EventBinding', ONVIF_SERVER, )

print(event_service.GetEventProperties()) # this will work client.create_message(event_service, 'GetEventProperties') # this fails


This fails with `ValueError: There is no default service defined. This is usually due to missing wsdl:service definitions in the WSDL`

I explicitly created ServiceProxy object and passed it to Client.create_message, is it still necessary for service to be defined in wsdl?
fried-sausage commented 6 years ago

This can be bypassed with client._default_service = my_service_proxy_object