伙计们,我对以下代码有疑问,
import urllib2
url = 'http://192.0.0.1.1/GVSignOn/ExecutePortType?WSDL'
data = '''
<?xml version="1.0" encoding="UTF-8"?>
<gv:SignOnReq xmlns:gv="http://abc.com/gv" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<gv:TerminalId>1</gv:TerminalId>
<gv:StoreCode>1234</gv:StoreCode>
<gv:TimeStamp>01-01-2011 01:01:00</gv:TimeStamp>
</gv:SignOnReq>
'''
req = urllib2.Request(url)
req.add_header('Content-Type', 'application/xml; charset=utf-8')
req.add_header('Content-Length', len(data))
response = urllib2.urlopen(req, data) ## Here it raising an error
## 'HTTP Error 415: Unsupported Media Type'
注意:m 在这里使用 python2.5 & Google app engine sdk 1.6.1v
请帮助我获得回复..
此致..
尼克斯。