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


Groups > comp.lang.python > #107419

Xlms namespace

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From Joaquin Alzola <Joaquin.Alzola@lebara.com>
Newsgroups comp.lang.python
Subject Xlms namespace
Date Wed, 20 Apr 2016 09:28:37 +0000
Lines 41
Message-ID <mailman.35.1461171872.12923.python-list@python.org> (permalink)
References <HE1PR07MB135631A22E59C1644F33C569F06D0@HE1PR07MB1356.eurprd07.prod.outlook.com>
Mime-Version 1.0
Content-Type text/plain; charset="utf-8"
Content-Transfer-Encoding base64
X-Trace news.uni-berlin.de ARXk8IgnpxFVPExGpgU/3AU4fRKiiyvPzN60bf1V0tjw==
Return-Path <Joaquin.Alzola@lebara.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.010
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; 'error:': 0.05; 'skip:e 50': 0.05; 'column': 0.07; 'main()': 0.07; 'soap': 0.07; 'utf-8': 0.07; 'client:': 0.09; '(python)': 0.16; '36,': 0.16; '52,': 0.16; 'elem': 0.16; 'privilege.': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; '&lt;': 0.18; 'skip:" 40': 0.20; 'to:name :python-list@python.org': 0.20; 'problem:': 0.22; 'seems': 0.23; 'this:': 0.23; '(most': 0.24; 'xml': 0.24; 'skip:( 20': 0.28; 'fine': 0.28; 'skip:& 70': 0.29; 'skip:/ 40': 0.29; 'character': 0.29; 'skip:s 30': 0.31; 'traceback': 0.33; 'file': 0.34; 'skip:d 20': 0.34; 'server': 0.34; 'skip:& 20': 0.35; 'skip:. 20': 0.35; 'problem.': 0.35; 'but': 0.36; 'url:org': 0.36; 'to:addr:python- list': 0.36; 'received:10': 0.37; 'skip:& 10': 0.37; 'url:rec- html40': 0.37; 'doing': 0.38; 'guys': 0.38; 'skip:s 40': 0.38; 'sure': 0.39; 'skip:x 10': 0.40; 'to:addr:python.org': 0.40; 'url:schemas': 0.40; 'url:office': 0.40; '&amp;': 0.61; 'contact': 0.66; 'subject': 0.70; 'disclose': 0.71; 'subscribers': 0.72; 'special': 0.73; '160': 0.84; 'sms.': 0.84; 'url:quot': 0.84; 'request:': 0.91
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=lebara.onmicrosoft.com; s=selector1-lebara-com; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=8t6yKJAh401KlzyDrvUwDai7xp/oYsiGmy5jrC8gQ1Q=; b=MMLLIHQuIaw7j0AFmIUgpEr51Z6HRFFGoahVTLKtl3Vyj2Gvwx0KqOZ2879vKMIzwVdYUHwAYLxqpp1O35Hrj0glS/3mHk+m+4Ra14+0k9NeSvGGPd0oABqAFuqY6TMnuv4SYrvdi+U19GD4kwukyS2uEcYOM+NTG9LuquaTW7Y=
Thread-Topic Xlms namespace
Thread-Index AdGa4w660cAsLSOoT9G7EJlfXw9e0g==
Accept-Language en-GB, en-US
Content-Language en-US
X-MS-Has-Attach
X-MS-TNEF-Correlator
authentication-results python.org; dkim=none (message not signed) header.d=none;python.org; dmarc=none action=none header.from=lebara.com;
x-originating-ip [165.225.80.106]
x-ms-office365-filtering-correlation-id 1af3e6f8-2a83-488b-6b48-08d368fe278c
x-microsoft-exchange-diagnostics 1; HE1PR07MB1355; 5:FyNEGvqpBIpjg3GMdoJ4PMPukCcQzuuVB5fYJPdY31ZXiKuVirLFpHtNMGhpEQhgU2Sqq46dsAHmDWqGD/98Op3C4ejL5RTqvwfxwfz3Ox1fiACUGZx9FLdITN1ov8CbDghRHOJElNL8RJVBgsGOMMZulMHmUwU7Dsh40QGN7ncxdOgddjKpsKz28hH3kn8V; 24:JTP0vXe2wN6I0ToQ7zb9rhQ8/OQHXribktmoHNCtq3wcNGoUAxD5h5sSr9RUsRpbnLOhYJiG6DZpaMquryqFsglPghhEZoJJ3ebdPLMaHu8=; 7:cuGtxIOlCcuCJMRyzqTziQIxLRKoS4wWG6IzQhnNMa4iF7o6Lybxm0fEI+nZ+nVSq3SVikw41/3RPFbkjenMnclSpxioFTynYtrmxwPnfEXWMQEr8rVTyMo1gtlWjwHLq+Yz2J6I9uokASJUiw6uOjjXOQspfaAzzc0nVefqpOzYG1lS/tS2NadpOsAutVVeQ6HgbvVi7Tdlc2F0uQCyu6OIlMBjdlIF3bW/tVchd4k=
x-microsoft-antispam UriScan:;BCL:0;PCL:0;RULEID:;SRVR:HE1PR07MB1355;
x-microsoft-antispam-prvs <HE1PR07MB1355C6780820E86D261C3560F06D0@HE1PR07MB1355.eurprd07.prod.outlook.com>
x-exchange-antispam-report-test UriScan:;
x-exchange-antispam-report-cfa-test BCL:0; PCL:0; RULEID:(9101521026)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046); SRVR:HE1PR07MB1355; BCL:0; PCL:0; RULEID:; SRVR:HE1PR07MB1355;
x-forefront-prvs 0918748D70
x-forefront-antispam-report SFV:NSPM; SFS:(10019020)(6009001)(50986999)(16236675004)(76576001)(19580395003)(66066001)(33656002)(19625215002)(5002640100001)(3660700001)(54356999)(3480700003)(450100001)(122556002)(3280700002)(9686002)(19300405004)(1220700001)(5008740100001)(2906002)(790700001)(102836003)(6116002)(86362001)(2351001)(92566002)(5004730100002)(229853001)(11100500001)(110136002)(107886002)(74316001)(221733001)(1096002)(77096005)(5640700001)(15975445007)(189998001)(2501003)(5003600100002)(87936001)(81166005)(5630700001)(10400500002)(3846002)(2900100001)(586003); DIR:OUT; SFP:1102; SCL:1; SRVR:HE1PR07MB1355; H:HE1PR07MB1356.eurprd07.prod.outlook.com; FPR:; SPF:None; MLV:ovrnspm; PTR:InfoNoRecords; LANG:en;
spamdiagnosticoutput 1:23
spamdiagnosticmetadata NSPM
X-OriginatorOrg lebara.com
X-MS-Exchange-CrossTenant-originalarrivaltime 20 Apr 2016 09:28:37.7305 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader Hosted
X-MS-Exchange-CrossTenant-id d7093539-83cd-4991-b1b3-aacef74cf097
X-MS-Exchange-Transport-CrossTenantHeadersStamped HE1PR07MB1355
X-Content-Filtered-By Mailman/MimeDel 2.1.22
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.22
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID <HE1PR07MB135631A22E59C1644F33C569F06D0@HE1PR07MB1356.eurprd07.prod.outlook.com>
Xref csiph.com comp.lang.python:107419

Show key headers only | View raw


Hi Guys

I am currently doing this:

IP client(Python) --> send SOAPXML request --> IP Server (Python)

SOAP request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:req="http:/
/request.messagepush.interfaces.comviva.com" xmlns:xsd="http://request.messagepush.interfaces
.comviva.com/xsd">
<xsd:text>test\ntest\ntest<{[£€&%]}></xsd:text>

From my IP Client:
s.send(data_send.encode('utf-8'))

From my IPServer:
xml_decoded = data.decode('utf-8')
                              xml_root = ET.ElementTree(ET.fromstring(xml_decoded)).getroot()
                              for elem in xml_root.getiterator():
                                             if('{http://request.messagepush.interfaces.comviva.com/xsd}shortCode'==elem.tag):
                                                            shortCode = (elem.text).rstrip()
                                             if('{http://request.messagepush.interfaces.comviva.com/xsd}text'==elem.tag):
                                                            send_text = (elem.text).rstrip()
                                             if('{http://request.messagepush.interfaces.comviva.com/xsd}item'==elem.tag):
                                                            subscribers = (elem.text).rstrip()
                              result_sms = send_sms(subscribers,shortCode,send_text)

It is working fine but I am having problems with a couple of special characters, & and <

The problem:
<xsd:text>test\ntest\ntest<{[£€&%]}></xsd:text>

It seems as if I send this: <> and the character & then I have a problem.
I need to use utf-8 as I need to make sure I get 160 characters in one SMS.

Error:
Traceback (most recent call last):
  File "./ipserver.py", line 52, in <module>
    main()
  File "./ipserver.py", line 36, in main
    xml_root = ET.ElementTree(ET.fromstring(xml_decoded)).getroot()
  File "/usr/lib64/python3.4/xml/etree/ElementTree.py", line 1325, in XML
    parser.feed(text)
xml.etree.ElementTree.ParseError: not well-formed (invalid token): line 19, column 48
This email is confidential and may be subject to privilege. If you are not the intended recipient, please do not copy or disclose its content but contact the sender immediately upon receipt.

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


Thread

Xlms namespace Joaquin Alzola <Joaquin.Alzola@lebara.com> - 2016-04-20 09:28 +0000
  Re: Xlms namespace sohcahtoa82@gmail.com - 2016-04-20 10:52 -0700
    RE: Xlms namespace Joaquin Alzola <Joaquin.Alzola@lebara.com> - 2016-04-20 21:43 +0000

csiph-web