From 38f8dbf76c816cdd5530f39a84a7a92eec67f3bb Mon Sep 17 00:00:00 2001 From: Grant Gongaware Date: Fri, 1 Feb 2019 11:01:24 -0800 Subject: [PATCH] include ctx parameters in WSDL template outputs --- header_tmpl.go | 1 + operations_tmpl.go | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/header_tmpl.go b/header_tmpl.go index 21c703f..1693000 100644 --- a/header_tmpl.go +++ b/header_tmpl.go @@ -10,6 +10,7 @@ var headerTmpl = ` package {{.}} import ( + "context" "encoding/xml" "time" "github.com/hooklift/gowsdl/soap" diff --git a/operations_tmpl.go b/operations_tmpl.go index 7c9a8b4..4422c26 100644 --- a/operations_tmpl.go +++ b/operations_tmpl.go @@ -41,9 +41,9 @@ var opsTmpl = ` {{$requestType := findType .Input.Message | replaceReservedWords | makePublic}} {{$soapAction := findSOAPAction .Name $privateType}} {{$responseType := findType .Output.Message | replaceReservedWords | makePublic}} - func (service *{{$privateType}}) {{makePublic .Name | replaceReservedWords}} ({{if ne $requestType ""}}request *{{$requestType}}{{end}}) (*{{$responseType}}, error) { + func (service *{{$privateType}}) {{makePublic .Name | replaceReservedWords}} (ctx context.Context, {{if ne $requestType ""}}request *{{$requestType}}{{end}}) (*{{$responseType}}, error) { response := new({{$responseType}}) - err := service.client.Call("{{$soapAction}}", {{if ne $requestType ""}}request{{else}}nil{{end}}, response) + err := service.client.Call(ctx, "{{$soapAction}}", {{if ne $requestType ""}}request{{else}}nil{{end}}, response) if err != nil { return nil, err }