Client pickling
by Matt C
All: I see that a most useful looking patch has been submitted for pickling
the client. Has anyone tried the patch? Jeff - do you have a feel for the
likelihood of adding this into the package at this point?
-Matt
13 years, 10 months
MTOM attachment support
by Ajai Joy
I have been able to wire attachments using base64 encoding, I was wondering
if we had any kind of MTOM support / samples etc using suds.
--
Best Regards,
Ajai Joy
13 years, 10 months
Od's Word. One such recently sought ordination, a
by Dietzel
Mith, Public Library, Riverside. NEVADA. WOMAN'S MISSIONARY UNION.
President--Mrs. L. J. Flint, Reno. Secretary--Miss Margaret N. Magill,
Reno. Treasurer--Miss Mary Clow, Reno. UTAH (including Southern Idaho).
WOMAN'S MISSIONARY UNION. President--Mrs. Clarence T. Brown, Salt Lake
City, Utah. Secretary--Mrs. W. S. Hawkes, 135 Sixth St., E., Salt Lake
City, Utah. Treasurer--Mrs. Dana W. Bartlett, Salt Lake City, Utah.
Secretary f
13 years, 10 months
XML literal within an element
by Janne Kuuskeri
Hi,
I have the following pretty simple WSDL:
http://195.165.67.126/XmlUploadWebService/Service.asmx?WSDL
From that definition I have to use the AddOrder function which takes
one parameter (of type any):
<s:element name="AddOrder">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="document">
<s:complexType mixed="true">
<s:sequence>
<s:any/>
</s:sequence>
</s:complexType>
</s:element>
</s:sequence>
</s:complexType>
</s:element>
Actually, in that parameter, I have to pass contents of an XML file as a
string. This is the code I'm using for that (as suggested by
https://fedorahosted.org/suds/wiki/TipsAndTricks#IncludingLiteralXML):
from suds.sax.parser import Parser
p = Parser()
xml = p.parse('order_sample.xml')
client = Client(WSDL_URL)
result = client.service.AddOrder(document=xml)
The problem is that when the parsed xml document is written into soap
envelope by the SUDS it leaves out the xml namespace binding from the
root element (the xmlns attribute), and that causes XML validation
errors on the (3rd party) server. For example:
original XML root element:
<Orderinfo xsi:noNamespaceSchemaLocation="order_schema_v2.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
the one that SUDS writes within the 'document' element:
<Orderinfo xsi:noNamespaceSchemaLocation="order_schema_v2.xsd">
It also leaves out the <?xml version="1.0" encoding="utf-8"?> from the
beginning but I'm not sure if this causes any problems.
Is there a simpler way to include a string literal (which won't get
escaped) in the element? Or some other way to work around this?
Many Thanks
13 years, 10 months
Caching Enhancements
by Jeff Ortel
All,
I finished and (committed r637) enhancements to the suds caching. The previous approach
added caching to the Transport layer and was causing some problems. It /blindly/ cached
downloaded XML documents such as WSDLs and imported XSD files as XML text. The next time
the document is needed (at the same URL), the transport returned the local (cached) copy
of the XML file and it was SAX parsed as if it was downloaded via http. This actually
saved a lot of time because most servers returned these documents very slowly is many
cases. The problems with this approach are:
- Corrupt, incomplete or otherwise invalid XML document text was being
cached because the Transport layer was not content aware. It simply cached
whatever it downloaded.
- Invalid cache files caused SAX parsing exceptions until the cache file
expired or the user cleared the cache.
- Cached files had to be SAX parsed every time the were retrieved.
The approach taken by the r637 enhancement puts caching above the Transport layer and at
the Document Processing layer. By doing this, suds is now caching sax.document.Document
objects using python pickle. This ensures that cached XML documents are valid and allows
for proper handling of corrept, incomplete or otherwise invalid cached files. In the
event that a cached file fails to load, the document processing layer simply uses the
transport to download a good copy which is then SAX parsed and cached.
I benchmarked the performance difference between sax parsing and unpickling a 2M XML file
using cPickle. In most cases, I observed a ~2x performance gain using pickle.load() over
sax parsing. Yeah, I'm a little surprised too. I expected about a ~10x gain but at least
it's significantly better.
I tried really hard to preserve backwards compatibility but some minor things did have to
change. These things should not affect most users:
- The caching classes (Cache, FileCache, NoCache) moved from the suds.transport package
to a suds.cache.py module.
- All caching has been removed from the Transport classes.
- The get() & put() methods on the Cache interface have changed slightly to be
document oriented instead of file pointer (fp) or file-like oriented.
- Users disabling the cache using /NoCache/ should switch to the already
existing: Client(url, cache=None) syntax. Or, import NoCache from the suds.cache.
- Users implementing their own caches need to adapt to the changes to the
Cache interface.
I plan to continue toward caching the entire WSDL (wsdl.Definitions) object but this is a
good interim step and solves most of the caching problems for now.
This has been released in 0.3.9 beta which I believe to be very stable.
Hope this helps.
Regards,
Jeff
13 years, 11 months
mething he wished to say,
by Sweeting Deming
him with sticks of firewood, trying to rope him with the steel hawser.
On the bridge Captain Jensen and Anfossi were giving orders in Danish
and Italian, and on the bank I swore in American. Everybody shoved and
pushed and beat at the great bulk, and the great bulk rolled steadily
on. We might as well have tried to budge the Fifth Avenue Hotel. He
reached the bank, he crushed it beneath him, and, like a suspension
bridge, splashed into the water. Even then, we who watched him thought
he would stick fast between the boat and the bank, that the hawser would
hold him. But he sank like a submarine, and we stood gaping at the muddy
water and saw him no more. When I recovered from my first rage I was
glad he was still alive to float in the sun and puff and blow and open
his great jaws in a luxurious yawn. I could imagine his joining his
friends after his meeting with us, and remarking in reference to our
bullets: "I find the mosquitoes are quite bad this morning." With this
chapter is published the photograph Anfossi took, from the deck of the
steamer, of our hippo--the hippo that was too stupid to know when he was
dead. It is not a good photograph, but of our hippo it is all we have to
show. I am still undecided whether to hang it in the hall or the
dining-room. [Illustration: The Hippopotamus that Did Not Know He Was
Dead.] The days I spent on my trip up the river were of delightful
sameness, sunshine by day, with the great panorama drifting past, and
quiet nights of moonlight. For diversion, there were many hippos,
crocodiles, and monkeys, and, though we saw only their tracks and heard
them only in the jungle, great elephants. And innumerable strange
birds--egrets, eagles, gray parrots, crimson cranes, and giant
flamingoes--as tall as a man an
13 years, 11 months
Handling Exceptions generated on Server, but there is no WebFault
by geoff
Hi I am working trying to work with a WebService that I know is based
on Microsoft tech. I can connect to the service fine, I can query it,
however, when I use a method on the server and it produces a exception
on the service it passes silently, althought the servers exception is
shown as a string in the return from the method I an trying to
consume.
result = myclient.service.DoMethod(string)
print result
>>> ' s:MyService.Services.Exceptions.Entity.ValidationException'
If I build the client as;
myclient = Client(acctsvc, transport = ntlm, faults = False)
result = myclient.service.DoMethod(string)
print result
>>> (200, s:MyService.Services.Exceptions.Entity.ValidationException)
Is this some additional documentation I can provide to that would help
someone understand when this exception isn't getting turned into a
WebFault and being recognized by the subs client ?
g.
13 years, 11 months
te independence: Duke
by Grosso
Ion of the portraits is very rude, particularly that of the twelve
earliest, whose busts are represented. The artist has contented himself
with exhibiting the heads only, of the remaining nine. Common tradition
refers the whole of these portraits to the time of Odo; but it is hardly
necessary to observe, that the groined and pointed vaulting is
subsequent to his date.--Bayeux cathedral abounded in works of this
description of art: the walls of the chapels of the choir were covered
with large fresco-paintings, now nearly obliterated.--It is believed,
and with every appearance of probability, that the Lady-Chapel was
erected at a time posterior to the rest of the building; but there is no
certain account of its date. Before the revolution, it served as a
burial-place for some of the bishops of the see, and for a duke of the
noble family of Montemart. Their tombs ornamented the chapel, which now
appears desolate and naked, retaining no other of its original
decorations, than a series of small paintings, which represent the life
of the Holy Virgin, and are deserving of some attention from the
character of expression in the faces, though the drawing in general is
bad. Over the altar is a picture, in which an angel is pointing out our
Savior and the Virgin to a dying man, whose countenance is
admirable.--The stalls of the choir display a profusion of beautiful oak
carving; and beneath them are sculptured _misereres_, the first whi
13 years, 11 months