Path: csiph.com!usenet.pasdenom.info!news.etla.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!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.001 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; 'logic': 0.09; 'try:': 0.09; 'variable,': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'burak': 0.16; 'wrote:': 0.18; 'thanks.': 0.20; 'team,': 0.22; 'cc:addr:python.org': 0.22; 'print': 0.22; '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; 'message-id:@mail.gmail.com': 0.30; 'work.': 0.31; 'saludos': 0.31; 'skip:? 20': 0.31; 'strip': 0.31; 'know.': 0.32; 'worked': 0.33; 'skip:& 30': 0.33; 'could': 0.34; 'received:google.com': 0.35; 'there': 0.35; 'method': 0.36; 'hi,': 0.36; 'url:org': 0.36; 'skip:& 10': 0.38; 'url:schemas': 0.38; 'how': 0.40; 'logs': 0.60; 'address': 0.63; 'skip:r 40': 0.68; 'skip:r 30': 0.69; 'received:mail-ob0-x22f.google.com': 0.84; 'faith': 0.91; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=Ek6boiui8OSWkM/kT3XDPvU8Aa5HLH1skBMudPyELmw=; b=voANsF3j3U26TTD9MsJwXjc4qSEBTo6OD0p5wLHSCvtco69yMbl6WalPo68USGGeVv vGxn8g5mbdB++FLqkvUoyEXAL+QRSm3N+rVqH50nfSOlaWFTsvhs8HKwiw5Fj5D7dShD rnBSNObn2Z6kF0EoetoN+f1Ib1eVjtjGjPszfk3J5CCXU/pyACkxFxdkYqJtmxieh7H1 UdViMUzpG4zzUk8dSyoxSzPnWDRoG1BURUUeGCfXBjVhUHrctfE4d7LAzDWeodUVBW+c QHO7/006nHEPset+M/0ihPozd3GyMADAl+SJIBQWpAVBj4WUKAEqHfb4f3f1ZhpdxfJ3 7lSA== X-Received: by 10.182.60.136 with SMTP id h8mr5060438obr.47.1366282032855; Thu, 18 Apr 2013 03:47:12 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <516F16FE.4080900@arskom.com.tr> References: <516F16FE.4080900@arskom.com.tr> From: Ombongi Moraa Fe Date: Thu, 18 Apr 2013 13:46:32 +0300 Subject: Re: Parsing soap result To: Burak Arslan Content-Type: multipart/alternative; boundary=001a11c1c4203b40e004daa053db 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: 166 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1366282042 news.xs4all.nl 2304 [2001:888:2000:d::a6]:51050 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:43817 --001a11c1c4203b40e004daa053db Content-Type: text/plain; charset=ISO-8859-1 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 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. > > 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 > > --001a11c1c4203b40e004daa053db Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hi Burak, Team,

Your solution wor= ked 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:
=20 =20 =20
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=3D"1.0" encoding=3D"utf-8" ?><soapenv:Envelope xmlns:soapenv=3D"http://schemas.xmlso= ap.org/soap/envelope/" xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance"= ;><soapenv:Body><ns1:gere xmlns:ns1=3D"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:Enve= lope>


If I assig= n the client.service.gere(ri) to a variable, i get the output on my screen:

result=3Dclient.service.gere(ri)

output:
[(DeliveryInformation){
=A0=A0 address =3D "254727"
=A0=A0 deliveryStatus =3D "DeliveredToNetwork"
=A0}]

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


--001a11c1c4203b40e004daa053db--