## Script (Python) "SE_search"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=address='http://www.eeg.pl/SE_server'
##title=
##
# index_html (python script)
#
# SE_makeQueryType - Search External client module
#
# default document for product control
#
# (C) 2003 by CC Open Computer Systems for the "Neuroinfo" project
# This is free software avaiable under the GPL license, see:
#   LICENSE.txt, README.txt for details.
# ==================================================================


REQUEST=context.REQUEST

if address.startswith('http://'): 
  address = address[7:]
  
url = address.split('/')

tmp = url[0].split(':')
base_url = ':'.join(tmp[:1])
try:
  port = int(tmp[1])
except IndexError:
  port = 80
path = '/' + '/'.join(url[1:])

s = context.SE_query_soap( container, REQUEST )

rs = context.soap_tool.request( base_url, port, path, s )

results = context.soap_tool.ParseSoapMessage(rs)

return results
