Skip to content

Commit

Permalink
Do not generate operation if it has not a SOAP action.
Browse files Browse the repository at this point in the history
This works around panic issue when WSDLs declare HTTP bindings
  • Loading branch information
c4milo committed Sep 1, 2014
1 parent c098225 commit 67371f6
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions generator/operations_tmpl.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,25 @@ var opsTmpl = `
{{$soapAction := findSoapAction .Name $portType}}
{{$output := findType .Output.Message}}
{{if gt $faults 0}}
/**
* Error can be either of the following types:
* {{range .Faults}}
* - {{.Name}} {{.Doc}}{{end}}
*/
{{end}}
{{if ne .Doc ""}}// {{.Doc}}{{end}}
func (service *{{$portType}}) {{makePublic .Name}} (request *{{$requestType}}) (*{{$output}}, error) {
response := &{{$output}}{}
err := service.client.Call("{{$soapAction}}", request, response)
if err != nil {
return nil, err
}
{{if ne $soapAction ""}}
{{if ne .Doc ""}}// {{.Doc}}{{end}}
{{if gt $faults 0}}
//
// Error can be either of the following types:
// {{range .Faults}}
// - {{.Name}} {{.Doc}}{{end}}
//
{{end}}
func (service *{{$portType}}) {{makePublic .Name}} (request *{{$requestType}}) (*{{$output}}, error) {
response := &{{$output}}{}
err := service.client.Call("{{$soapAction}}", request, response)
if err != nil {
return nil, err
}
return response, nil
}
return response, nil
}
{{end}}
{{end}}
{{end}}
`

0 comments on commit 67371f6

Please sign in to comment.