Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
fried-sausage opened this issue Oct 2, 2018 · 1 comment · May be fixed by #1427
Open

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

fried-sausage opened this issue Oct 2, 2018 · 1 comment · May be fixed by #1427

Comments

@fried-sausage
Copy link

fried-sausage commented Oct 2, 2018

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
Copy link
Author

This can be bypassed with client._default_service = my_service_proxy_object

ffrank pushed a commit to ffrank/python-zeep that referenced this issue Sep 11, 2024
Even though the Client.create_message function expects a service
parameter, this service was not passed on to the SOAP implementation.
The SOAP binding would invariably use the default service in the client
object, and raise an exception if it was not found.

Fix this by adding an optional service parameter to the
SoapBinding.create method as well.

Fixes mvantellingen#833
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant