Page 1 of 1

Hierarchical stage: Calling RESTful service with BASIC auth

Posted: Thu Aug 30, 2018 7:34 am
by KadetG
How to call RESTful webservice with BASIC auth from DataStage?

I tried to do it - specify BASIC auth in DataStage Hierarchical Stage but it does not send the header. I see in webservice log following:

Code: Select all

Starting testGet method...
host = x.x.x.x:8080
connection = Keep-Alive
user-agent = HTTP Step
I tryed the same in Pentaho and it works well:

Code: Select all

Starting testGet method...                 
authorization = Basic c2Rmc2Q6YXNkYXNk     
user-agent = Jakarta Commons-HttpClient/3.1
host = x.x.x.x:8080  


So "authorization": "Basic Qy1ORUhQOD ......" is missed.

Any links or troubleshooting info?

Posted: Thu Aug 30, 2018 1:08 pm
by eostic
...that output looks like a trace of some kind. Please describe what you are doing inside the REST Step, the options you chose, etc.

Ernie

Posted: Fri Aug 31, 2018 1:48 am
by KadetG
That is very simple job:
Hierarchical stage -> Peek

I didn't change any option of Hierarchical stage
On Assemble:
Overview - nothing to set here
Input Step - nothing to set here
REST Step
General tab
HTTP Method - Get
Reusable connection - not used
URL - my URL in form http://x.x.x.x:8080/UserManagement/rest ... ce/testGet
HTTP version - HTTP 1.1
Use proxy server - unchecked
Abort job on error - checked
Security tab
Authentication: Basic
Realm is empty
User name: UserName
Password: Password
Authentication encoding type: UTF-8
Request tab
No changes (Load the outgoing body unchecked)
Headers/Cookies not filled
Response tab
Pass the received body to Cheched
A text node name body in the Output schema chosen
Content type: application/json
Headers/Cookies not filled
Mapping tab
As default: top - RESTRequest-GetRequest

Output Step:
Mapping:
I have two field which mapped to get StatusCode and body

When I run job it passing without error. And I getting following in log
Peek_3,0: a:200 b:{"response":[{"host":"x.x.x.x:8080"},{"connection":"Keep-Alive"},{"user-agent":"HTTP Step"}]}

But on Webservice log I see that Datastage doesn't send the header with basic authentication information.

Any idea?