Skip to Content
Menu
Dette spørgsmål er blevet anmeldt
1 Svar
6148 Visninger

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
Kassér
Bedste svar

print(request.httprequest.data)

will show the xml request data.

Avatar
Kassér
Related Posts Besvarelser Visninger Aktivitet
1
apr. 22
18364
0
jan. 22
2343
3
dec. 23
4688
0
dec. 22
2220
0
jul. 20
3474