gesulmino Posted June 28, 2019 Share Posted June 28, 2019 Hi, From a unigui application (WebA) I should post some data to a url, another unigui application (WebB). WebB shows a form to ask some additional information to the user depending from url parameters, then returns control to the calling session in WebA indicating some return parameters. I hope I was clear. Any suggestions or examples on this? Quote Link to comment Share on other sites More sharing options...
Hayri ASLAN Posted June 28, 2019 Share Posted June 28, 2019 Hi Please check " HTTP Post Callback - URLFrame - Auto Target" demo Key point is Sc:=UniSession.CallbackUrlEx('mycallback', Self, ['RES', 'OK']); S:=StringReplace(S, '{URL_CALLBACK}', Sc, []); Quote Link to comment Share on other sites More sharing options...
gesulmino Posted July 2, 2019 Author Share Posted July 2, 2019 On 6/28/2019 at 1:22 PM, Hayri ASLAN said: Hi Please check " HTTP Post Callback - URLFrame - Auto Target" demo Key point is Sc:=UniSession.CallbackUrlEx('mycallback', Self, ['RES', 'OK']); S:=StringReplace(S, '{URL_CALLBACK}', Sc, []); I tried this, s := 'var f = document.createElement("form"); '+ 'f.action="'+UniServerModule.PIN_EndPoint+'/login"; '+ // the second app url 'f.method="POST"; '; aUrl := UniSession.CallbackUrlEx('mycallback', Self, ['RES', 'OK'], true, false); s := s+ 'var i=document.createElement("input"); '+ // url_submit 'i.type="hidden"; '+ 'i.name="url_submit"; '+ 'i.value="'+TNetEncoding.Url.Encode(Base64Encode(aUrl))+'"; '+ 'f.appendChild(i); '; aUrl := UniSession.CallbackUrlEx('mycallback', Self, ['RES', 'CANCEL'], true, false); s := s+ 'var i2=document.createElement("input"); '+ // url_cancel 'i2.type="hidden"; '+ 'i2.name="url_cancel"; '+ 'i2.value="'+TNetEncoding.Url.Encode(Base64Encode(aUrl))+'"; '+ 'f.appendChild(i2); '+ 'document.body.appendChild(f); '+ 'f.submit(); '; UniSession.AddJS(s) this show a form with some fields but I obtain this result when I submit the form http://localhost:8080/integra/HandleEvent?IsEvent=1&Obj=O0&Ajax=1&Evt=mycallback&RES=OK&_S_ID=5icJiog4CK1042A9E43&__EXCB__=1 Invalid session or session Timeout. Restart application what is wrong? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.