Re: XML parsing

2011-01-31 Thread Adrian Bool

Hi,

Remove any carriage returns and extra spaces from your binary.xml file, like so,

http://schemas.xmlsoap.org/soap/envelope/";>http://flypp.infy.com/sms/v2010r1_0";>12345343661t1p1p2DICT
 
test


Seems to parse ok then.

aid

On 31 Jan 2011, at 09:18, sami nathan wrote:

> 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
> 
>  xmlns:soapenv="http://sc
> hemas.xmlsoap.org/soap/envelope/"> xmlns:ns1="http://flypp.infy.com/sms/v2010r1_0";>1234534366<
> applicationID>1t1p
> 1p2DICT 
> test ns1:receiveShortMessageRequest>
> 
> 
> 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+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.

Adrian Bool
a...@logic.org.uk



-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



XML parsing

2011-01-31 Thread sami nathan
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

http://sc
hemas.xmlsoap.org/soap/envelope/
">http://flypp.infy.com/sms/v2010r1_0
">1234534366<
applicationID>1t1p
1p2DICT
test


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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.