WebFault 'Version Mismatch'
by Philipp Kalder
Hello,
I'm trying to write a client for the Virtuozzo Containers 4 SOAP API. The
xml API is working for me, but I'm considering a rewirte. The SOAP API or at
least the WSDL files are quiet heavy.
The main file is:
http://www.swsoft.com/webservices/vzl/4.0.0/VZL.wsdl
You cannot use this file however. I'm parsing it to get the 'sublevel' WSDL
files, like
http://www.swsoft.com/webservices/vzl/4.0.0/VZLauthm.wsdl
After creating the client object I use set_options(location=""), because a
wild guess led me to believe that this way I can set the URL:port to query.
Usually the URL to send requests to would be listed in the WSDL file. But
here it's not.
After using set_options however print client look's just the same, but
running client.service reports a different error. First it's:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "build/bdist.linux-x86_64/egg/suds/client.py", line 539, in __call__
File "build/bdist.linux-x86_64/egg/suds/client.py", line 598, in invoke
File "build/bdist.linux-x86_64/egg/suds/client.py", line 623, in send
File "build/bdist.linux-x86_64/egg/suds/transport/https.py", line 64, in
send
File "build/bdist.linux-x86_64/egg/suds/transport/http.py", line 77, in send
File "build/bdist.linux-x86_64/egg/suds/transport/http.py", line 118, in
u2open
File "/usr/lib/python2.6/urllib2.py", line 389, in open
response = self._open(req, data)
File "/usr/lib/python2.6/urllib2.py", line 407, in _open
'_open', req)
File "/usr/lib/python2.6/urllib2.py", line 367, in _call_chain
result = func(*args)
File "/usr/lib/python2.6/urllib2.py", line 1154, in https_open
return self.do_open(httplib.HTTPSConnection, req)
File "/usr/lib/python2.6/urllib2.py", line 1121, in do_open
raise URLError(err)
urllib2.URLError: <urlopen error [Errno 111] Connection refused>
The second is:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "build/bdist.linux-x86_64/egg/suds/client.py", line 539, in __call__
File "build/bdist.linux-x86_64/egg/suds/client.py", line 598, in invoke
File "build/bdist.linux-x86_64/egg/suds/client.py", line 633, in send
File "build/bdist.linux-x86_64/egg/suds/client.py", line 684, in failed
File "build/bdist.linux-x86_64/egg/suds/bindings/binding.py", line 238, in
get_fault
suds.WebFault: Server raised fault: 'Version mismatch'
Following the second traceback upward it looks to me that I didn't even send
a call. Looking through the source code it look's as though the target
namespace's differ.
Does anybody know under which conditions the error:
suds.WebFault: Server raised fault: 'Version mismatch'
is raised? I'm clueless were to go from here. At the moment I'm still on
python's interactive shell, Version 2.6. Suds was installed from the tarball
(version 0.3.9) with
python setup.py install
(though the traceback look's that I should rather have used build copied it
;-) )
Any help is much appreciated. If details are missing, please accept my
apologies. Let me know and I'll send them in.
Regards,
Phil
P.S.:
The steps I do on interactive:
from suds.client import Client as sudsClient
client = sudsClient("
http://www.swsoft.com/webservices/vzl/4.0.0/VZLauthm.wsdl")
client.set_options(location="https://$vz_node_ip:$vzsoap_api_port")
client.service.get_realm()
P.S.S.: I thought of setting faults to false, but then I get another error
that seems to be related to some suds bug:
client.set_options(location="https://
$vz_node_ip:$vzsoap_api_port",faults=False)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "build/bdist.linux-x86_64/egg/suds/client.py", line 535, in __call__
File "build/bdist.linux-x86_64/egg/suds/client.py", line 598, in invoke
File "build/bdist.linux-x86_64/egg/suds/client.py", line 633, in send
File "build/bdist.linux-x86_64/egg/suds/client.py", line 684, in failed
File "build/bdist.linux-x86_64/egg/suds/bindings/binding.py", line 239, in
get_fault
AttributeError: Fault instance has no attribute 'detail'
13 years, 5 months
soapenc:array is being substituted
by Jason McKellar
I've got a WSDl that defines an array type:
<complexType name="ArrayOf_tns1_TenantServiceListInfo">
<complexContent>
<restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType"
wsdl:arrayType="tns1:TenantServiceListInfo[]"/>
</restriction>
</complexContent>
</complexType>
When I send a SOAP message to the server using Suds it sends this XML
for that type:
<in1 xsi:type="ns0:ArrayOf_tns1_TenantServiceListInfo"
ns3:arrayType="ns4:TenantServiceListInfo[1]">
<item xsi:type="ns4:TenantServiceListInfo">
<serviceListId xsi:type="ns4:ServiceListID">
<ownerId xsi:type="ns2:string">system</ownerId>
<serviceListName
xsi:type="ns2:string">busfeaturepack</serviceListName>
</serviceListId>
<tenantId xsi:type="ns2:string">demo</tenantId>
<totalLicenses xsi:type="ns2:int">1</totalLicenses>
</item>
</in1>
The problem is the server will not accept it unless xsi:type is set to
SOAP-ENC:Array
So I have tried creating the object using (ns0 is the soap encoding xmlns):
>>> slr = c.factory.create('ns0:Array')
>>> slr
(Array){
_arrayType = ""
_offset = ""
_id = ""
_href = ""
}
>>> slr.item = items
>>> slr
(Array){
_arrayType = ""
_offset = ""
_id = ""
_href = ""
item[] =
(TenantServiceListInfo){
serviceListId =
(ServiceListID){
ownerId = "system"
serviceListName = "busfeaturepack"
}
tenantId = "demo"
totalLicenses = 1
},
}
But this still sets the xsi:type to ns0:ArrayOf_tns1_TenantServiceListInfo
Is there some way to override this xsi:type overriding behaviour in Suds?
13 years, 6 months
Es not only to a greatly prolonged sojourn o
by Lanzillotti Gilreath
Horter path to still more sublime heights lies open to earnest
endeavour;
but what those heights may be in their case we can only conjecture. It
is of course only the lower fringe of this august body that need be
mentioned in connection
with our subject of the astral plane. Their three lower great divisions
(beginning from the bottom) are generally called Kamadevas, Rupadevas,
and Arupadevas respectively. Just as our ordinary body
here--the lowest body possible
for us--is the physical, so the ordinary body of a Kamadeva is the
astral; so that he stands in somewhat the same position as humanity will
do when it reaches
planet F, and he, living ordinarily in an astral body,
would go out of it to higher
spheres in a Mayavirupa just as we might in an astral
body, while to enter the Karana Sharira would be to him (when
sufficiently developed) no greater effort than to form a Mayavirupa is
to us. In the same way the Rupadeva's ordinary body would be the
Mayavirupa, since his habitat is on the four lower or rupa levels of
that spiritual state which we usually call Devachan:
while the Arupadeva belongs to the three higher levels of that plane,
and owns no nearer approach to a body
than the Karana Sharira. But for Rupa and Arupadevas
to manifest on the astral plane is an occurrence at least as rare as it
is for astral entities to materialize on this physical
plane, so we need do no more than mention them now. As regards the
lowest division--the Kamadevas--it would
be quite a mistake to think of all of them
as immeasurably superior to ourselves, since some have entered their
ranks from a humanity in some respects less advanced
than our own; of course the general average among them is much higher
than among us, for all that is actively or wilfully
evil has long been weeded out from their ranks; but they
differ widely in disposition,
and a really noble, unselfish, spiritually-minded man may well stand
higher in the scale of evolution than some of them. Their attention can
be
attracted by certain magical evocations, but the only human will which
can dominate theirs is that
of a certain high class of Adepts. As a rule they
13 years, 6 months
Handling faults from Axis web service
by Martin Aspeli
Hi,
I'm looking for a bit of clarity/expansion on the documentation for
handling of faults/exceptions in Suds.
We're connecting to a web service written in Axis. Right now, we only
have a WSDL file for this (which we're mocking up in SoapUI for test
purposes, though we also have an internal, Python-only mock of the
Suds service interface for unit testing purposes), i.e. we can't
connect to the service and test different responses just yet. We won't
be flying blind like this forever, but I want to make sure we don't
adopt a fundamentally wrong pattern until we get to the scheduled
integration testing.
The suds WebFault has two attributes: fault and document. It's not
quite clear to me what goes into these.
What I do know is that our WSDL has a complex type called
'SOAPException', which has an attribute 'message'. The developers of
the service are telling us that in certain error cases, they'll throw
an exception with an error code encoded into this 'message' attribute.
In an Axis client, that apparently throws an exception like this:
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server
faultSubcode:
faultString: 213
faultActor:
faultNode:
faultDetail:
{http://acme.com/}SOAPException:<message>213</message>
The bit we're interested in is the 213. So, we have code like this:
try:
response = client.service.someMethod()
except WebFault, e:
# ?
The question is how we get at that 213 in the 'e' that's returned. My
guess was e.fault.message, but that's mostly conjecture.
Thanks,
Martin
13 years, 6 months
Timezone-aware Datetime objects
by Daniel Rodriguez
Hi Jeff et al,
I was wondering what you and others think about always returning
timezone-aware datetime objects. The default timezone would be UTC (GMT).
If the user of the library knows that the default timezone for an object is
not UTC he can then use "replace" to change the timezone without changing
the fields.
I personally would see it as positive, since I find terrible to rebuild a
datetime object just to make the conversion from naive to timezone-aware.
Best regards
Daniel
13 years, 6 months
Uld have fallen into the soldiers' hands. Ha
by Belieu Maltba
Tter, you must be able to define her appearance by ten
adjectives, applicable to three portions of her person. For instance,
three things about her must be black, her eyes, her eyelashes, and her
eyebrows. Three must be dainty, her fingers, her lips, her hair, and
so forth. For the rest of this inventory, see Brantome. My gipsy girl
could lay no
claim to so many perfections. Her skin, though perfectly
smooth, was almost of a copper hue. Her eyes were set obliquely
in her head, but they were magnificent and large. Her lips,
a little full, but beautifully shaped, revealed a set of teeth as white
as
13 years, 6 months
. "Nothing particularly
by Tepezano Akimseu
plenty of light from a lot of
small dinky windows that faced on
three sides of the room. Owen had fixed it up in good taste in the
bargain.
He must have plenty of spending money, because there were lots of traps
around, from a pair of expensive snow shoes
hanging on the wall to a splendid toboggan tilted up
in a corner. "In fact, Hugh, the place was pretty well filled with boy
truck. It looked cozy to me, and I ought to know something about a
boy's den; haven't I arranged mine seven separate times,
until now it's back where I started? Well, of course, to please the old
gentleman, I walked around, and peeked at
things and told him Owen had as fine a loafing place as any boy in
Scrant
13 years, 6 months
Re: [Fedora-suds-list] Types not converting from a dict?
by Joshua J. Kugler
On Friday 26 March 2010, Jeff Ortel elucidated thus:
> On 03/26/2010 04:03 PM, Joshua J. Kugler wrote:
> > WSDL file:
> > https://adwords.google.com/api/adwords/cm/v200909/CampaignService?w
> >sdl
> >
> > This code:
> >
> > #ga_month_start/end are strings
> > #ga.Campaign is my 'client' object, dynamically finds the method,
> > etc. stats = ga.Campaign.client.get({'ids':[ga_campaign.id],
> > 'statsSelector':{
> > 'dateRange':{
> >
> > 'min':ga_month_start, 'max':ga_month_end }
> > }
> > })
>
> Strange. I ran:
>
> url =
> 'https://adwords.google.com/api/adwords/cm/v200909/CampaignService?ws
>dl' client = Client(url)
> print client
> d = {'ids':[0],
> 'statsSelector':{
> 'dateRange':{
> 'min':'xxx',
> 'max':'yyy'
> }
> }}
> client.service.get(d)
>
> And it worked fine (trunk, r665):
Creepy...I just tried it again, and it worked. Well, I guess I'm OK for
now....
Sorry for the noise.
j
--
Joshua Kugler
Part-Time System Admin/Programmer
http://www.eeinternet.com
PGP Key: http://pgp.mit.edu/ ID 0x73B13B6A
13 years, 6 months
Types not converting from a dict?
by Joshua J. Kugler
WSDL file:
https://adwords.google.com/api/adwords/cm/v200909/CampaignService?wsdl
This code:
#ga_month_start/end are strings
#ga.Campaign is my 'client' object, dynamically finds the method, etc.
stats = ga.Campaign.client.get({'ids':[ga_campaign.id],
'statsSelector':{
'dateRange':{
'min':ga_month_start,
'max':ga_month_end
}
}
})
Throws this error:
File "build/bdist.linux-i686/egg/suds/client.py", line 539, in
__call__
File "build/bdist.linux-i686/egg/suds/client.py", line 592, in invoke
File "build/bdist.linux-i686/egg/suds/bindings/binding.py", line 118,
in get_message
File "build/bdist.linux-i686/egg/suds/bindings/document.py", line 63,
in bodycontent
File "build/bdist.linux-i686/egg/suds/bindings/document.py", line 105,
in mkparam
File "build/bdist.linux-i686/egg/suds/bindings/binding.py", line 260,
in mkparam
File "build/bdist.linux-i686/egg/suds/mx/core.py", line 62, in process
File "build/bdist.linux-i686/egg/suds/mx/core.py", line 75, in append
File "build/bdist.linux-i686/egg/suds/mx/appender.py", line 102, in
append
File "build/bdist.linux-i686/egg/suds/mx/appender.py", line 243, in
append
File "build/bdist.linux-i686/egg/suds/mx/appender.py", line 182, in
append
File "build/bdist.linux-i686/egg/suds/mx/core.py", line 75, in append
File "build/bdist.linux-i686/egg/suds/mx/appender.py", line 102, in
append
File "build/bdist.linux-i686/egg/suds/mx/appender.py", line 243, in
append
File "build/bdist.linux-i686/egg/suds/mx/appender.py", line 182, in
append
File "build/bdist.linux-i686/egg/suds/mx/core.py", line 74, in append
File "build/bdist.linux-i686/egg/suds/mx/literal.py", line 87, in
start
suds.TypeNotFound: Type not found: 'max'
This code:
selector = ga.Campaign.client.factory.create('CampaignSelector')
selector.ids = [ga_campaign.id]
selector.statsSelector.dateRange.min = ga_month_start
selector.statsSelector.dateRange.max = ga_month_end
campaign_stats = ga.Campaign.client.get(selector)
Works fine, and produces the following selector, which is accepted by
the adwords API.
(CampaignSelector){
ids[] =
18657145,
campaignStatuses[] = <empty>
statsSelector =
(StatsSelector){
dateRange =
(DateRange){
min = "20100201"
max = "20100228"
}
StatsSelector.Type = None
}
paging =
(Paging){
startIndex = None
numberResults = None
}
}
I was sure I had this working before...Am I doing something wrong that I
don't see (which is what I suspect), or is Suds doing something wrong
with the type here?
By the way, this is suds/trunk revision 665.
j
--
Joshua Kugler
Part-Time System Admin/Programmer
http://www.eeinternet.com
PGP Key: http://pgp.mit.edu/ ID 0x73B13B6A
13 years, 6 months