(Migrated) usage of zato.http-soap.create

(This message has been automatically imported from the retired mailing list)

Hello,

I have been trying to create a channel following the documentation at
https://zato.io/docs/public-api/details/zato.http-soap.create.html invoking
the service zato.http-soap.create. The channel gets created, but it doesn’t
work until I go to the list of channels, and click edit and after ok. This
is the payload I am passing:

payload =3D {
‘cluster_id’: 1,
‘name’: ‘whatever.human_resources.person.get-contracts’,
‘is_active’: True,
‘connection’: ‘channel’,
‘transport’: ‘plain_http’,
‘url_path’: /whatever/human_resources/person/{person_id}/contract/,
‘service’: ‘whatever-human_resources-person.get-contracts’,
‘data_format’: ‘json’,
‘url_params_pri’: ‘path-over-qs’,
‘is_internal’: False,
}

I think I am following the documentation closely, but when I call the
channel (doing a curl following the pattern I put in url_path) I get:

curl http://server/whatever/human_resources/person/857439/contract/

{
“zato_env”: {
“details”: “Traceback (most recent call last):\nFile
”/opt/zato/2.0.3/zato-server/src/zato/server/connection/http_soap=
/channel.py",
line 198, in dispatch\n payload, worker_store,
self.simple_io_config, post_data)\n File
"/opt/zato/2.0.3/zato-server/src/zato/server/connection/http_soap=
/channel.py",
line 351, in handle\n params_priority=3Dchannel_item.params_pri)\n
File “/opt/zato/2.0.3/zato-server/src/zato/server/service/_init=
_.py”,
line 389, in update_handle\n environ=3Dkwargs.get(‘environ’))\n File
"/opt/zato/2.0.3/zato-server/src/zato/server/service/init.py=
",
line 830, in update\n service._init()\n File
"/opt/zato/2.0.3/zato-server/src/zato/server/service/init.py=
",
line 299, in _init\n self.request.init(is_sio, self.cid,
self.SimpleIO, self.data_format, self.transport, self.wsgi_environ)\n
File “/opt/zato/2.0.3/zato-server/src/zato/server/service/reqresp=
/init.py”,
line 120, in init\n raise ZatoException(cid, ‘Missing
input’)\nZatoException: Missing input\n",
“result”: “ZATO_ERROR”,
“cid”: “K0736DMJXAYXXCSS28G7JYWFD5DR”
}
}

But if I edit the channel and click ok it starts working. That makes
me think there is a problem with the parameters I pass for the channel
creation, and that the default values set by the zato gui on edit fix
it.

Also related with this, I have seen 2 details in the payload the gui
sends to the channel creation service that don’t appear in the
documentation:

  • In case the channel doesn’t have security, the documentation says to
    not send the key security_id. The gui sends “security_id”: “ZATO_NONE”

  • The key “params_pri” is not documented.

Regards,
Yeray.

–=20
Domingo Yeray Rodr=C3=ADguez Mart=C3=ADn dyeray@ull.es
Soporte T=C3=A9cnico del Servicio de Investigaci=C3=B3n
Tel=C3=A9fono: +34 922 845 029
Correo: stic.investigacion@ull.es
Universidad de La Laguna (ULL)

No, it points to whatever-human_resources-person.get-contracts. When I call
this url, the channel is already created. The curl is trying to access the
channel after creating it, but before doing the fix: edit - ok.

Regards,
Yeray.

2015-06-03 12:28 GMT+01:00 Dariusz Suchojad dsuch@zato.io:

On 03/06/15 13:09, DOMINGO YERAY RODRIGUEZ MARTIN wrote:

I think I am following the documentation closely, but when I call the
channel (doing a curl following the pattern I put in url_path) I get:

curl http://server/whatever/human_resources/person/857439/contract/

Aha, and this URL points to zato.http-soap.create?


Dariusz Suchojad

https://zato.io
ESB, SOA, REST, APIs and Cloud Integrations in Python

–=20
Domingo Yeray Rodr=C3=ADguez Mart=C3=ADn dyeray@ull.es
Soporte T=C3=A9cnico del Servicio de Investigaci=C3=B3n
Tel=C3=A9fono: +34 922 845 029
Correo: stic.investigacion@ull.es
Universidad de La Laguna (ULL)

–=20
Domingo Yeray Rodr=C3=ADguez Mart=C3=ADn dyeray@ull.es
Soporte T=C3=A9cnico del Servicio de Investigaci=C3=B3n
Tel=C3=A9fono: +34 922 845 029
Correo: stic.investigacion@ull.es
Universidad de La Laguna (ULL)

On 03/06/15 13:09, DOMINGO YERAY RODRIGUEZ MARTIN wrote:

I think I am following the documentation closely, but when I call the
channel (doing a curl following the pattern I put in url_path) I get:

curl http://server/whatever/human_resources/person/857439/contract/

Aha, and this URL points to zato.http-soap.create?

Yes, that’s it. Thank you for your help.

2015-06-03 13:30 GMT+01:00 Dariusz Suchojad dsuch@zato.io:

On 03/06/15 13:09, DOMINGO YERAY RODRIGUEZ MARTIN wrote:

This
is the payload I am passing:

Can you please add the ‘merge_url_params_req’: True to the payload and
try again?

This is a flag indicating if URL parameters, which is what you use,
should be consulted at all.

In 2.0.3 it erroneously defaulted to False in zato.http-soap.create and
since you didn’t provide it in the payload the parameters were ignored.

In GH it already defaults to True, as it should be, and it will be
released in 2.0.4.

thanks,


Dariusz Suchojad

https://zato.io
ESB, SOA, REST, APIs and Cloud Integrations in Python

–=20
Domingo Yeray Rodr=C3=ADguez Mart=C3=ADn dyeray@ull.es
Soporte T=C3=A9cnico del Servicio de Investigaci=C3=B3n
Tel=C3=A9fono: +34 922 845 029
Correo: stic.investigacion@ull.es
Universidad de La Laguna (ULL)

On 03/06/15 13:09, DOMINGO YERAY RODRIGUEZ MARTIN wrote:

This
is the payload I am passing:

Can you please add the ‘merge_url_params_req’: True to the payload and
try again?

This is a flag indicating if URL parameters, which is what you use,
should be consulted at all.

In 2.0.3 it erroneously defaulted to False in zato.http-soap.create and
since you didn’t provide it in the payload the parameters were ignored.

In GH it already defaults to True, as it should be, and it will be
released in 2.0.4.

thanks,