suds.WebFault: Server raised fault: 'Error in JiBX marshalling' ??
by Matthew
Can you tell me what this error might mean? I realize this isn't the suds code generating this error but perhaps you might be more informative than my google search.
At the very least, I'd like to generate an error message to the user that's a bit more helpful than this.
Thanks,
Matthew
14 years, 6 months
namespaces and schemas
by Matthew
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/media/types/2.0')
> 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/media/types/2.0')
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
14 years, 6 months
how to set a hyphenated field in client request?
by Matthew
Hi,
The quick summary is there is a field in a SOAP request named, "event-id", and I'm having trouble setting this field because the name contains a hyphen. How do I get around this? For example:
>>> result = client.factory.create('ns0:UserVerifiedEvent')
>>> print result
(UserVerifiedEvent){
event-id = None
user-verified-content[] = <empty>
domain-specific-attributes =
(MediaAttributes){
domain-attribute[] = <empty>
}
}
Here's more background.
I'm trying to develop an MLB.tv client for Linux and they've changed their web service to a SOAP architecture.
A little snooping and I was able to find that the first request sends an event-id and the response has a listing of all media content matching that event-id.
The request looks 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>
Here's the wsdl:
>>> import suds
>>> from suds.client import Client
>>> url = 'http://www.mlb.com/flash/mediaplayer/v4/wsdl/MediaService.wsdl'
>>> client = Client(url)
>>> print client
Suds ( https://fedorahosted.org/suds/ ) version: 0.3.5 (beta) build: R483-20090324
Service ( MediaService2_0 ) tns="http://services.bamnetworks.com/media/2.0"
Prefixes (1)
ns0 = "http://services.bamnetworks.com/media/types/2.0"
Ports (1):
(MediaService2_0SOAP11port_http)
Methods (1):
find(xs:string event-id, xs:long content-id, xs:string playback-scenario, xs:string subject, xs:string ip-address, ns0:CreditCard credit-card, ns0:IdentityPoint fingerprint-identity-point, xs:string session-key, )
Types (28):
ns0:Address
ns0:AudioTrack
ns0:AuthStatus
ns0:BlackedOutStatus
ns0:BlackoutKeywords
ns0:BlackoutStatus
ns0:CreditCard
ns0:Entitlements
ns0:IdentityPoint
ns0:LocationCannotBeDeterminedStatus
ns0:LoginRequired
ns0:MediaAttribute
ns0:MediaAttributes
ns0:MediaItem
ns0:MediaUserLocation
ns0:NotAuthorizedStatus
ns0:PreviewStatus
ns0:ResponseStatusCode
ns0:SessionKey
ns0:SignOnRestrictionStatus
ns0:SuccessStatus
ns0:SwarmcastKeyGenResponse
ns0:SwarmcastKeyStatusCode
ns0:UserVerifiedContent
ns0:UserVerifiedEvent
ns0:UserVerifiedMediaItem
ns0:UserVerifiedMediaRequest
ns0:UserVerifiedMediaResponse
Now, I'm still trying to learn SOAP, WSDL, and suds, but somehow I need to set the event-id. I thought maybe I needed to create a UserVerifiedEvent so I tried that but I'm stumped at how to set a value to event-id because of the hyphen.
>>> result = client.factory.create('ns0:UserVerifiedEvent')
>>> print result
(UserVerifiedEvent){
event-id = None
user-verified-content[] = <empty>
domain-specific-attributes =
(MediaAttributes){
domain-attribute[] = <empty>
}
}
>>> result.event-id = '164-251340-2009-03-12'
SyntaxError: can't assign to operator
Any ideas?
Thanks,
Matthew Levine
https://sourceforge.net/projects/mlbviewer/
14 years, 6 months
Parsing SOAP headers in reply message
by David Yu
Hi,
First, thanks Jeff providing so fancy utility for accessing SOAP web
service. :)
Currently I am interested in reply SOAP header,
and also want to know will it be provided in 0.3.5? So that the
functionality will be more complete.
Thanks!
David
14 years, 6 months
Adding attribute to the SOAP-ENV:Envelope start tag
by Stangeby, David
Hi,
I need to add the attribute
"SOAP-ENV:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'" to
the start tag "SOAP-ENV:Envelope" in the xml that gets sent to the soap
service. The service requires it. But I can't seem to figure out how to
do it without hacking the libraries.
It works correctly when I manually enter the xml that gets sent using
the __inject option when calling the method.
Is there some function and adds this to the request xml before sending
it?
Med vennlig hilsen/Kind regards
David Stangeby
Avaya R&D Lab Ventelo
14 years, 6 months
Document Imaging/Scanning to eliminate paper problems
by Shane Hunt
Records Reduction, Inc. has been providing document
imaging/scanning services throughout the Southeast US since 1998.
We provide following services:
* File pickup
* Prepping files - removing staples, unfolding paper, moving
sticky notes, etc.
* Scan files (saved to PDF or Tif)
* Index documents for easy retrieval
* OCRing available for full text searching
* Images returned on disc or uploaded to web for retrieval
* Shredding files
And we provide these services for much less than the large,
national companies!
Benefits of Document Imaging/Scanning
* Recover Valuable Office Space
* Find any file within seconds
* Eliminate Lost Files
* Save money on costly file cabinets, paper, copying, filing time
* Increase worker productivity
Benefits of Outsourcing
* You do not have to purchase and maintain expensive imaging
equipment
* You do not have to spend time prepping and scanning
documents
* Provide a backup CD for offsite storage
* Proven quality process already in place
* Experts in digital storage and retrieval
* We'll do EVERYTHING for you - box the files, scan them,
index them, etc. We make your life easier!
* We have many real world examples proving we can scan
cheaper than you can in house. It's basic Business 101. We
buy the best software and scanners on the market. This
gives us extreme efficiencies and speed - which means less
money to you!
* We require no commitment. If you don't like our services,
quit using us. You lose nothing for trying!
Please respond with your Name, Company Name & Address and we will
send you a FREE Sample Imaging CD and Document Imaging Report.
There are no strings attached to this offer. It's simply the
most effective way to show you how you can save time, space &
money using our document management services.
Call or email to get more information, or to schedule an
appointment. We will scan in a sample at no charge.
Shane Hunt
704-724-3313
shunt(a)recordsreduction.com
PO Box 3322, Matthews, NC 28106
http://app.streamsend.com/private/tF8d/2bm/qG6rTab/unsubscribe/3353212
14 years, 6 months
Suds caching
by Jeff Ortel
All,
PERFORMANCE:
As of revision 473+ ,0.3.5 (beta), suds provides page caching. The caching only pertains
http (GET) of URLs not associated with WS method invocation. Pages such as WSDLs and
XSDs are cached. This really helps performance for those of you creating lots of clients.
Also, it will really help with any service using rpc/encoded since rpc/encoded wsds
commonly imports the encoding schema lots of times.
Anyone using a custom transport will not get the caching since it is implemented in the
default HttpTransport.
More info here: https://fedorahosted.org/suds/wiki/TipsAndTricks#Performance
TRANSPORT
Also, this commit has some refactoring of transport.py. This module was refactored into a
package. This should not affect anyone building custom transports since:
>
> from suds.transport import Transport, Request
>
works just the same as before.
However, if you have subclassed either HttpTransport or HttpAuthenticated you will have to
change your imports. Sorry.
Another notable change is Transport.send() has been changed to return a Reply object
instead of the page content.
Also, the client.SoapClient was setting the transport.Request.message as a sax Element and
getting away with it because the HttpTransport.send() was doing str(request.message). But
no longer. So, your custom transports should expect transport.Request.message to be a string.
Regards,
Jeff
14 years, 6 months
you must all hate me by now, but...how do you get http header logging info?
by David Bunch
Hey everyone, firstly, I want to thank you Jeff, for being so patient with
me, and the quick turn around on that bug. You rock, and your client
rocks! Secondly,
does anyone know how you can log http headers that are sent and recieved?
the documentation says that to log sent and received soap/http headers
simply add these lines to the top of your code:
import logging
logging.basicConfig(level=logging.INFO)
logging.getLogger('suds.client').setLevel(logging.DEBUG)
However this only logs soap headers and soap messages not http headers.
14 years, 6 months
setting a cookie
by David Bunch
Is this not the correct way set a cookie in suds?
# Create session cookie.
oizysSessionCookie = cookielib.Cookie(version=None,
name="ASP.NET_SessionId",
value=self.loginCredentials.session_id,
port="8082",
port_specified=False,
domain="127.0.0.1",
domain_specified=True,
domain_initial_dot=False,
path="ISTSessionId",
path_specified=True,
secure=False,
expires=None,
discard=True,
comment=None,
comment_url=None,
rest=None)
# Add cookie to clients
commandClient = Client(commandUrl)
commandClient.options.transport.cookiejar.set_cookie(oizysSessionCookie)
monitorClient = Client(monitorUrl)
monitorClient.options.transport.cookiejar.set_cookie(oizysSessionCookie)
14 years, 6 months