2022-06-06 17:00:39 +00:00
|
|
|
{{define "service"}}
|
2022-06-08 06:05:49 +00:00
|
|
|
{{- $Imps := .Imps -}}
|
2022-06-06 17:03:17 +00:00
|
|
|
package {{.Manifest.Package}}
|
2022-06-06 17:00:39 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
{{- range .Imps.ImportLines}}
|
2022-06-08 06:30:01 +00:00
|
|
|
{{.Alias}} {{quote .Path}}
|
2022-06-06 17:00:39 +00:00
|
|
|
{{- end}}
|
|
|
|
)
|
2022-06-08 16:51:47 +00:00
|
|
|
|
|
|
|
const ServiceType = {{quote .Manifest.ServiceType}}
|
|
|
|
|
2022-06-06 17:00:39 +00:00
|
|
|
{{range .SCPD.SortedActions}}
|
|
|
|
{{- template "action" args "Action" . "Imps" $Imps}}
|
|
|
|
{{end}}
|
|
|
|
{{end}}
|
|
|
|
|
|
|
|
{{define "action"}}
|
2022-06-08 06:05:49 +00:00
|
|
|
{{- $Imps := .Imps}}
|
2022-06-08 16:51:47 +00:00
|
|
|
type {{.Action.Name}} struct{
|
|
|
|
Request {{.Action.Name}}Request
|
|
|
|
Response {{.Action.Name}}Response
|
|
|
|
}
|
|
|
|
|
|
|
|
var _ {{index $Imps.TypeRefByTypeName "SOAPActionInterface"}} = &{{.Action.Name}}{{"{}"}}
|
|
|
|
|
|
|
|
func (a *{{.Action.Name}}) ServiceType() string { return ServiceType }
|
|
|
|
func (a *{{.Action.Name}}) ActionName() string { return {{quote .Action.Name}} }
|
|
|
|
func (a *{{.Action.Name}}) RefRequest() any { return &a.Request }
|
|
|
|
func (a *{{.Action.Name}}) RefResponse() any { return &a.Response }
|
|
|
|
|
2022-06-08 06:05:49 +00:00
|
|
|
type {{.Action.Name}}Request struct
|
|
|
|
{{- template "args" args "Args" .Action.InArgs "Imps" $Imps}}
|
2022-06-06 17:00:39 +00:00
|
|
|
|
2022-06-08 06:05:49 +00:00
|
|
|
type {{.Action.Name}}Response struct
|
|
|
|
{{- template "args" args "Args" .Action.OutArgs "Imps" $Imps}}
|
2022-06-06 17:00:39 +00:00
|
|
|
{{- end}}
|
|
|
|
|
|
|
|
{{define "args"}}
|
2022-06-08 06:05:49 +00:00
|
|
|
{{- $Imps := .Imps -}}
|
|
|
|
{ {{- with .Args}}
|
|
|
|
{{- range .}}
|
2022-06-06 17:00:39 +00:00
|
|
|
{{.Name}} {{index $Imps.TypeRefByTypeName .RelatedStateVariable.DataType}}
|
2022-06-06 17:05:41 +00:00
|
|
|
{{- end}}
|
2022-06-08 06:05:49 +00:00
|
|
|
{{end -}} }
|
2022-06-06 17:00:39 +00:00
|
|
|
{{- end}}
|