Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Getting error response while trying to access REST webservice through Powerbuilder

Hi Team,

I am trying to access a rest webservice through powerbuilder 12.5(.net).The rest webservice is secured through basic authentication.I am passing the userid and password through powerbuilder to acess the service,But its returning an error .But while i am trying to accss the same REST webservice through SOAPUI, i am able to get the response.

Please find the below line of code which i have written in powerbuilder.

p_testcleint2 lp_rest
string ls_string

lp_rest=create p_testcleint2

PBWebHttp.WebClientCredential lsCredential             //configure credentials
lsCredential = create PBWebHttp.WebClientCredential
lsCredential.AccessAuthentication = PBWebHttp.AuthenticationMode.Basic!
lp_rest.restConnectionObject.ClientCredential = lsCredential  //add credentials to connection

catch (System.Exception ee)
end try

Error i am getting as below :

The remote server returned an error:(401) unauthorized.

Can you please let me know why this error is coming or do i need to any extra paramert in the lsCredential to handle this.

Thanks in advance.



Former Member
Not what you were looking for? View more on this topic or Ask a question