-
Notifications
You must be signed in to change notification settings - Fork 158
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
wsdl2go issues #65
Comments
Working example one: type AuthenticateResponse struct {
ResSession string `xml:"resSession,omitempty" json:"resSession,omitempty" yaml:"resSession,omitempty"`
}
func (p *handleSearchPort) Authenticate(reqUsername string, reqPassword string, reqOptions interface{}) (β AuthenticateResponse, err error) {
α := struct {
XMLName xml.Name `xml:"tns:Authenticate"`
ReqUsername string `xml:"reqUsername,omitempty"`
ReqPassword string `xml:"reqPassword,omitempty"`
ReqOptions interface{} `xml:"reqOptions,omitempty"`
}{
ReqUsername: reqUsername,
ReqPassword: reqPassword,
ReqOptions: reqOptions,
}
γ := struct {
XMLName xml.Name `xml:"Envelope"`
Body struct {
M AuthenticateResponse `xml:"AuthenticateResponse"`
}
}{}
if err = p.cli.RoundTripWithAction("Authenticate", α, &γ); err != nil {
return AuthenticateResponse{}, err
}
return γ.Body.M, nil
} Working example two (which i prefer): type AuthenticateRequest struct {
XMLName xml.Name `xml:"tns:Authenticate"`
ReqUsername string `xml:"reqUsername,omitempty" json:"reqUsername,omitempty" yaml:"reqUsername,omitempty"`
ReqPassword string `xml:"reqPassword,omitempty" json:"reqPassword,omitempty" yaml:"reqPassword,omitempty"`
ReqOptions interface{} `xml:"reqOptions,omitempty" json:"reqOptions,omitempty" yaml:"reqOptions,omitempty"`
}
type AuthenticateResponse struct {
ResSession string `xml:"resSession,omitempty" json:"resSession,omitempty" yaml:"resSession,omitempty"`
}
func (p *handleSearchPort) Authenticate(α AuthenticateRequest) (β AuthenticateResponse, err error) {
γ := struct {
XMLName xml.Name `xml:"Envelope"`
Body struct {
M AuthenticateResponse `xml:"AuthenticateResponse"`
}
}{}
if err = p.cli.RoundTripWithAction("Authenticate", α, &γ); err != nil {
return AuthenticateResponse{}, err
}
return γ.Body.M, nil
} I don't know anything about soap or xml communication in general, i only try to rebuild the communication from a existing perl application to go. |
Hey, this is what the header field in soap.Client is for. When you instantiate your Client, you can set its Header to any struct that you want, for example your |
I think you missunderstood the issue, i was talking about the wsdl2go converting. |
Oops. This is definitely something else. |
Tracking in #74. |
@Fank @fiorix I figured out whats the problem (at least for the wrong structure - for parameters not beeing used see #74 ). The problem is, that wsdl2go does not correctly honor the See here for examples and implications: I will issue a PR to fix this. |
wsdl: http://soap.brokerbin.com/brokerbin_search/search.wsdl
Cut from generated go file:
HandleSearchPort
is empty which causes:Authenticate
andSearch
will only transport first parameter e.g. forAuthenticate
:Expected or needed request for linked wsdl above:
The main difference is that
Message
(in first) is replaced by a "message"tns:Authenticate
(in second) which also containsreqUsername
(akaα
) andreqPassword
(akareqPassword
).Got same issues for other wsdl files, but this is the easiest example, to explain.
The text was updated successfully, but these errors were encountered: