-
Notifications
You must be signed in to change notification settings - Fork 391
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suggestions for more idiomatic code #106
Comments
I welcome all the above improvements @anjmao. |
Here is some work I already did in my branch https://github.com/trackforce/gowsdl/tree/refactor-soap-client.
Idea is to pass soap client to each generated service so there is no complex call logic inside generated files. |
@anjmao I like those changes. We should probably initialize a go module for this library and tag it before introducing breaking changes. |
@c4milo I Agree for modules. I'm currently testing library with my changes by calling some of our production soap services, but I'm getting XML marshal/unmarshal errors. I added comment in my PR. |
* Generate public service interfaces * Move soap client to separate package * Add example folder closes #106
Hi,
This is not very friendly api to use. Instead it's a common practice in go to use ...option. These 2 functions which are both not flexible can be refactored to
Usage
It will also allow to stay backwards compatible add be able to add new config options in the feature.
It's not possible to set global request headers, for example there is hardcoded
req.Header.Set("User-Agent", "gowsdl/0.1")
, but service which I want to call checks if user-agent isname-x
otherwise to throws unauthorised fault error.This can be implemented simply by having
SOAPOption
RequestHeaders.There are log.Println statments inside code https://github.com/hooklift/gowsdl/blob/master/soap_tmpl.go#L268. This is bad when using docker and kubernetes. For example in my services all stdout logs a automatically pushed elastic search(kibana). In general print statements should be used only on some tracing mode enabled.
The text was updated successfully, but these errors were encountered: