ah!
ok, i'll switch.
downloaded the proxy generator and gave it a try....
DO servicesproxy
loProxy = CREATEOBJECT("servicesProxy","V2")
loresult = loproxy.login(alltrim(misc.uktuser),alltrim(misc.uktdpass))
... but loresult is NULL. cErrorMessage is empty.
any thoughts would be much appreciated....
thanks
n
*** Dependencies - DO servicesproxy.prg DO wwDotNetBridge SET PROCEDURE TO servicesproxy ADDITIVE #IF .F. ****************** *** USAGE EXAMPLE ****************** *** Load Proxy Class and Dependencies DO servicesproxy *** Create Proxy Instance & specify .NET version loProxy = CREATEOBJECT("servicesProxy","V2") *** Call your methods and retrieve result lcResult = loProxy.YourMethod("Parm1",22.12) *** Check for error message if result is failing ? loProxy.cErrorMsg #ENDIF ************************************************************* DEFINE CLASS servicesProxy AS Custom ************************************************************* *: Generated with West Wind .NET Web Service Proxy Generator *: Created: 05/08/12 12:33:03 PM *: *: It's recommended you don't modify this class as it may be *: regenerated. If you need customization use a subclass in *: separate PRG file that overrides behavior. ************************************************************* *** Stock Properties oBridge = null oService = null cServiceUrl = "https://www.uktenantdata.com/services.asmx" cWsdlUrl = "https://www.uktenantdata.com/services.asmx?wsdl" cAssemblyPath = LOWER(FULLPATH([servicesproxy.dll])) cComClass = "services.services" cErrorMsg = "" cErrorDetailXml = "" lError = .F. *** Holds any array based results DIMENSION aResult[1] ************************************************************************ * Init **************************************** *** Function: *** Assume: *** Pass: *** Return: ************************************************************************ FUNCTION Init(lcDotNetVersion,llNoLoad) IF !llNoLoad IF !this.LoadService(lcDotNetVersion) ERROR this.cErrorMsg ENDIF ENDIF ENDFUNC * Init ************************************************************************ * LoadService **************************************** *** Function: *** Assume: *** Pass: *** Return: ************************************************************************ FUNCTION LoadService(lcDotNetVersion) LOCAL loBridge as wwDotNetBridge IF ISNULL(this.oBridge) THIS.oBridge = CREATEOBJECT("wwDotNetBridge",lcDotNetVersion) IF !this.oBridge.Loadassembly(this.cAssemblyPath) this.cErrorMsg = this.oBridge.cErrorMsg RETURN .F. ENDIF ENDIF IF ISNULL(this.oService) this.oService = this.oBridge.Createinstance(this.cComClass) IF ISNULL(this.oService) this.cErrorMsg = this.oBridge.cErrorMsg RETURN .F. ENDIF *** For some reason accessing URL directly doesnt work - use indirect referencing *this.oService.Url = this.cServiceUrl this.oBridge.SetProperty(this.oService,"Url",this.cServiceUrl) ENDIF ENDFUNC * LoadService ************************************************************************ * isTokenValid **************************************** FUNCTION isTokenValid(tkn as Guid) as Boolean LOCAL loException as Exception, lvResult as Boolean THIS.lError = .F. this.cErrorMsg = "" lvResult = .F. TRY lvResult = this.oBridge.InvokeMethod(this.oService, "isTokenValid", tkn) CATCH to loException THIS.GetErrorDetail(loException) ENDTRY RETURN lvResult ENDFUNC * isTokenValid ************************************************************************ * login **************************************** FUNCTION login(email as String,pwd as String) as utdNugget LOCAL loException as Exception, lvResult as utdNugget THIS.lError = .F. this.cErrorMsg = "" lvResult = .F. TRY lvResult = this.oBridge.InvokeMethod(this.oService, "login", email,pwd) CATCH to loException THIS.GetErrorDetail(loException) ENDTRY RETURN lvResult ENDFUNC * login ************************************************************************ * addApplicants **************************************** FUNCTION addApplicants(tkn as Guid,id as Int32,apts as ApplicantArray) as Boolean LOCAL loException as Exception, lvResult as Boolean THIS.lError = .F. this.cErrorMsg = "" lvResult = .F. TRY lvResult = this.oService.addApplicants(tkn,id,@apts) CATCH to loException THIS.GetErrorDetail(loException) ENDTRY RETURN lvResult ENDFUNC * addApplicants ************************************************************************ * newApplication **************************************** FUNCTION newApplication(tkn as Guid,movedate as DateTime,rent as Int32,tenancyperiod as Int32,address as PostalAddress,apts as ApplicantArray,autoadjustshares as Boolean) as Int32 LOCAL loException as Exception, lvResult as Int32 THIS.lError = .F. this.cErrorMsg = "" lvResult = .F. TRY lvResult = this.oService.newApplication(tkn,movedate,rent,tenancyperiod,address,@apts,autoadjustshares) CATCH to loException THIS.GetErrorDetail(loException) ENDTRY RETURN lvResult ENDFUNC * newApplication ************************************************************************ * applicantRecommendation **************************************** FUNCTION applicantRecommendation(tkn as Guid,id as Int32) as RECOMMENDATION_ENUM LOCAL loException as Exception, lvResult as RECOMMENDATION_ENUM THIS.lError = .F. this.cErrorMsg = "" lvResult = .F. TRY lvResult = this.oBridge.InvokeMethod(this.oService, "applicantRecommendation", tkn,id) CATCH to loException THIS.GetErrorDetail(loException) ENDTRY RETURN lvResult ENDFUNC * applicantRecommendation ************************************************************************ * adjustApplicantsShare **************************************** FUNCTION adjustApplicantsShare(tkn as Guid,id as Int32,apts as ApplicantArray) as Boolean LOCAL loException as Exception, lvResult as Boolean THIS.lError = .F. this.cErrorMsg = "" lvResult = .F. TRY lvResult = this.oService.adjustApplicantsShare(tkn,id,@apts) CATCH to loException THIS.GetErrorDetail(loException) ENDTRY RETURN lvResult ENDFUNC * adjustApplicantsShare ************************************************************************ * applicantStatus **************************************** FUNCTION applicantStatus(tkn as Guid,id as Int32) as Int32 LOCAL loException as Exception, lvResult as Int32 THIS.lError = .F. this.cErrorMsg = "" lvResult = .F. TRY lvResult = this.oBridge.InvokeMethod(this.oService, "applicantStatus", tkn,id) CATCH to loException THIS.GetErrorDetail(loException) ENDTRY RETURN lvResult ENDFUNC * applicantStatus ************************************************************************ * applicationRecommendation **************************************** FUNCTION applicationRecommendation(tkn as Guid,id as Int32,rc as AGENT_RECOMMENDATION_ENUM) as Boolean LOCAL loException as Exception, lvResult as Boolean THIS.lError = .F. this.cErrorMsg = "" lvResult = .F. TRY lvResult = this.oBridge.InvokeMethod(this.oService, "applicationRecommendation", tkn,id,rc) CATCH to loException THIS.GetErrorDetail(loException) ENDTRY RETURN lvResult ENDFUNC * applicationRecommendation ************************************************************************ * applicantCreditReport **************************************** FUNCTION applicantCreditReport(tkn as Guid,id as Int32) as CreditReport LOCAL loException as Exception, lvResult as CreditReport THIS.lError = .F. this.cErrorMsg = "" lvResult = .F. TRY lvResult = this.oBridge.InvokeMethod(this.oService, "applicantCreditReport", tkn,id) CATCH to loException THIS.GetErrorDetail(loException) ENDTRY RETURN lvResult ENDFUNC * applicantCreditReport ************************************************************************ * GetErrorDetail **************************************** *** Function: Internal method to pick up error information *** from exceptions ************************************************************************ PROTECTED FUNCTION GetErrorDetail(loException,laError) LOCAL loException, loType, lcTypeName this.lError = .T. this.cErrorDetailXml = "" this.cErrorMsg = loException.Message IF AT("OLE ",this.cErrorMsg) > 0 AND AT(":",this.cErrorMsg) > 0 this.cErrorMsg = ALLTRIM(SUBSTR(this.cErrorMsg,AT(":",this.cErrorMsg) + 1)) ENDIF *** Make sure we're dealing with a SOAP Exception loException = THIS.oBridge.oDotnetBridge.LastException IF ISNULL(loException) OR ISNULL(loException.InnerException) RETURN ENDIF IF TYPE("loException.InnerException") = "O" loException = loException.InnerException ENDIF loType = this.oBridge.InvokeMethod(loException,"GetType") lcTypeName = this.oBridge.GetProperty(loType,"Name") IF lcTypeName != "SoapException" RETURN ENDIF *** Grab the full XML Error Detail block this.cErrorDetailXml = this.oBridge.GetPropertyEx(loException,"Detail.OuterXml") ENDFUNC * GetErrorDetail ENDDEFINE