<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: XMLHttpRequest in action script in Fusion Manage Forum</title>
    <link>https://forums.autodesk.com/t5/fusion-manage-forum/xmlhttprequest-in-action-script/m-p/5539220#M7338</link>
    <description>Hey wait... had this idea... I used a base 64 encoded user+password from another application (Soap UI as my test bench).&lt;BR /&gt;Then did a:&lt;BR /&gt;xhr.setRequestHeader("Authorization", "Basic YWxleGFuZGVyLnR1Y2tlckBnZW5jby5jb206dXNlcjAx");&lt;BR /&gt;&lt;BR /&gt;Seems to be working...</description>
    <pubDate>Fri, 13 Mar 2015 06:08:06 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-03-13T06:08:06Z</dc:date>
    <item>
      <title>XMLHttpRequest in action script</title>
      <link>https://forums.autodesk.com/t5/fusion-manage-forum/xmlhttprequest-in-action-script/m-p/4378373#M7331</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am having an issue with XMLHttpRequest in an action script.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Scenario&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var xhr = new XMLHttpRequest();&lt;BR /&gt;var value = '{&amp;nbsp;"EmailAddress": "&lt;A target="_blank" href="mailto:tim.ray@trionics.co.uk"&gt;joe.bloggs@test.com&lt;/A&gt;",&amp;nbsp;"Name": "Joe Bloggs" }';&lt;/P&gt;&lt;P&gt;xhr.open("POST", "&lt;A target="_blank" href="http://plm.s3cservices.co.uk/api/plm"&gt;http://the-url/api/plm&lt;/A&gt;", true);&lt;BR /&gt;xhr.setRequestHeader('Content-Type', 'application/json');&lt;BR /&gt;xhr.setRequestHeader('Content-Length', value.length);&lt;BR /&gt;xhr.send(value);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This actually works however the email and the name are not passed on to my service. My test app works fine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I changed the request to&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var xhr = new XMLHttpRequest();&lt;BR /&gt;var value = &lt;A target="_blank" href="mailto:EmailAddress=joe.bloggs@test.com&amp;amp;Name=Joe%20bloggs"&gt;EmailAddress=joe.bloggs@test.com&amp;amp;Name=Joe bloggs&lt;/A&gt;;&lt;BR /&gt;xhr.open("POST", "&lt;A target="_blank" href="http://plm.s3cservices.co.uk/api/plm"&gt;http://the-url/api/plm&lt;/A&gt;", true);&lt;BR /&gt;xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');&lt;BR /&gt;xhr.setRequestHeader('Content-Length', value.length);&lt;BR /&gt;xhr.send(value);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This throws a&amp;nbsp;SECURITY_ERR on the first line&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My service is enabled for CORS and my test application works fine sending cross origin requests.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Are XMLHttpRequest calls supported in PLM, and if so what am I missing&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;</description>
      <pubDate>Fri, 23 Aug 2013 14:08:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-manage-forum/xmlhttprequest-in-action-script/m-p/4378373#M7331</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-08-23T14:08:11Z</dc:date>
    </item>
    <item>
      <title>Re: XMLHttpRequest in action script</title>
      <link>https://forums.autodesk.com/t5/fusion-manage-forum/xmlhttprequest-in-action-script/m-p/4379085#M7332</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;sscaife,&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Great question, and great inovative approach on extending PLM 360's functionality with web servcies!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;There are acouple of quick changes needed here to get this httpRequest to work. &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;&lt;SPAN style="line-height: 13px;"&gt;PLM 360 only supports&amp;nbsp;synchronous &amp;nbsp;XMLHttpRequests, so you can drop the 'true' argument from your open statement.&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN style="line-height: 13px;"&gt;Remove&amp;nbsp;&lt;SPAN&gt;xhr.setRequestHeader('Content-Length', value.length); &amp;nbsp;// not needed here&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's the updated code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;var xhr = new XMLHttpRequest();&lt;BR /&gt;var value = '{&amp;nbsp;"EmailAddress": "&lt;A href="mailto:tim.ray@trionics.co.uk" rel="nofollow" target="_blank"&gt;joe.bloggs@test.com&lt;/A&gt;",&amp;nbsp;"Name": "Joe Bloggs" }';&lt;/P&gt;
&lt;P&gt;xhr.open("POST", "&lt;A href="http://plm.s3cservices.co.uk/api/plm" rel="nofollow" target="_blank"&gt;http://the-url/api/plm&lt;/A&gt;");&lt;BR /&gt;xhr.setRequestHeader('Content-Type', 'application/json');&lt;BR /&gt;xhr.send(value);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let me know if you have any other issues with this, and how it turns out!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;-Jared&lt;/P&gt;</description>
      <pubDate>Sat, 24 Aug 2013 07:32:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-manage-forum/xmlhttprequest-in-action-script/m-p/4379085#M7332</guid>
      <dc:creator>jared.sund</dc:creator>
      <dc:date>2013-08-24T07:32:12Z</dc:date>
    </item>
    <item>
      <title>Re: XMLHttpRequest in action script</title>
      <link>https://forums.autodesk.com/t5/fusion-manage-forum/xmlhttprequest-in-action-script/m-p/4382344#M7333</link>
      <description>&lt;P&gt;Hi Jared,&lt;BR /&gt;We are going down this route as we'd like to generate an .ics file to add appointments to peoples diaries via an email. I have requested this in the ideastation but for now we are trying to do it via this route.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code doesn't cause an error in PLM now I've tested it. I just need Steve to test his end&lt;/P&gt;</description>
      <pubDate>Tue, 27 Aug 2013 14:41:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-manage-forum/xmlhttprequest-in-action-script/m-p/4382344#M7333</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-08-27T14:41:14Z</dc:date>
    </item>
    <item>
      <title>Re: XMLHttpRequest in action script</title>
      <link>https://forums.autodesk.com/t5/fusion-manage-forum/xmlhttprequest-in-action-script/m-p/4382774#M7334</link>
      <description>Sorry for the delay in replying to you, that worked so marked as the answer.&lt;BR /&gt;&lt;BR /&gt;For future reference is it node.js in the backend? seem to recall reading somewhere that node.js is single threaded, and as it appears to run the code on the server and not the browser it makes sense, if this is the case then it will make it easier for us to develop functionality like this going forward, as we can also refer to the node.js documentation.&lt;BR /&gt;&lt;BR /&gt;At least we know to keep all the calls synchronous now &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Also thanks for the compliment, much appreciated</description>
      <pubDate>Tue, 27 Aug 2013 19:46:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-manage-forum/xmlhttprequest-in-action-script/m-p/4382774#M7334</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-08-27T19:46:21Z</dc:date>
    </item>
    <item>
      <title>Re: XMLHttpRequest in action script</title>
      <link>https://forums.autodesk.com/t5/fusion-manage-forum/xmlhttprequest-in-action-script/m-p/5539137#M7335</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Attempting to do something similar but needs basic authentication. &amp;nbsp;Testframework is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var xhr = new XMLHttpRequest();&lt;BR /&gt;xhr.open("GET","&lt;A target="_blank" href="https://this.particular.service/board/tasks&amp;quot;,&amp;quot;myusername&amp;quot;,&amp;quot;mypassword&amp;quot;);"&gt;https://this.particular.service/board/tasks","myusername","mypassword");&lt;/A&gt;&lt;BR /&gt;xhr.send();&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Result is:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;There is an error in the script on line 0, column 0. NETWORK_ERR&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Can't figure out why... &amp;nbsp;suggestions?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Mar 2015 02:55:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-manage-forum/xmlhttprequest-in-action-script/m-p/5539137#M7335</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-03-13T02:55:53Z</dc:date>
    </item>
    <item>
      <title>Re: XMLHttpRequest in action script</title>
      <link>https://forums.autodesk.com/t5/fusion-manage-forum/xmlhttprequest-in-action-script/m-p/5539139#M7336</link>
      <description>Debug shows failure on the xhr.send();</description>
      <pubDate>Fri, 13 Mar 2015 02:56:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-manage-forum/xmlhttprequest-in-action-script/m-p/5539139#M7336</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-03-13T02:56:50Z</dc:date>
    </item>
    <item>
      <title>Re: XMLHttpRequest in action script</title>
      <link>https://forums.autodesk.com/t5/fusion-manage-forum/xmlhttprequest-in-action-script/m-p/5539182#M7337</link>
      <description>also whether this GET is in 'GET' or "GET" doesn't make a difference</description>
      <pubDate>Fri, 13 Mar 2015 04:52:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-manage-forum/xmlhttprequest-in-action-script/m-p/5539182#M7337</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-03-13T04:52:32Z</dc:date>
    </item>
    <item>
      <title>Re: XMLHttpRequest in action script</title>
      <link>https://forums.autodesk.com/t5/fusion-manage-forum/xmlhttprequest-in-action-script/m-p/5539220#M7338</link>
      <description>Hey wait... had this idea... I used a base 64 encoded user+password from another application (Soap UI as my test bench).&lt;BR /&gt;Then did a:&lt;BR /&gt;xhr.setRequestHeader("Authorization", "Basic YWxleGFuZGVyLnR1Y2tlckBnZW5jby5jb206dXNlcjAx");&lt;BR /&gt;&lt;BR /&gt;Seems to be working...</description>
      <pubDate>Fri, 13 Mar 2015 06:08:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-manage-forum/xmlhttprequest-in-action-script/m-p/5539220#M7338</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-03-13T06:08:06Z</dc:date>
    </item>
  </channel>
</rss>

