tiaguinho / gosoap

🦉SOAP package for Go
MIT License
508 stars 176 forks source link

Credentials adding for the endpoint #20

Closed avaussant closed 5 years ago

avaussant commented 5 years ago

Hello

Many thanks for your code, but i have an issue with my use case. It's possible to add credentials for SOAP endpoint with gosoap.

I have try with this option and the soap have an error like output:

func main() { soap, err := gosoap.SoapClient("https://enpoint_url") if err != nil { fmt.Errorf("error not expected: %s", err) } soap.HeaderParams = gosoap.Params{ "Authorization": "Basic" + basicAuth("user", "password"), }

avaussant commented 5 years ago

How we can manage the authentication with gosoap, can you give me a solution with your module.

Please

Many thanks

ulranh commented 5 years ago

You can do it with

soap.Username = "user" soap.Password = "pass"

tiaguinho commented 5 years ago

@avaussant the newest version, Username and Password are properties of the Client struct.