Monday, January 31, 2011

XML parsing

HI
   I am trying to parse my response  by the following method
  elif request.method == 'POST':
       reqp=request.raw_post_data
       response = HttpResponse(mimetype='text/xml')
       response.write(reqp)
       print response
       xmldoc = minidom.parse('binary.xml')
       reflist = xmldoc.getElementsByTagName('message')
       print reflist
       return response
 But its giving me error of "TO MANY VALUE TO UNPACK"
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
my request looks like this

<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://sc
hemas.xmlsoap.org/soap/envelope/"><soapenv:Body><ns1:receiveShortMessageRequest
xmlns:ns1="http://flypp.infy.com/sms/v2010r1_0"><uniqueID>1234534366</uniqueID><
applicationID>1</applicationID><transactionID>t1</transactionID><placeholder_1>p
1</placeholder_1><placeholder_2>p2</placeholder_2><message>DICT test</message></
ns1:receiveShortMessageRequest></soapenv:Body></soapenv:Envelope>


Now my ultimate aim is to send error  response to client sending me the above request without DICT in message

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment