hooklift / gowsdl

WSDL2Go code generation as well as its SOAP proxy
Mozilla Public License 2.0
1.14k stars 390 forks source link

Possibility to update http header later to http client. #246

Closed JayasuriyanRP closed 4 months ago

JayasuriyanRP commented 1 year ago

Possibility to add http header later to http client. Possibility for assigning Authorization header to http client

JayasuriyanRP commented 1 year ago

In my case there is a system in between SOAP server which authenticates with Keycloak and I would need to pass the Authorization token in every call with the fresh token in HTTP Header.

for _, client := range clients {
    allHeaders := make(map[string]string)

    for key, value := range client.GetHttpClientHeaders() {
        allHeaders[key] = value
    }
    allHeaders["Authorization"] = token
    client.SetHttpClientHeaders(allHeaders)
}
all2ham commented 6 months ago

@c4milo can we merge this I need this functionality as well