Hi,
I constructed a web client using urllib2 to call a web service and it
works.
However, when I ported the code to inside trac (as a package), it
returns an Internal Server Error inside the response message.

Interactive Log shows as below:
-------------------
File "C:\Python25\Lib\site-packages\trac\web\main.py", line 423, in
_dispatch_request
  dispatcher.dispatch(req)
File "C:\Python25\Lib\site-packages\trac\web\main.py", line 197, in
dispatch
  resp = chosen_handler.process_request(req)
File "C:\Python25\Lib\site-packages\trac\ticket\web_ui.py", line 171,
in process_request
  return self._process_newticket_request(req)
File "C:\Python25\Lib\site-packages\trac\ticket\web_ui.py", line 380,
in _process_newticket_request
  self._do_create(req, ticket) # (redirected if successful)
File "C:\Python25\Lib\site-packages\trac\ticket\web_ui.py", line 956,
in _do_create
  ticket.insert()
File "C:\Python25\Lib\site-packages\trac\ticket\model.py", line 198,
in insert
  listener.ticket_created(self)
File "build\bdist.win32\egg\saptalk\saptalk.py", line 92, in
ticket_createdFile "C:\Python25\lib\urllib2.py", line 124, in urlopen
  return _opener.open(url, data)
File "C:\Python25\lib\urllib2.py", line 387, in open
  response = meth(req, response)
File "C:\Python25\lib\urllib2.py", line 498, in http_response
  'http', request, response, code, msg, hdrs)
File "C:\Python25\lib\urllib2.py", line 419, in error
  result = self._call_chain(*args)
File "C:\Python25\lib\urllib2.py", line 360, in _call_chain
  result = func(*args)
File "C:\Python25\lib\urllib2.py", line 823, in http_error_401
  url, req, headers)
File "C:\Python25\lib\urllib2.py", line 801, in http_error_auth_reqed
  return self.retry_http_basic_auth(host, req, realm)
File "C:\Python25\lib\urllib2.py", line 811, in retry_http_basic_auth
  return self.parent.open(req)
File "C:\Python25\lib\urllib2.py", line 387, in open
  response = meth(req, response)
File "C:\Python25\lib\urllib2.py", line 498, in http_response
  'http', request, response, code, msg, hdrs)
File "C:\Python25\lib\urllib2.py", line 425, in error
  return self._call_chain(*args)
File "C:\Python25\lib\urllib2.py", line 360, in _call_chain
  result = func(*args)
File "C:\Python25\lib\urllib2.py", line 506, in http_error_default
  raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)

-----------------

My entire code to call web service is based on the following:
handler = urllib2.HTTPBasicAuthHandler(password)
opener = urllib2.build_opener(handler)
urllib2.install_opener(opener)
req = urllib2.Request(main_url, soap_msg, headers)
f = urllib2.urlopen(req)

As mentioned: it could work in a standalone script, but when the code
is inside TRAC it returned error.

Do you have any idea about this problem?

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

Reply via email to