webservice

  

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:
Http://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 Http://outsystems/webservice.aspx?stream={stream} as a wrapper to it.
How can I do it? Thanks a lot.
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
Solution
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.