What is the best way to call external app

Hi guys,

Just want to ask,

What is the best approach to call external web application created in php, and receive back the data from it and paste the date to current webform?
the data return contain image string (converted to base64.)

You will need to use a HTTPSocket to make a raw HTTP request. You will have to provide any form details or request headers that it requires in order to use. The ‘PageReceived’ event should have your data.

I recommend dragging a HTTPSocket to your Window and going from there.

Thanks Phillip,

What i mean is, the external php application must be run , and any user interaction from it will be forwarded to xojo web form upon exit.

Does httpSocket can do this?

Well the HTTPSocket will call it like a web browser does. However you may need to fill in from details, user agent strings, headers, etc. in order for the PHP to process it correctly. If you set it up correctly the PHP code can’t tell it’s not a browser.

You mean, HTTPSocket can also be act as SHOWURL to open php page for user? Is that what you mean?

Then, once the user is done with the php interaction, all data can be retrieved back to XOJO WEB for manipulation, right?

HTTPSocket runs in the background. It makes a web request, any kind of request.

ShowURL() is different. If you navigate the user away from your web app then getting back would be difficult.

It sounds like you want your user to give you some data and then in the background you use HTTPSocket to take to the PHP page. Then you present that data as needed to your web user. They never leave your app.

Thats correct.

I had a button on my xojo web app that call ShowURL so show php page to user.
This php page has webcam capture.
after user capture her photo, the photo should be sent back to xojo web app where it was started

Initially, I had a solution using the URLParameter. But picture string is too huge that xojo cloud is not able to handle.

Now, I’m looking for another alternative.

That’s why I asked this forum and its seems you know the answer.
I really appreciate to give me best approach on how to deal with this.

Help me understand the situation.

There is a PHP page somewhere that has webcam capture capability that then returns user and the picture data as part of the query string to the URL you designate?

The better approach might be to add the capability of talking to a user’s webcam directly into Xojo Web. I could build that but its not trivial.

Picture data coming over query string would probably not work due to maximum length in the URL.

[quote]There is a PHP page somewhere that has webcam capture capability that then returns user and the picture data as part of the query string to the URL you designate?[/quote] - Thats correct.

With that solutions, I end up to an error “The requested URL’s length exceeds the capacity limit for this server” .
That’s why im looking for alternative solution.

Here is the actual php for you to experience>> http://test.pentagamma.net/webcam/index.php

As usual, someone posts several threads about the same thing, hoping that magically, he will get a better answer than politely following the already initiated thread… Lost case …

https://forum.xojo.com/36300-the-requested-url-s-length-exceeds-the-capacity-limit-for-this-/0#p296839

[quote=296837:@ronaldo florendo]

Here is the actual php for you to experience>> http://test.pentagamma.net/webcam/index.php[/quote]

Interesting. Unfortunately there is no practical way to integrate this in the way you desire. There is no way to respond to POST variables and match it up with an active session. Nor could you accept the picture data via query string.

You maybe able to set the picture data to a cookie but so many conditions would have to be true that it would not be worth the effort.

Your best option is to integrate that webcam.js library directly into Xojo Web.

Hi Michel,

Thanks for the issue.

My first issue is the “url exceed of limit”. I didn’t received direct answer on that, except refer “to this” and "refer to this. "
Which I had a hard time digging it to find answer.

Thanks to Philip he give me answer here >>“Picture data coming over query string would probably not work due to maximum length in the URL.”

So I made another forum conversation, that directly point to my problem.

[quote=296846:@ronaldo florendo]My first issue is the “url exceed of limit”. I didn’t received direct answer on that, except refer “to this” and "refer to this. "
Which I had a hard time digging it to find answer.[/quote]
URLs greater that a certain length are rejected because they are a common mechanism for hackers to inject arbitrary code into a web server. That said, most web servers impose a limit of some kind, and when we researched this, they’re all different.

Thanks Philip!

I made the SHOWURL and URLParameter works on my local PC. But I encountered problem after I upload it to CLOUD server.

[quote]Your best option is to integrate that webcam.js library directly into Xojo Web.[/quote] - That will be my problem. I don’t know javascript. Actually, I paid few box for that php program just to have webcam capture.

Hi Greg,

Thanks for the explanation. Its added to my knowledge.