SetWebReferenceProxy for consuming REST API

Hi all,

Is it possible to use SetWebReferenceProxy action of EnhancedWebReferences API for consuming REST API?
https://success.outsystems.com/Documentation/10/Reference/OutSystems_APIs/EnhancedWebReferences_API#SetWebReferenceProxy

I couldn't find a valid WebReferenceName when I attempted.


Best regards.

@Takasi

I believe you'll have to use the On Before Request property of your REST API to then call an action to set the proxy before calling the service.

You'll have to do an extension probably...


Edit: EnhancedWebReferences will not work with REST.

Solution

Hi Takasi,

The EnhancedWebReferences just works with SOAP services. To use with REST you will need to use an extension, for instance this one: https://www.outsystems.com/forge/component/3361/restproxy/

Notice that you should call SetProxy in a OnBeforeRequest(Advanced) of your rest call. If you use the regular OnBeforeRequest this will not works.


Best Regards

Fabio Fantato

  

Solution

Hello João and Fábio,

Thank you for replying.

I noticed that there are no parameters for OnBeforeRequest(Advanced) action.
Do I need to write my own extension to modify request header at the OnBeforeRequest(Advanced) action?

Best regards,

If you are using OnBeforeRequest(Advanced) you need just to Call SetProxy(host,username,password) for that extension I post before.  

You could use a site properties for instance to set those parameters.



Hello Fábio, 

Your first reply helped me to understand how to use SetProxy. Thank you very much.

My current question is about using both proxy and custom HTTP headers.
Next page seems to indicate the need of custom extension.
https://success.outsystems.com/Documentation/10/Extensibility_and_Integration/REST/Consume_REST_APIs/Advanced_Customizations

Hi Takasi Moriya


Are you able to do both the things, proxy and custom HTTP headers.


Please let me know if someone fixed this.


Thanks

Atul

Hello Atul,

Are you able to do both the things, proxy and custom HTTP headers.

In those days, I achieved by using both RestProxy and an extension included in Box Connector module.

Box Connector
https://www.outsystems.com/forge/586/box-connector

Box Connector module includes HttpAllowAutoRedirect extension which has AddHttpHeader action.

I hope this information helps you.

Sincerely,
Moriya Takasi

Takasi Moriya wrote:

Hello Atul,

Are you able to do both the things, proxy and custom HTTP headers.

In those days, I achieved by using both RestProxy and an extension included in Box Connector module.

Box Connector
https://www.outsystems.com/forge/586/box-connector

Box Connector module includes HttpAllowAutoRedirect extension which has AddHttpHeader action.

I hope this information helps you.

Sincerely,
Moriya Takasi

That would definitely help. Thanks