Reputation: 21098
I have integration that uses cXML standard, where customer connects from his own system, to our system, to buy goods and then to be redirected back to his own system, with all those goods created in his system.
We already implemented this to work between Odoo and Ariba/SAP, but its not working properly with Dynamics 365. Problem happens on final step, when user needs to be redirected back to his system to end his purchase.
Every time it is redirected, it looks like it converts POST request to get and then gives this as a result:
From requests, it looks like it starts fine with a POST (and 308 redirect to persist that), but then it becomes GET.
So I am not sure if its Dynamics 365 doing that or maybe I am missing something to make it work properly? It also loooks like it triggers login to Dynamics (even though that user is already logged in).
I tried various ways to finish this step, but in all cases it ends up the same:
I tried simple submit with HTML/JS to see if maybe my implementation is doing something wrong:
<form id="cxml_form" method="POST" action="https://some-subdomain.dynamics.com/punchout/cxml/COOKIE" enctype="application/x-www-form-urlencoded">
<input type="hidden" name="cXML-urlencoded" value='payloadPlaceholder'>
</form>
<script type="text/javascript">document.getElementById('cxml_form').submit()</script>
Basically same thing.
Also tried to do it with flask
:
@app.route('/cxml', methods=['POST'])
def send_cxml():
return redirect(
"https://some-subdomain.dynamics.com/punchout/cxml/COOKIE",
308,
)
There is also this site to test CXML: https://punchoutcommerce.com/tools/cxml-order-tester
So using that, it receives response something like this:
<!-- Copyright (C) Microsoft Corporation. All rights reserved. -->
<!DOCTYPE html>
<html dir="ltr" class="" lang="en">
<head>
<title>Sign in to your account</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=2.0, user-scalable=yes">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="-1">
<link rel="preconnect" href="https://aadcdn.msauth.net" crossorigin>
<meta http-equiv="x-dns-prefetch-control" content="on">
<link rel="dns-prefetch" href="//aadcdn.msauth.net">
<link rel="dns-prefetch" href="//aadcdn.msftauth.net">
...
...
It looks like it just tries to redirect to login page (even though I am logged in to dynamics)?
Upvotes: 2
Views: 175