Skip to content

Instantly share code, notes, and snippets.

@dmichael
Last active February 6, 2016 22:04
Show Gist options
  • Save dmichael/5473106 to your computer and use it in GitHub Desktop.
Save dmichael/5473106 to your computer and use it in GitHub Desktop.
// The dumb way to deal with SOAP requests
func userRequest(userId string) string {
template := soapify(userTemplate)
return fmt.Sprintf(template, userId)
}
func soapify(template string) string {
return fmt.Sprintf(soapTemplate, template)
}
const soapTemplate =
`<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://we&#x2764;namespaces.com/">
<soapenv:Header/>
<soapenv:Body>
%s
</soapenv:Body>
</soapenv:Envelope>`
const userTemplate =
`<github:user>
<arg0>%s</arg0>
</github:user>`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment