>OLE IDispatch execption code 0 from webservices.VFPWServices webservices.VFPWServices: >vfpwservices.saroshsays c:\program files\microsoft visual foxpro 7\webservices.prg >Error in line 59 OLE IDispatch execption code 0 from Client: >WSDLReader:Loading of the WSDL file failed HRESULT=0x80070057- >WSDLReader:XMLParser failed at linenumber 0, lineposition 0, >reason is:No data is available for the requested resource. HRESULT=0x1.. 1429.. >>
>Define Class VFPWServices As Session OlePublic > > Name = "VFPWServices" > > Procedure Compute(vcExpression As String) As Variant > Local lxReturn As Variant, lcOldError As String, llError As Boolean > > lcOldError = On("error") > On Error llError = .T. > > llError = .F. > lxReturn = Evaluate(vcExpression) > > If llError then > lxReturn = "#Error" > Endif > > If Empty(lcOldError) then > On Error > Else > On Error &lcOldError. > Endif > > Return lxReturn > Endproc > > Procedure GetStockPrice(vcSymbol As String) As Number > Local lnReturn As Number, lcOldError As String, llError As Boolean > LOCAL loWS > > lcOldError = On("error") > On Error llError = .T. > *-- If I remark the On Error line above then the line > *-- loWS.mssoapinit(....) a few lines below generates the error > > llError = .F. > lnReturn = -101 > > If Type("vcSymbol") = "C" And Not Empty(vcSymbol) then > > loWS = Createobject("mssoap.soapclient") > > IF VARTYPE(loWS) = "O" then > > *-- The line below generates the error > *-- if I remark the On Error statement a few lines above > > loWS.mssoapinit("http://www.xmethods.net/sd/StockQuoteService.wsdl") > *lnReturn = loWS.getquote("msft") > lnReturn = loWS.getquote(vcSymbol) > > Else > > lnReturn = -101 > > Endif > > Endif > > If llError then > lnReturn = -99 > Endif > > If Empty(lcOldError) then > On Error > Else > On Error &lcOldError. > Endif > > Return lnReturn > Endproc > >Enddefine >>