VBScript
The example VBScript builds a properly formatted SOAP envelope that is posted to the web service API which in turn sends back a response. This response is used to determine success or failure of the web service call.
The script can be reused for other methods by changing the Method name and the appropriate parameters for the SOAP envelope.
strAppPortalServer = "WS07"
Method = "createNewCatalogItem"
 
URL = "http://" & strAppPortalServer & "/esd/api.asmx"
<span class="Screen_Output">'Do not change this line
        
nsUrl = "http://sccmexpert.local/API"
 
Title = "Sample API Application"
Description = "Sample Description"
Visible = "true"
ImageFileName = "software.png"
PackageServer = "SMS01"
SMSPackageID = "SMX00A29"
SMSPackageData =   "0|0|InstallInteractive" 
TemplatePackageID = "846"
CategoryNames = "Software,Adobe"
GroupNames = "smx\domain admins"
MembershipType = "1"
CreateInventoryRecord = "true"
SCCMInventoryAttributes =  ""
 
' Create the http request text
<span class="Screen_Output">Dim strSoapReq
strSoapReq = GenerateSoapBodyStart()
strSoapReq = strSoapReq + GenerateSoapFunctionCallStart(Method)
strSoapReq = strSoapReq + GenerateSoapParameter("Title", Title)
strSoapReq = strSoapReq + GenerateSoapParameter("Description", Description)
strSoapReq = strSoapReq + GenerateSoapParameter("Visible", Visible)
strSoapReq = strSoapReq + GenerateSoapParameter("ImageFileName", ImageFileName)
strSoapReq = strSoapReq + GenerateSoapParameter("PackageServer", PackageServer)
strSoapReq = strSoapReq + GenerateSoapParameter("SMSPackageID", SMSPackageID)
strSoapReq = strSoapReq + GenerateSoapParameter("SMSPackageData", SMSPackageData)
strSoapReq = strSoapReq + GenerateSoapParameter("TemplatePackageID", TemplatePackageID)
strSoapReq = strSoapReq + GenerateSoapParameter("CategoryNames",  CategoryNames)
strSoapReq = strSoapReq + GenerateSoapParameter("GroupNames", GroupNames)
strSoapReq = strSoapReq + GenerateSoapParameter("MembershipType", MembershipType)
strSoapReq = strSoapReq + GenerateSoapParameter("CreateInventoryRecord", CreateInventoryRecord)
strSoapReq = strSoapReq + GenerateSoapParameter("SCCMInventoryAttributes", SCCMInventoryAttributes)
strSoapReq = strSoapReq + GenerateSoapFunctionCallEnd(Method)
strSoapReq = strSoapReq + GenerateSoapBodyEnd()
 
<span class="Screen_Output">Dim oHttp
<span class="Screen_Output">Dim strResult
<span class="Screen_Output">Set oHttp = CreateObject("Msxml2.XMLHTTP")
oHttp.open "POST", URL, <span class="Screen_Output">False
oHttp.setRequestHeader "Content-Type", "text/xml"
oHttp.setRequestHeader "SOAPAction", nsUrl + "/" & Method
oHttp.send strSoapReq
 
strResult = oHttp.responseText
 
WScript.echo(GetResult(strResult, Method & "Result"))
 
 
<span class="Screen_Output">Function GetResult(<span class="Screen_Output">byval responseText, <span class="Screen_Output">byval resultParam)
    
    <span class="Screen_Output">Dim oXml
    <span class="Screen_Output">Set oXml = CreateObject("Msxml2.DOMDocument")
    oXml.Async = <span class="Screen_Output">False
    oXml.LoadXml responseText
    
    <span class="Screen_Output">Dim strPath
    strPath = "/*/*/*/" + resultParam
    <span class="Screen_Output">Dim oNode
    <span class="Screen_Output">Set oNode = oXml.documentElement.SelectSingleNode(strPath)
    GetResult = oNode.Text
    
<span class="Screen_Output">End Function 
 
 
<span class="Screen_Output">Function GenerateSoapBodyStart()
    
    <span class="Screen_Output">Dim strSoap
    strSoap = "<?xml version=""1.0"" encoding=""utf-8""?>"
    strSoap = strSoap + "<soap12:Envelope "
    strSoap = strSoap + "xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" "
    strSoap = strSoap + "xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" "
    strSoap = strSoap + "xmlns:soap12=""http://www.w3.org/2003/05/soap-envelope"">"
    strSoap = strSoap + "<soap12:Body>"
    GenerateSoapBodyStart = strSoap
    
<span class="Screen_Output">End Function 
 
<span class="Screen_Output">Function GenerateSoapBodyEnd()
    
    <span class="Screen_Output">Dim strSoap
    strSoap = "</soap12:Body>"
    strSoap = strSoap + "</soap12:Envelope>"
    GenerateSoapBodyEnd = strSoap
    
<span class="Screen_Output">End Function
        
 
<span class="Screen_Output">Function GenerateSoapFunctionCallStart(<span class="Screen_Output">byval strFunction)
    
    <span class="Screen_Output">Dim strSoap
    strSoap = "<" + strFunction + " xmlns=""" + nsUrl + """>"
    GenerateSoapFunctionCallStart = strSoap
    
<span class="Screen_Output">End Function 
 
<span class="Screen_Output">Function GenerateSoapFunctionCallEnd(<span class="Screen_Output">byval strFunction)
    
    <span class="Screen_Output">Dim strSoap
    strSoap = "</" + strFunction + ">"
    GenerateSoapFunctionCallEnd = strSoap
    
<span class="Screen_Output">End Function 
 
<span class="Screen_Output">Function GenerateSoapParameter(<span class="Screen_Output">byval strParam, <span class="Screen_Output">byval strValue)
    
    <span class="Screen_Output">If strValue = "True" <span class="Screen_Output">Then
        strValue = "true"
    <span class="Screen_Output">End If
    
    <span class="Screen_Output">If strValue = "False" <span class="Screen_Output">Then
        strValue = "false"
    <span class="Screen_Output">End If
    
    <span class="Screen_Output">Dim strSoap
    
    strSoap = "<" + strParam + ">"
    strSoap = strSoap + strValue
    strSoap = strSoap + "</" + strParam + ">"
    
        
    GenerateSoapParameter = strSoap
    
<span class="Screen_Output">End Function
        
'Do not change this line
End Function
 
End Function