Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
1 Antworten
6164 Ansichten

I'm trying to integrate odoo with an external application, that updates a custom url that I've given automatically, with XML data when an event occurs.

Suppose I hosted my odoo on https://mydomain.com, I can provide a custom url like https://mydomain.com/my/customurl

to that application, and that application will post an xml data to to the url. 

I can see that the url is actually called by the external application on status change, but how to view the xml data?

printing kwargs and args gave empty result. I think Odoo handles data with header  {"Content-Type": "application/json"} only. How to handle {"Content-Type": "text/xml"} data?

I know that data is present in the post request, which I've verified by giving a test url from https://requestbin.com which output the correct xml data in the body of the post request.

Any solutions or ideas are welcome. Odoo version is 11.

code :

from odoo import http
from odoo.http import request
import logging

class DocuSignStatus(http.Controller):

@http.route(['/docusign/envelope'], type='http', auth="public", methods=['POST'], csrf=False)
def update_docusign_status(self, *args, **kwargs):
    logging.error("\n\n\nCame in here!!!!!!!!!!!!!!!!!")
    for arg in args:
        logging.error("\nArgs = %s" % arg)
    logging.error("\n\n\nKwargs = %s" % kwargs)
    #        logging.error("request = %s" % request)
    #        logging.error("context = %s" % request.context)
    return {}

Avatar
Verwerfen
Beste Antwort

print(request.httprequest.data)

will show the xml request data.

Avatar
Verwerfen
Verknüpfte Beiträge Antworten Ansichten Aktivität
1
Apr. 22
18364
0
Jan. 22
2353
3
Dez. 23
4698
0
Dez. 22
2231
0
Juli 20
3494