//============================================================================== // // cRdcLicence: SOAP Client class to call the CrossMerge Licence Service // //============================================================================== Use cSoapClient.pkg Class cRdcLicence Is A cSoapClient Procedure Construct_Object Forward Send Construct_Object Property String psSerialNo "" Property String psUnlockCode "" Property String psUnlockKey "" End_Procedure // Construct_Object Procedure Reset Forward Send Reset Set psSerialNo To "0" Set psUnlockCode To "" Set psUnlockKey To "" End_Procedure // Reset Function GetLicence String sUser String sEmail String sCust Integer iType Returns Boolean Handle hoXML hoEnv hoBody hoResp hoElmt String sECode sEStr sCode sKey sText Integer iSerial // Set up call: Send Reset Set psServer To "www.asckey.com" Set piPort To 80 Set psURN To "/rdc/licence.asp" Set psAction To "getLicence" Set psMethod To "getLicence" Set psMethodNsUri To "http://www.asckey.com/rdc" Set psMethodNsPre To "n" Send AddStringArg "user" sUser Send AddStringArg "email" sEmail Send AddStringArg "customer" sCust Send AddStringArg "type" iType // Make call to Web-service: Move (CallFullXML(Self)) To hoXML If (hoXML = 0) Begin Move ("Failed to retrieve licence. There could be a number of reasons for this:\n\n1. Do you have a working Internet connection?\n2. Have you entered all the information correctly?\n") To sText Move (sText + "3. Our Web server may be down temporarily.\n\nIf you suspect number 3 please Send us an e-mail at support@crossmerge.com") To sText Function_Return (SoapError(Self, sText)) End // If (hoXML = 0) Begin Get DocumentElement Of hoXML To hoEnv Move (FindChild(hoEnv, "Body", "", "")) To hoBody Send Destroy To hoEnv Get FirstChild Of hoBody To hoResp Send Destroy To hoBody If (NamePost(psNodeName(hoResp)) = "Fault") Begin Move (FindChild(hoResp, "faultcode", "", "")) To hoElmt If (hoElmt <> 0) Move (psText(hoElmt)) To sECode Else Move "" To sECode Send Destroy To hoElmt Move (FindChild(hoResp, "faultstring", "", "")) To hoElmt If (hoElmt <> 0) Move (psText(hoElmt)) To sEStr Else Move "" To sEStr Send Destroy To hoElmt Send Destroy To hoResp Send Destroy To hoXml Function_Return (SoapError(Self, (sECode * "-" * sEStr))) End Move (FindChild(hoResp, "serialNumber", "", "")) To hoElmt If (hoElmt <> 0) Move (psText(hoElmt)) To iSerial If (hoElmt <> 0) Send Destroy To hoElmt Move (FindChild(hoResp, "unlockCode", "", "")) To hoElmt If (hoElmt <> 0) Move (psText(hoElmt)) To sCode If (hoElmt <> 0) Send Destroy To hoElmt Move (FindChild(hoResp, "unlockKey", "", "")) To hoElmt If (hoElmt <> 0) Move (psText(hoElmt)) To sKey If (hoElmt <> 0) Send Destroy To hoElmt Send Destroy To hoResp Send Destroy To hoXml Set psSerialNo To iSerial Set psUnlockCode To sCode Set psUnlockKey To sKey Function_Return True End_Function // GetLicence End_Class // cRdcLicence