(This message has been automatically imported from the retired mailing list)
Hello,
Attempting to post JSON content to a Zato Plain HTTP channel, and then have
that forward on through an outgoing Plain HTTP connection, is causing some
issues for me. I must be doing something wrong here.
Here is my service:
from zato.server.service import Service
class UpdateTemplateServer(Service):
def handle(self):
tmplsrv =3D self.outgoing.plain_http.get(‘update_templates’)
self.logger.info(self.request.payload)
tmplsrv.conn.post(self.cid, self.request.payload)
self.response.payload =3D “OK”
Here is the log:
=3D=3D> /opt/zato/prod/test-1/server1/logs/server.log <=3D=3D
2015-03-25 00:22:44,432 - INFO - 1874:Dummy-23665 -
tmpl-svc.update-template-server:22 - {u’urls’: {u’lpsrv|/greetings’:
u’greeting’}}
2015-03-25 00:22:44,432 - INFO - 1874:Dummy-23665 -
zato.server.connection.http_soap.outgoing:22 -
CID:[K06SEG5YX2ZGMFKDG390FDYHF9NW], address:[http://lpsrv/update],
qs_params:[{}], auth:[None], kwargs:[{}]
2015-03-25 00:22:44,435 - WARNING - 1874:Dummy-23665 -
zato.server.service:22 - Traceback (most recent call last):
File “/opt/zato/2.0.2/zato-server/src/zato/server/service/init.py”,
line 402, in update_handle
self._invoke(service, channel)
File “/opt/zato/2.0.2/zato-server/src/zato/server/service/init.py”,
line 345, in _invoke
service.handle()
File “/opt/zato/prod/test-1/server1/work/hot-deploy/current/tmpl_svc.py”,
line 7, in handle
tmplsrv.conn.post(self.cid, self.request.payload)
File
"/opt/zato/2.0.2/zato-server/src/zato/server/connection/http_soap/outgoing.=
py",
line 326, in post
return self.http_request(‘POST’, cid, data, params, *args, **kwargs)
File
"/opt/zato/2.0.2/zato-server/src/zato/server/connection/http_soap/outgoing.=
py",
line 308, in http_request
response.data =3D loads(response.text)
File “/usr/lib/python2.7/json/init.py”, line 338, in loads
return _default_decoder.decode(s)
File “/usr/lib/python2.7/json/decoder.py”, line 366, in decode
obj, end =3D self.raw_decode(s, idx=3D_w(s, 0).end())
File “/usr/lib/python2.7/json/decoder.py”, line 384, in raw_decode
raise ValueError(“No JSON object could be decoded”)
ValueError: No JSON object could be decoded
2015-03-25 00:22:44,435 - ERROR - 1874:Dummy-23665 -
zato.server.connection.http_soap.channel:22 - Caught an exception,
cid:[K06SEG5YX2ZGMFKDG390FDYHF9NW], status_code:[500],
_format_exc:[Traceback (most recent call last):
File
"/opt/zato/2.0.2/zato-server/src/zato/server/connection/http_soap/channel.p=
y",
line 198, in dispatch
payload, worker_store, self.simple_io_config, post_data)
File
"/opt/zato/2.0.2/zato-server/src/zato/server/connection/http_soap/channel.p=
y",
line 351, in handle
params_priority=3Dchannel_item.params_pri)
File “/opt/zato/2.0.2/zato-server/src/zato/server/service/init.py”,
line 423, in update_handle
raise e
ValueError: No JSON object could be decoded
]
The outgoing Plain HTTP connection:
update_templatesYeshttp://lpsrv/updateNo security definition
The incoming Plain HTTP channel:
Update Template Server
<http://z.simplur.com:8183/zato/http-soap/details/channel/plain_http/533/Up=
date%20Template%20Server/1/>
Yes/tmplsrv/updatetmpl-svc.update-template-server
<http://z.simplur.com:8183/zato/service/overview/tmpl-svc.update-template-s=
erver/?cluster=3D1>No
security definition
After setting up auditing on the Plain HTTP channel, I received the
following from the audit log:
[image: Zato samurai helmet logo]ZatoMy settings
http://z.simplur.com:8183/account/settings/basic/ Log out (admin)
http://z.simplur.com:8183/logout/
-
Services =E2=86=93
-
Messages =E2=86=93
-
Security =E2=86=93
-
Connections =E2=86=93
-
Cloud =E2=86=93
-
Key/value DB =E2=86=93
-
Pub/sub =E2=86=93
-
Scheduler http://z.simplur.com:8183/zato/scheduler/?cluster=3D1
-
Statistics =E2=86=93
<http://z.simplur.com:8183/zato/http-soap/audit/item/channel/plain_http/=
533/Update%20Template%20Server/1/1/#> -
Suggest a feature https://github.com/zatosource/zato/issues
-
Support https://zato.io/support.html
-
Get involved https://zato.io/docs/project/get-involved.html
Update Template Server : Audit log : K06SEG5YX2ZGMFKDG390FDYHF9NW
Overview
<http://z.simplur.com:8183/zato/http-soap/details/channel/plain_http/533/Up=
date%20Template%20Server/1/>
Audit log
<http://z.simplur.com:8183/zato/http-soap/audit/log/channel/plain_http/533/=
Update%20Template%20Server/1/>
RequestHeadersPayloadResponseHeadersPayload
Any help is appreciated.
Thanks,
Bobby