Consulting

Results 1 to 6 of 6

Thread: SOAP Action fails

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Master stanl's Avatar
    Joined
    Jan 2005
    Posts
    1,141
    Location

    SOAP Action fails

    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

     
    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
    Last edited by Aussiebear; 04-06-2025 at 01:19 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •