Skip to Content (Press Enter)
OutSystems.com
Personal Edition
Community
Support
Training
Training
Online Training
Developer Schools
Boot Camps
Certifications
Tech Talks
Documentation
Documentation
Overview
ODC
O11
Forums
Forge
Get Involved
Get Involved
Jobs
Ideas
Members
Mentorship
User Groups
Platform
Platform
ODC
O11
Search in OutSystems
Log in
Get Started
Back to Forums
eric wang
26
Views
2
Comments
Solved
webservice
Question
Hi,
I have created a web service by PHP. When you visit the service link, it will return you a JSON file.
I want add a wrapper to the link by OutSystems link.
Example:
https://cit/webservice.php?stream={stream
}
This is a php webserice, when you pass the stream to it, it will return you a JSON file.
And I want to use
https://outsystems/webservice.aspx?stream={stream
} as a wrapper to it.
How can I do it? Thanks a lot.
Daniel Luz
Staff
Solution
Hi Eric,
Do you want your OS server in the middle?
The user sends a request to the OS server, then the OS server call your PHP service, then receives the response and sends it back to the user?
If that's the case, I would suggest first you consume your PHP REST service in the OS platform (if you haven't done it before, check
this
).
Then in your page you invoke that service in the preparation and terminate your flow with a Download node, setting the File Content to be the output from your service invocation, Mime-type to "application/json" and Save to Disk to No.
This method allows you to achieve what ou describe, but there are simpler ways of achieving pretty much the same.
For example, you can do the first step the same way and then expose a REST API in OS (check
this
if you don't know how) that all it does is invoke your PHP service and returns the response. In this case the URL will be different (instead of webservice.aspx?stream=... it would be webservice?stream=...) but it's a simpler implementation if you don't care for that detail. You can call your method whatever you want of course, it just won't have the .aspx extension.
Hope this helps.
Let me know if it doesn't.
Cheers,
Daniel
1 reply
18 Feb 2016
Show thread
Hide thread
eric wang
Daniel Luz
wrote:
Hi Eric,
Do you want your OS server in the middle?
The user sends a request to the OS server, then the OS server call your PHP service, then receives the response and sends it back to the user?
If that's the case, I would suggest first you consume your PHP REST service in the OS platform (if you haven't done it before, check
this
).
Then in your page you invoke that service in the preparation and terminate your flow with a Download node, setting the File Content to be the output from your service invocation, Mime-type to "application/json" and Save to Disk to No.
This method allows you to achieve what ou describe, but there are simpler ways of achieving pretty much the same.
For example, you can do the first step the same way and then expose a REST API in OS (check
this
if you don't know how) that all it does is invoke your PHP service and returns the response. In this case the URL will be different (instead of webservice.aspx?stream=... it would be webservice?stream=...) but it's a simpler implementation if you don't care for that detail. You can call your method whatever you want of course, it just won't have the .aspx extension.
Hope this helps.
Let me know if it doesn't.
Cheers,
Daniel
Hi Daniel,
Thank you so much for the reply, and it`s very helpful.
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
See the full guidelines
Loading...