' get the command line parameter
dim objArgs
set objArgs = WScript.Arguments

' Create a new envelope object, 
'this is the core part of any pocketSOAP usage.
dim env
set env = CreateObject("pocketSOAP.Envelope.2")

' set the methodName and methodname Namespace values
env.SetMethod "getTemp", "urn:xmethods-Temperature"

' create the parameter, pass along the zip code the user types
' at the command line.
env.Parameters.Create "zipcode", objArgs(0)

' now, we need to send the SOAP request to the 
' endpoint, so we create a transport object
dim http
set http = CreateObject("pocketSOAP.HTTPTransport.2")

' we need to set the SOAPAction header
http.SOAPAction = ""
' now we send the request, the call to env.serialize, 
' takes the envelope object we've been working with
' and serializes it out to the SOAP/XML format for sending.
strLoc = "http://services.xmethods.net:80/soap/servlet/rpcrouter"
http.Send strLoc, env.serialize

' now, we need to parse the SOAP message we get as a response
env.parse http

' and now, extract the return value
wscript.echo "Temp for "&objArgs(0)&"="&env.Parameters.Item(0).Value

