Problem getting object as response
by Alessandro Pisa
Hello everibody!
I have a problems in getting a response as an object after calling a a service method.
The code is the following:
from suds.client import Client
wsdl = 'http://wwwservizitest.regione.emilia-romagna.it/WebServices/GSA/GlobalGSA...'
client=Client(wsdl)
service = client.service
query = {'query' : 'test'}
response = service.GetRisultatiRicerca(**query)
Calling type(response) returns me <class 'suds.sax.text.Text'>.
Printing it just outputs an xml valid according to the schema given by another service method:
service.GetSchemaRisultato()
Does anybody has an idea about using this schema to transform the Text in to an object using this schema?
Thanks in advance for your attention.
--
Alessandro Pisa - RedTurtle Technology
E-mail: alessandro.pisa(a)redturtle.net
Web Site: http://www.redturtle.net
Phone: +39 0532 1915958
13 years, 3 months
Rappel : Abdelhafid Gharbili vous a invité à rejoindre Facebook...
by Facebook
=======================================
Pour vous inscrire à Facebook, suivez le lien ci-dessous :
http://www.facebook.com/r.php?re=e1cd657953b8d76cde0d5d79c44e9202&mid=291...
=======================================
Bonjour,
La personne suivante vous a envoyé une invitation sur Facebook :
Abdelhafid Gharbili (Invite sent: May 27, 2010)
D'autres personnes que vous connaissez peut-être sur Facebook.
Matthew Levine
Thierry Schellenbach
Mohamed Lrhazi
Nathan Van Gheem
Cameron Morrison
Bryan Hughes
Facebook est le lieu idéal pour rester en contact avec vos amis, publier vos photos et vidéos, et créer des évènements. Mais vous devez d'abord vous inscrire ! Créez un compte dès aujourd'hui pour mieux communiquer avec les gens que vous connaissez.
Merci,
L'équipe Facebook
Already have an account? Add this email address to your account http://www.facebook.com/n/?merge_accounts.php&e=fedora-suds-list%40redhat....
Pour vous inscrire à Facebook, suivez le lien ci-dessous :
http://www.facebook.com/r.php?re=e1cd657953b8d76cde0d5d79c44e9202&mid=291...
=======================================
Ce message a été envoyé à fedora-suds-list(a)redhat.com. Si vous ne voulez plus recevoir ce type de messages de la part de Facebook, veuillez cliquer sur le lien ci-dessous pour annuler votre inscription.
http://www.facebook.com/o.php?k=07714d&u=100001143801959&mid=2919546G5af3...
Facebook, Inc. P.O. Box 10005, Palo Alto, CA 94303
13 years, 3 months
Gzip compression
by Daniel Rodriguez
Hi Jeff et al,
If I am not wrong (I may have missed a configuration option), suds is not
using or requesting gzip compression.
I have added a few lines and tested at least requesting and accepting gzip
compression. My changes have been trivial and this could be possibly added
as an option to suds.
The changes I have made (against 3.9):
*File*: suds/transport/http.py:
*
*
*Extra imports*:
import gzip
import StringIO
*Class*: HttpTransport
*Method*: send
*Added:*
After:
- headers = request.headers
added the following line
- headers.update([('Accept-Encoding', 'gzip')])
*Changed:*
- result = Reply(200, fp.headers.dict, fp.read())
to
- replydata = fp.read()
- for header in fp.headers.dict.keys():
- if header.lower() == 'content-encoding' and
fp.headers.dict[header] == 'gzip':
- replydatacompressedstream = StringIO.StringIO(replydata)
- gzipper = gzip.GzipFile(fileobj=replydatacompressedstream)
- replydata = gzipper.read()
- result = Reply(200, fp.headers.dict, replydata)
Best regards
Daniel
13 years, 3 months
Undelivered Mail Returned to Sender
by Mail Delivery System
This is the mail system at host mcs.dtdc.com.
I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.
For further assistance, please send mail to <postmaster>
If you do so, please include this problem report. You can
delete your own text from the attached returned message.
The mail system
<branchpnq.camp_MCS/DTDC(a)dtdc.com>: host 10.10.2.14[10.10.2.14] said: 554
Mailaddress is administratively disabled. (#5.2.1) (in reply to RCPT TO
command)
13 years, 3 months
Fwd: Help getting Gzip encoded responses working
by Daniel Rodriguez
Hi Paul,
I had a look at what I guess you posted in ticket 320.
You seem to be do logging because the code (according to what you posted)
fails when trying to log the request that is about to be sent.
The code is failing at suds/transport/__init__.py
def __str__(self):
s = []
s.append('URL:%s' % self.url)
s.append('HEADERS: %s' % self.headers)
s.append('MESSAGE:')
s.append(self.message)
--> return '\n'.join(s) <-- FAILING HERE
Which is surprising given that list "s" has been created on the stack.
I tried the following code snippet and it works:
s = []
print '\n'.join(s)
This really seems to have nothing to do with gzip itself.
Could you provide any more info?
Best regards
Daniel
On Wed, Jun 23, 2010 at 11:20, <paul(a)kilgobnet.com> wrote:
> Hi,
> I've a ticket open here: https://fedorahosted.org/suds/ticket/320explaining the problems I'm having getting SUDS to work with Gzip encoded
> rexponses.
> If anyone has any experiance getting this working could you take a look
> and spot where I'm going wrong please.
>
> Thanks,
>
> Paul
>
> _______________________________________________
> suds mailing list
> suds(a)lists.fedoraproject.org
> https://admin.fedoraproject.org/mailman/listinfo/suds
>
13 years, 3 months
My Slackness
by Jeff Ortel
All,
I've been slammed with my regular Red Hat duties which must take priority over my suds
work. As a result, I've gotten pretty far behind on the mailing list and tickets. My
apologies. Don't interpret this as a lack of interest or dedication to the suds project.
I fully intend to get caught up and continue to move the project forward.
The 0.4 release is mostly ready to go out but I'm not completely happy with the 'plugins'
API. I can either release as is with the caveat that it /may/ change. Or, I can wait and
get it the way I want it first.
Thanks for your patience and continued interest in suds.
Regards,
Jeff
13 years, 3 months
Xin cam on - Da nhan duoc thu / Thanks.
by Cong ty Luat Hop Phat
Chung toi da nhan duoc thu cua ban, chung toi se tra loi som.
Tran trong kinh chao.
Moi chi tiet lien he
Luat su Hung
Cong ty LUAT HOP PHAT
Dien thoai: 08.35040413 - 090.27.14.123
Dia chi: 344/6 Nguyen Duy Duong, P.9, Q.10, TPHCM
Email: tvpl(a)tuvanphapluat.com Website: www.tuvanphapluat.com
----------------------------------------------------------------
Chuyen: Tu van Doanh nghiep - thuc hien cac dich vu phap ly - tham gia bao chua, bao ve quyen loi, tranh tung -Nhat dat, thua ke - Lam luat su rieng,... va cac ho so phap ly khac.
13 years, 3 months
Array of complex type weirdness
by Martin Aspeli
Hi,
I have a soaplib server (emulating a Java server) which does this:
from soaplib.serializers.primitive import String, Integer, DateTime,
Array, Fault
from soaplib.serializers.clazz import ClassSerializer
from soaplib.service import SoapServiceBase
from soaplib.service import soapmethod
class Transaction(ClassSerializer):
class types:
cost = Integer
purchaseDate = DateTime
status = Integer
class HistoryResponse(ClassSerializer):
class types:
transactions = Array(Transaction)
totalRecords = Integer
class TransactionService(SoapServiceBase):
@soapmethod(String, Integer, DateTime, DateTime, Integer,
_returns=HistoryResponse)
def getHistory(self, tokenId, status, dateFrom, dateTo, pageId):
transactionsList = createAPythonListOfTransactionObjects()
response = HistoryResponse()
response.transactions = transactionsList
response.totalRecords = 1000
In Suds (in another process), when I get back the results from calling
getHistory(), the return value prints like this:
(HistoryResponse){
totalRecords = 1000
transactions =
(TransactionArray){
_type = "tns:TransactionArray"
Transaction[] =
(Transaction){
purchaseDate = 2010-02-28 12:00:00
cost = 1500
status = 8
},
(Transaction){
purchaseDate = 2010-02-28 12:00:00
cost = 1200
status = 2
},
}
}
To loop over transactions, I have to do:
for item in response.transactions.Transaction:
...
Which is pretty awkward. I also suspect that this may not always be
necessary, as we had some other mocks going with SoapUI where it was
sufficient to iterate over response.transactions directly.
Am I doing something wrong?
Cheers,
Martin
13 years, 3 months
Getting xml attributes
by Edwin Vane
I have the following bit of XML that was generated by a remote
exception on a JIRA server:
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soapenv:Body>
<soapenv:Fault>
<faultcode>soapenv:Server.userException</faultcode>
<faultstring>com.atlassian.jira.rpc.exception.RemotePermissionException:
Remote custom fields can only be retrieved by an
administrator.</faultstring>
<detail>
<com.atlassian.jira.rpc.exception.RemoteException
xmlns:ns1="http://exception.rpc.jira.atlassian.com"
xsi:type="ns1:RemotePermissionException"/>
<ns2:hostname
xmlns:ns2="http://xml.apache.org/axis/">myhost.com</ns2:hostname>
</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
The WebFault.fault.detail is then:
(detail){
com.atlassian.jira.rpc.exception.RemoteException = ""
hostname = "myhost.com"
}
What I'm really interested in is the xsi:type of the first entry under
<detail>. Is it possible to get this with suds?
--
Edwin V
13 years, 3 months