Getting error response while trying to access REST webservice through Powerbuilder
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.
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)
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.