Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #43817

Re: Parsing soap result

References <CAM6w3nq41KB=3HxgvJiay_u_xR-PQt4-J7BA=JFPeZ59w7LK1A@mail.gmail.com> <516F16FE.4080900@arskom.com.tr>
From Ombongi Moraa Fe <moraa.lovetakes2@gmail.com>
Date 2013-04-18 13:46 +0300
Subject Re: Parsing soap result
Newsgroups comp.lang.python
Message-ID <mailman.762.1366282042.3114.python-list@python.org> (permalink)

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

Hi Burak, Team,

Your solution worked perfectly thanks.

Could you share the logic of this solution?

Saludos

Ombongi Moraa Faith


On 18 April 2013 00:41, Burak Arslan <burak.arslan@arskom.com.tr> wrote:

>  On 04/17/13 16:50, Ombongi Moraa Fe wrote:
>
>  My
>
> client.service.gere(ri)
>
> method call logs the below soap response in my log file.
>
> <?xml version="1.0" encoding="utf-8" ?><soapenv:Envelope xmlns:soapenv="
> http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><ns1:gere
> xmlns:ns1="http://www.csapi.org/schema/parlayx/sms/send/v2_2/local
> "><ns1:result><address>254727</address><deliveryStatus>DeliveredToNetwork</deliveryStatus></ns1:result></ns1:gere></soapenv:Body></soapenv:Envelope>
>
>
>  If I assign the client.service.gere(ri) to a variable, i get the output
> on my screen:
>
> result=client.service.gere(ri)
>
> output:
> [(DeliveryInformation){
>    address = "254727"
>    deliveryStatus = "DeliveredToNetwork"
>  }]
>
>  string functions replace() and strip don't work.
>
> how do I use xml.etree.ElementTree to print the parameters address and
> deliveryStatus? Or is there a better python method?
>
>
> hi,
>
> try:
>
> result[0].deliveryStatus
>
> or
>
> result[0].DeliveryInformation.deliveryStatus
>
>
> and let us know.
>
> best,
> burak
>
>

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Parsing soap result Ombongi Moraa Fe <moraa.lovetakes2@gmail.com> - 2013-04-18 13:46 +0300

csiph-web