
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi
I am having an issue with XMLHttpRequest in an action script.
Scenario
we run an action script when the workflow state changes, what we want to do is send an email with a ics attachment so that we can add an appointment to a users outlook calendar.
As we can't attach a file to an email we have created a simple web api application. To test that PLM can call out to our REST service we pass a name and email address (hard coded) and then the web api forwards these details on in an email.
var xhr = new XMLHttpRequest();
var value = '{ "EmailAddress": "joe.bloggs@test.com", "Name": "Joe Bloggs" }';
xhr.open("POST", "http://the-url/api/plm", true);
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.setRequestHeader('Content-Length', value.length);
xhr.send(value);
This actually works however the email and the name are not passed on to my service. My test app works fine.
So I changed the request to
var xhr = new XMLHttpRequest();
var value = EmailAddress=joe.bloggs@test.com&Name=Joe bloggs;
xhr.open("POST", "http://the-url/api/plm", true);
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xhr.setRequestHeader('Content-Length', value.length);
xhr.send(value);
This throws a SECURITY_ERR on the first line
My service is enabled for CORS and my test application works fine sending cross origin requests.
Are XMLHttpRequest calls supported in PLM, and if so what am I missing
thanks
Solved! Go to Solution.