(This message has been automatically imported from the retired mailing list)
I want to share some experience with this list, that maybe help someone.
In Zato services there are a number of resources that you could use to
develop the service itself but still there are a few unknown ways to known
info about the service execution like the user, channel, that is being used
during the execution of the service.
the questions are:
1- How to know who is the user that is executing the service?
2- How to know who is the channel that is using the execution of the
service?
to answer this questions this are example ways:
1- To determine who is the user that is executing the service:
example for soap:
path_info = self.wsgi_environ.get(‘PATH_INFO’, False)
soap_action = self.wsgi_environ.get(‘HTTP_SOAPACTION’, False)
sec_info = self.worker_store.security.url_sec.getall(path_info)
for info in soap_channel_info:
if soap_action in info:
user_info = info[soap_action]
you could now access to data of the authenticated user that is running
the service if the used channel of the service execution require
authentication
like:
user_info.sec_def.name
user_info.sec_def.password
user_info.sec_def.sec_type
if user_info.sec_def.sec_type == ‘tech_acc’
user_info.sec_def.salt
if user_info.sec_def.sec_type == ‘basic_auth’
user_info.sec_def.username
user_info.sec_def.realm
if user_info.sec_def.sec_type == ‘wss’
user_info.sec_def.username
user_info.sec_def.password_type
user_info.sec_def.reject_empty_nonce_creat
user_info.sec_def.reject_stale_tokens
user_info.sec_def.reject_expiry_limit
user_info.sec_def.nonce_freshness_time
2- To determine what is the channel that is used in the execution of the
service
example for soap:
path_info = self.wsgi_environ.get(‘PATH_INFO’, False)
soap_action = self.wsgi_environ.get(‘HTTP_SOAPACTION’, False)
soap_channel_info =
self.worker_store.request_dispatcher.soap_handler.http_soap.getall(path_info)
for info in soap_channel_info:
if soap_action in info:
channel_info = info[soap_action]
you could now access to data of the channel used in the service execution
like:
channel_info.impl_name
channel_info.name
channel_info.soap_version
channel_info.is_internal
channel_info.is_active
channel_info.data_format
channel_info.method
channel_info.connection
channel_info.service_name
channel_info.service_id
channel_info.url_path
channel_info.id
channel_info.transport
All of this is based on my work with http_soap services, there are similar
ways for the other channels.
Hope this helps someone, Only my two cents for zato list