Created
July 9, 2010 14:50
-
-
Save StanAngeloff/469553 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
mapResponse: (string, block) -> | |
xml2object.parse string, (error, responseObject) => | |
if error | |
if block then block error else throw error | |
else | |
[root, map]: @responseMap | |
body: responseObject?['soap:Envelope']?['soap:Body']?[root] | |
if body | |
result: map2object body, map | |
if block then block null, result else result | |
else | |
error: new MapError "/soap:Envelope/soap:Body/$root" | |
if block then block error else throw error |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment