Webservice fast license manager not accepting request
I want to use Quick License Manager SOAP webservice to connect e-commerce wordpress plugin to allow user to buy license and show it after successful purchase.
So now I am trying to call the GetProductInfo function to get information about an existing product that I created using the QLM Management Console.
I am using the PHP SoapClient class, but when I try to make a request, I get this response:
Validation request: The input is not a valid Base-64 string because it contains a non-base 64 character, more than two indents, or an invalid character among the padding characters., Caller: GetProductInfo
I don't understand what happened to my request, so I need help ... Here is the code I'm using:
<?php
$url = "https://quicklicensemanager.com/****/qlm/qlmservice.asmx";
$wsdl = $url . "?WSDL";
$soapClient = new SoapClient($wsdl, array(
"encoding" => "utf8",
"trace" => TRUE,
"version" => SOAP_1_1
));
$req = sprintf(
'<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<QlmSoapHeader xmlns="http://www.interactive-studios.net/qlmweb">
<CultureName>%s</CultureName>
<UtcOffset>%d</UtcOffset>
</QlmSoapHeader>
</soap:Header>
<soap:Body>
<GetProductInfo xmlns="http://www.interactive-studios.net/qlmweb">
<eProductName>%s</eProductName>
<productID>%d</productID>
<major>%d</major>
<minor>%d</minor>
</GetProductInfo>
</soap:Body>
</soap:Envelope>', "en_US", 0, "The IO plug-in: Student License", 4, 1, 0);
echo '<pre>';
print_r(htmlentities($req));
echo '</pre>';
$action = "http://www.interactive-studios.net/qlmweb/GetProductInfo";
$res = $soapClient->__doRequest($req, $url, $action, 1);
echo '<pre>';
print_r($res);
echo '</pre>';
echo "=======================================================";
echo '<pre>';
print_r(htmlentities($soapClient->__getLastRequest()));
echo '</pre>';
echo "=======================================================";
echo '<pre>';
print_r($soapClient->__getLastRequestHeaders());
echo '</pre>';
Thanks in advance for your help.
EDIT
Now I tried to change the product field id and it seems that this is the one that was wrong. So it should be a base64 string, so I updated my code:
</soap:Envelope>', "en_US", 0, "The IO plug-in: Student License", 4, 1, 0);
becomes</soap:Envelope>', "en_US", 0, base64_encode("The IO plug-in: Student License"), 4, 1, 0);
New error message:
Validation request: The length of the data to decrypt is invalid. Caller: GetProductInfo
source to share
After hours of searching, I found this in the documentation , on page 121:
Please note that all methods provided by the web service cannot be called with a URL except GetActivationKey and ActivateKey. All other web methods implement a secure authentication mechanism that only accepts requests from the QLM console.
So, since I was trying to call GetProductInfo, it couldn't work outside of the QLM console.
source to share