WmPublic Pck: pub.client:restClient

I’m using restClient built server to call restful service. However I have to pass bearer token in header but i don’t know which fields to use pass the bear token.

In Postman I’m using as ,

In IS designer, can any one help me how i will do this?

Thanks,

Hi Zeeshan,
Please check this thread. thanks!

Hi @ArulChristhuRaj,
The steps are not cleared. I tried my best but no luck.
Thanks.

Map the token to auth/token. Set auth/type to Bearer.

1 Like

As per official document, This service is entirely internal to Integration Server and must not execute this service manually. So no point to discuss and discussion is over.

What document are you referring to? pub.client:restClient is not “internal to Integration Server” It is publicly available to be called.

Integration_Server_Built_In_Services_Reference document. Paste the line snippet here,

Interesting. I have the reference document, Version 10.5, October 2019, and it does not have that note. Though I see it in the online version. This service was just added in 10.5. It would be interesting to get clarification from SAG on this. Normally, “internal only” services are not documented in the reference guide. The note stating “you must not execute this service manually” is a bit ambiguous. Executing a service manually means something specific and different from using it in a FLOW service.

The main caveat about making manual changes to the generated connector service is that your customizations will be lost if you re-generate the connector service.

I tried to find info about managing auth via the RAD connector service generated, without editing the connector service directly, but could not readily find it. Someone else have a pointer?

1 Like

Hi!
How did u resolve it?

Once you have the token (how to get that is not covered here) you can map it to auth/token and set auth/type to Bearer when calling pub.client:http. Presumably supported for pub.client:restClient too as it has the same vars defined – but as noted above, it is unclear if restClient is intended for our use.

Apparently the method does not support it. Im afraid I have to use client:http. Im trying with restClient but not work. pub.client.restCliente service apikey auth 401

It is a true headache.

Im going to use httpClient, thank you for your reply.

Hi,

For such use case better to use httpClient service. The pub.client:restClient service is meant for internal use only and requires some parameters which are generated runtime only so it can’t be used independently. The httpClient service should be sufficient in itself for this purpose.

Thanks

I agree that using pub.client:http is the way to go. But it is very curious to me that pub.client:restClient is in the WmPublic package and is documented in the reference guide (though it seems out of date) but it is for “internal” use only. Typically, such services are 1) not in WmPublic; 2) not documented.

Can anyone shed light on why that is and what the future plan for that service might be? Was it mistakenly exposed?

1 Like

Hi, reamon,

No this was not mistakenly exposed. pub.client:restClient is used in association with the Swagger First Consumer. When the consumer is created each of the rest APIs in the swagger is created as a connector service and we use the restclient service to perform the actual invocation of the API. As the users see this service being present in the connector service, we are forced to put the restClient in the WmPublic. Hence we have documented the usage to be strictly internal along with the Swagger First Consumer.

Regards,
Sree

This topic was automatically closed after 1083 days. New replies are no longer allowed.