In a previous post, I referenced how the Excel web services toolkit buils class code for SOAP. I decided to test going directly to the wdsl function as the class code is a bit verbose. The code below if modified for Winbatch or as vbscript in a .wsc file works... but fails on oSOAP.MSSoapInit2 in VBA. Why? Stan

[vba]
sub getweather()
Dim oSOAP, cZip, c_WSDL_URL, c_SERVICE, c_PORT, c_SERVICE_NAMESPACE, c_WSML
c_WSDL_URL = "http://ws.cdyne.com/WeatherWS/Weather.asmx?wsdl"
c_SERVICE = "Weather"
c_PORT = "WeatherSoap"
c_SERVICE_NAMESPACE = "http://ws.cdyne.com/WeatherWS/"
c_WSML = "<servicemapping>"
c_WSML = c_WSML & "<service name='Weather'>"
c_WSML = c_WSML & "<using PROGID='MSOSOAP.GenericCustomTypeMapper30' cachable='0' ID='GCTM'/>"
c_WSML = c_WSML & "<types>"
c_WSML = c_WSML & "<type name='ForecastReturn' targetNamespace='http://ws.cdyne.com/WeatherWS/' uses='GCTM' targetClassName='struct_ForecastReturn'/>"
c_WSML = c_WSML & "<type name='POP' targetNamespace='http://ws.cdyne.com/WeatherWS/' uses='GCTM' targetClassName='struct_POP'/>"
c_WSML = c_WSML & "<type name='WeatherDescription' targetNamespace='http://ws.cdyne.com/WeatherWS/' uses='GCTM' targetClassName='struct_WeatherDescription'/>"
c_WSML = c_WSML & "<type name='WeatherReturn' targetNamespace='http://ws.cdyne.com/WeatherWS/' uses='GCTM' targetClassName='struct_WeatherReturn'/>"
c_WSML = c_WSML & "<type name='temp' targetNamespace='http://ws.cdyne.com/WeatherWS/' uses='GCTM' targetClassName='struct_temp'/>"
c_WSML = c_WSML & "</types>"
c_WSML = c_WSML & "</service>"
c_WSML = c_WSML & "</servicemapping>"
Set oSOAP = New SoapClient30
oSOAP.MSSoapInit2 c_WSDL_URL, c_WSML, c_SERVICE, c_PORT, c_SERVICE_NAMESPACE

cZip = "27603"
oNodeList = oSOAP.GetCityForecastByZIP(cZip)
Set oSOAP = Nothing
strXml = ""
For Each oNode In oNodeList
strXml = strXml & oNode.XML & vbCrLf
Next
Set oNode = Nothing
Set oNodeList = Nothing
MsgBox strXml
End Sub

[/vba]