Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'parameters': 0.04; 'skip:[ 20': 0.04; 'output': 0.05; 'assign': 0.07; 'soap': 0.07; 'string': 0.09; '<?xml': 0.09; 'try:': 0.09; 'variable,': 0.09; 'cc:addr :python-list': 0.11; 'python': 0.11; 'burak': 0.16; 'from:addr:arskom.com.tr': 0.16; 'from:addr:burak.arslan': 0.16; 'from:name:burak arslan': 0.16; 'message-id:@arskom.com.tr': 0.16; 'received:arskomhosting.com': 0.16; 'wrote:': 0.18; 'cc:addr:python.org': 0.22; 'print': 0.22; 'header:User-Agent:1': 0.23; 'file.': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'skip:" 20': 0.27; 'header:In-Reply-To:1': 0.27; 'work.': 0.31; 'skip:? 20': 0.31; 'strip': 0.31; 'know.': 0.32; 'there': 0.35; 'method': 0.36; 'hi,': 0.36; 'url:org': 0.36; 'url:schemas': 0.38; 'skip:x 10': 0.40; 'how': 0.40; 'logs': 0.60; 'address': 0.63; 'to:addr:gmail.com': 0.65; 'skip:r 40': 0.68; 'skip:r 30': 0.69; 'received:192.168.0.3': 0.84 Date: Thu, 18 Apr 2013 00:41:18 +0300 From: Burak Arslan User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130410 Thunderbird/17.0.5 MIME-Version: 1.0 To: Ombongi Moraa Fe Subject: Re: Parsing soap result References: In-Reply-To: Content-Type: multipart/alternative; boundary="------------030006080908060207070809" Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 131 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1366235349 news.xs4all.nl 2193 [2001:888:2000:d::a6]:48584 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:43782 This is a multi-part message in MIME format. --------------030006080908060207070809 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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. > > xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> xmlns:ns1="http://www.csapi.org/schema/parlayx/sms/send/v2_2/local">
254727
DeliveredToNetwork
> > > 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 --------------030006080908060207070809 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit
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

--------------030006080908060207070809--