User Function Teste()
Local oWsdl
Local xRet
Local aOps := {}
// Cria o objeto da classe TWsdlManager
oWsdl := TWsdlManager():New()
// Faz o parse de uma URL
xRet := oWsdl:ParseURL( "http://wsf.cdyne.com/WeatherWS/Weather.asmx?WSDL" )
if xRet == .F.
conout( "Erro: " + oWsdl:cError )
Return
endif
aOps := oWsdl:ListOperations()
if Len( aOps ) == 0
conout( "Erro: " + oWsdl:cError )
Return
endif
varinfo( "", aOps )
// Define a operação
xRet := oWsdl:SetOperation( "GetCityForecastByZIP" )
//xRet := oWsdl:SetOperation( aOps[1][1] )
if xRet == .F.
conout( "Erro: " + oWsdl:cError )
Return
endif
Return
|