Skip to content

Commit 67371f6

Browse files
committed
Do not generate operation if it has not a SOAP action.
This works around panic issue when WSDLs declare HTTP bindings
1 parent c098225 commit 67371f6

File tree

1 file changed

+18
-16
lines changed

1 file changed

+18
-16
lines changed

generator/operations_tmpl.go

+18-16
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,25 @@ var opsTmpl = `
2121
{{$soapAction := findSoapAction .Name $portType}}
2222
{{$output := findType .Output.Message}}
2323
24-
{{if gt $faults 0}}
25-
/**
26-
* Error can be either of the following types:
27-
* {{range .Faults}}
28-
* - {{.Name}} {{.Doc}}{{end}}
29-
*/
30-
{{end}}
31-
{{if ne .Doc ""}}// {{.Doc}}{{end}}
32-
func (service *{{$portType}}) {{makePublic .Name}} (request *{{$requestType}}) (*{{$output}}, error) {
33-
response := &{{$output}}{}
34-
err := service.client.Call("{{$soapAction}}", request, response)
35-
if err != nil {
36-
return nil, err
37-
}
24+
{{if ne $soapAction ""}}
25+
{{if ne .Doc ""}}// {{.Doc}}{{end}}
26+
{{if gt $faults 0}}
27+
//
28+
// Error can be either of the following types:
29+
// {{range .Faults}}
30+
// - {{.Name}} {{.Doc}}{{end}}
31+
//
32+
{{end}}
33+
func (service *{{$portType}}) {{makePublic .Name}} (request *{{$requestType}}) (*{{$output}}, error) {
34+
response := &{{$output}}{}
35+
err := service.client.Call("{{$soapAction}}", request, response)
36+
if err != nil {
37+
return nil, err
38+
}
3839
39-
return response, nil
40-
}
40+
return response, nil
41+
}
42+
{{end}}
4143
{{end}}
4244
{{end}}
4345
`

0 commit comments

Comments
 (0)