how configure Ensemble web service to use HTTP Basic authenication

Primary tabs

SOAP, Ensemble

Hello, trying to figure out how to configure an Ensemble web service to use HTTP Basic authentication.  I have a web service client that will not be able to send SOAP headers.  I did not see that option at all in the documentation.  thanks

  • 0
  • 0
  • 621
  • 6

Replies

Hi Mike. 

Have you already tried setting up  a Credentials record (with username and password paid via Ensemble > Configure > Credentials), and then specifying the credentials record which will be a setting in the Ensemble business operation ?

This has worked form me before with Web services that require basic authentication.

Regards

Steve

Hi Mike. 

Have you already tried setting up  a Credentials record (with username and password paid via Ensemble > Configure > Credentials), and then specifying the credentials record which will be a setting in the Ensemble business operation ?

This has worked form me before with Web services that require basic authentication.

Regards

Steve

Hi Mike

Have you tried setting up a Credentials  record with username and password pair in Ensemble  (Configure>Credentials) - then specifying the credentials name in Settings for the Ensemble u business operation ?

This has worked for me before for Web services that require basic authentication.

Steve

Thanks Steve.  in this case Ensemble is hosting the web service, and my client is a JCAPS app.  But I did figure out how to have JCAPS send the SOAP hdr.

Here's what I do:

authorization64 = $G(pInput.Attributes("authorization"))
// ? valid
if ($PIECE(authorization64," ",1) '= "Basic"){
Status = ##class(%SYSTEM.Status).Error(5001, "Missing basic http authentication")
Throw ##class(%Exception.StatusException).CreateFromStatus(Status)
}
//  basic http authentication looks like this: "Basic amFhcDphYXA="
authorization = $System.Encryption.Base64Decode($PIECE(authorization64," ",2))
// decoded it looks like this: "username:password"
username = $PIECE(authorization,":",1)
password = $PIECE(authorization,":",2)