Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Making use of the GetListContents function, this example shows how to retrieve contact list entries.
#!/bin/bash
(
cat <<EOF
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://wwCw.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<GetListContents xmlns="http://call-em-all.com/">
<myRequest>
<username>##U##</username>
<pin>##P##</pin>
<listID>##L##</listID>
</myRequest>
</GetListContents>
</soap:Body>
</soap:Envelope>
EOF
) > GetListContents.xml
(
cat &lt;&lt;EOF
&lt;?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
&lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
&lt;xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
&lt;xsl:template match="soapenv:Body">
&lt;xsl:copy-of select="child::node()"/>
&lt;/xsl:template>
&lt;/xsl:stylesheet>
EOF
) > cleanit.xsl
clear
echo
echo
echo -n "Enter your Username : "
read username
echo
echo -n "Enter your pin (will not echo) :"
read -s pin
echo
echo
echo -n "Enter the ListID to retrieve :"
read listid
echo
cat GetListContents.xml | sed -e s/##U##/"$username"/g | sed -e s/##P##/"$pin"/g | sed -e s/##L##/"$listid"/g > glc.xml
clear
curl -H "Content-Type: text/xml; charset=utf-8" \
-H "SOAPAction:http://call-em-all.com/GetListContents" \
-d@glc.xml \
http://staging-api.call-em-all.com/webservices/ceaapi_v2.asmx | xsltproc cleanit.xslt -
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.