Last active
February 6, 2016 22:04
-
-
Save dmichael/5473106 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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❤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