(This message has been automatically imported from the retired mailing list)
Under zato 2.0.2 I tried to create an outgoing SOAP connection with
WS-Security authentication.
I created a new WS-Security definition:
Name: security.foo
Username: foo
Reject empty nonce creation timestamps: [X]
Reject stale username tokens: [X]
Expiry (seconds): 3600
Nonce freshness (seconds): 3600
and set a password (“bar”)
Then I created an outgoing SOAP connection:
Name: foo.bar
Active: [X]
Host: http://localhost
URL path: /foo.cgi
Data format: XML
SOAP action:
SOAP version: 1.1
PING method: HEAD
Pool size: 20
Timeout (s): 10
Serialization type: String
Security definition: WS-Security/security.foo
TLS CA certs: --------
The webserver says “Successfully updated the SOAP outgoing connection
[foo.bar], check server logs for details”
However, when I check in logs I see the following:
2015-04-08 16:51:07,008 - ESC[1;31mERRORESC[0m - 1868:Dummy-165 -
zato.server.base:22 - Could not handle broker
msg:[Bunch(action=u’100815’, cluster_id=1L, connection=u’outgoing’,
data_format=u’xml’, has_rbac=False, host=u’http://localhost’, id=540L,
is_active=True, is_internal=False, merge_url_params_req=False,
method=None, msg_type=u’0002’, name=u’foo.bar’, old_name=u’foo.bar’,
old_soap_action=u’’, old_url_path=u’/foo.cgi’,
params_pri=u’channel-params-over-msg’, ping_method=u’HEAD’,
pool_size=20L, sec_tls_ca_cert_id=u’’, sec_type=u’wss’, security_id=9L,
security_name=u’security.foo’, serialization_type=u’string’,
service=None, soap_action=u’’, soap_version=u’1.1’, timeout=u’10’,
transport=u’soap’, url_params_pri=u’qs-over-path’,
url_path=u’/foo.cgi’)], e:[Traceback (most recent call last):
File “/opt/zato/2.0.2/zato-server/src/zato/server/base/init.py”,
line 47, in on_broker_msg
getattr(self, handler)(msg)
File “/opt/zato/2.0.2/zato-server/src/zato/server/base/worker.py”,
line 1116, in on_broker_msg_OUTGOING_HTTP_SOAP_CREATE_EDIT
wrapper = self._http_soap_wrapper_from_config(msg, False)
File “/opt/zato/2.0.2/zato-server/src/zato/server/base/worker.py”,
line 270, in _http_soap_wrapper_from_config
return HTTPSOAPWrapper(wrapper_config)
File
"/opt/zato/2.0.2/zato-server/src/zato/server/connection/http_soap/outgoing.py",
line 164, in init
super(HTTPSOAPWrapper, self).init(config, requests_module)
File
"/opt/zato/2.0.2/zato-server/src/zato/server/connection/http_soap/outgoing.py",
line 65, in init
self.set_auth()
File
"/opt/zato/2.0.2/zato-server/src/zato/server/connection/http_soap/outgoing.py",
line 139, in set_auth
self.soap[self.config[‘soap_version’]][‘header_template’].format(
AttributeError: ‘HTTPSOAPWrapper’ object has no attribute ‘soap’
]
and I can see the connection doesn’t exist because
self.outgoing.soap.keys() is empty.
However if I remove the security definition from the channel, I can use
it without a problem.
It looks like the problem is that BaseHTTPSOAPWrapper.init calls
self.set_auth, which depends on self.soap being present, but this is not
set in HTTPSOAPWrapper.init until after
BaseHTTPSOAPWrapper.init has been called.
As a quick frig, I moved the super call: