Thanks Jeff for your quick response.
I'm still trying to figure out SOAP and suds.
My request is supposed to look like this:
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
<scma:user-verified-media-request
xmlns:scma="http://services.bamnetworks.com/media/types/2.0">
<scma:event-id>164-251340-2009-03-12</scma:event-id>
<scma:subject>LIVE_EVENT_COVERAGE</scma:subject>
</scma:user-verified-media-request>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
But instead, it comes out looking like this:
<SOAP-ENV:Header/>
<SOAP-ENV:Body>
<ns0:user-verified-media-request>
<ns0:event-id>
<ns0:event-id>164-251340-2009-03-12</ns0:event-id>
<ns0:subject>LIVE_EVENT_COVERAGE</ns0:subject>
</ns0:event-id>
</ns0:user-verified-media-request>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
I have two questions.
1. I have included:
client.add_prefix('scma','http://services.bamnetworks.com/med...
request = client.factory.create('scma:UserVerifiedMediaRequest')
and yet the request still goes out as ns0: rather than scma:
2. How come event-id and subject are wrapped within another event-id?
Should I just try going with literal xml?
Thanks,
Matthew
Here's my source code so far:
import logging
logging.basicConfig(level=logging.INFO)
from suds.client import Client
logging.getLogger('suds.client').setLevel(logging.DEBUG)
url = 'http://www.mlb.com/flash/mediaplayer/v4/wsdl/MediaService.wsdl'
client = Client(url)
print client
client.add_prefix('scma','http://services.bamnetworks.com/med...
request = client.factory.create('scma:UserVerifiedMediaRequest')
print request
request.__setitem__('event-id','164-251340-2009-03-12')
request.__setitem__('subject','LIVE_EVENT_COVERAGE')
result = client.service.find(request)
print result