Skip to content

Commit

Permalink
Merge pull request tiaguinho#32 from ejosvp/master
Browse files Browse the repository at this point in the history
composite header params
  • Loading branch information
tiaguinho authored Jun 25, 2019
2 parents 01117f8 + 51fe9bb commit d0cdc72
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
10 changes: 1 addition & 9 deletions encode.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,8 @@ func (c process) MarshalXML(e *xml.Encoder, _ xml.StartElement) error {
tokens.startEnvelope()
if len(c.Client.HeaderParams) > 0 {
tokens.startHeader(c.Client.HeaderName, c.Client.Definitions.Types[0].XsdSchema[0].TargetNamespace)
for k, v := range c.Client.HeaderParams {
t := xml.StartElement{
Name: xml.Name{
Space: "",
Local: k,
},
}

tokens.data = append(tokens.data, t, xml.CharData(v), xml.EndElement{Name: t.Name})
}
tokens.recursiveEncode(c.Client.HeaderParams)

tokens.endHeader(c.Client.HeaderName)
}
Expand Down
2 changes: 1 addition & 1 deletion soap.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
)

// HeaderParams holds params specific to the header
type HeaderParams map[string]string
type HeaderParams map[string]interface{}

// Params type is used to set the params in soap request
type Params map[string]interface{}
Expand Down

0 comments on commit d0cdc72

Please sign in to comment.