Logout

Alt-N Discussion Groups > MDaemon Discussion Groups > MDaemon API > XML API broken with 19.5.1?

 [F] Alt-N Discussion Groups  / MDaemon Discussion Groups  / MDaemon API  /

XML API broken with 19.5.1?

[nils.petersen@psyma.com]
nils.petersen@p…
Novice
Novice
Posts: 147
nils.petersen@psyma.com - 09:25am, Nov 13 2019

(reposting from mdbeta)

As it seems, the update from 19.5.0 to 19.5.1 broke the XML API.

We're using various automating functions (GetDomainList, GetUserInfo, SetDynamicScreen) and all of them just return an empty string.
Nothing shows up in the detail logs in \MDaemon\Logs\MdMgmtSW\ either.

Anyone using XML API and got it still working?

This PHP snippet used to work with 19.5.0:
define('MDAPIURL', 'https://mdlogtracker:xxxxxxxxxx@mail.psyma.com:3002/MdMgmtWS');

    $xml=
    '<?xml version="1.0" encoding="utf-8"?>
    <MDaemon>
        <API>
            <Request version="19.5.0" echo="1" verbose="1">
                <Operation>GetDomainList</Operation>
                <Parameters>
                    <Get>
                        <Users/>
                    </Get>
                </Parameters>
            </Request>
        </API>
    </MDaemon>';

    $ch = curl_init(MDAPIURL);
    curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml'));
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $xml);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    $response = curl_exec($ch);
    var_dump($response);
    curl_close($ch);

Regards
Nils



--MD-API-------------------------------------------------------------
This list is for questions and discussions regarding MDAEMON's API.
To unsubscribe from this mailing list send an email to
md-api-unsubscribe@mdaemon.com .
--POWERED BY MDAEMON!------------------------------------------------

---------------------------------------------------------------------
These forums are provided by MDaemon Technologies for user-to-user 
support and discussion.  MDaemon staff members may participate in the 
forums periodically but please recognize that this is not the official
method of receiving technical support. To receive personal technical 
support please use the form here:
http://www.mdaemon.com/support/request_support.asp
---------------------------------------------------------------------

  (older msg: 5)All MessagesOldest ItemsOlder ItemsNewer ItemsNewest Items

nils.petersen@psyma.com (apparently) - Nov 19, 2019 6:07 am (#6 Total: 13)  

via email  

Photo of Author
nils.petersen@p…
Novice
Novice
Posts: 147
Hi Keith,

On 14.11.2019 15:10, Keith Personett wrote:
This line….

 

define('MDAPIURL', 'https://{Username}:{Password}@{ServerName}:{Port}/{EntryPoint}');

It appears that you are not sending the domain for the account. Is this account in the primary domain? Do you have full email required for logon set?


Duh - you are absolutely correct, the @mail.psyma.com bit made me miss the domain... :-[

We used to have full address for logon not (yet) set but I've changed that when trying to get the XML API working again. We shouldn't depend on the default domain anyway and planned to force full address anyway.
 

What if you change that define to …

 

define('MDAPIURL', 'https://{Username}@{domain}:{Password}@{ServerName}:{Port}/{EntryPoint}');

 

How does that affect things?


Hmm - the double '@' throws connection failures now at least ('can't find host psyma.com@password:mail.psyma.com')...

Trying the alternative logon delimiter '$' now [...] - and back to start... API returns an empty string again, nothing in the log, no XML in MdMgmtWS/ either.
Shouldn't authentication failures show up somewhere?

In my test scripts, I build the http-authorization buffer by base64 encoding it myself and adding the http-authorization header manually. This avoids the need for the XmlHttpRequest object to receive a 401 and then send credentials on a second request. I hate the logs being polluted with all of the 401’d requests.


I wasn't getting those 401s here using PHP, so I thought it was fine passing the logon on the URL.
[...]
I've changed the URL-inline authentication to using CURLOPT_USERNAME and CURLOPT_USERPWD - but still, no change.

Could you send me a known-good Powershell snippet or an .exe I could try with? I'm pretty sure now that our installation is borked somehow.

Best
Nils

--MD-API-------------------------------------------------------------
This list is for questions and discussions regarding MDAEMON's API.
To unsubscribe from this mailing list send an email to
md-api-unsubscribe@mdaemon.com .
--POWERED BY MDAEMON!------------------------------------------------

---------------------------------------------------------------------
These forums are provided by MDaemon Technologies for user-to-user 
support and discussion.  MDaemon staff members may participate in the 
forums periodically but please recognize that this is not the official
method of receiving technical support. To receive personal technical 
support please use the form here:
http://www.mdaemon.com/support/request_support.asp
---------------------------------------------------------------------

Keith Personett (apparently) - Nov 19, 2019 8:23 am (#7 Total: 13)  

via email  

Photo of Author
Keith Personett
Newbie
Newbie
Posts: 76

Nils,

 

Just coming back from some time off, so I have some catching up to do.

 

If you look in the ‘{MDaemon}\Docs\API\XML API\Samples’ directory, you will see how I do this in JScript. The .js file, common.js is included by the wsf examples files for testing via a command line under Windows. Look at the PostData and BuildAuth functions. It is used by the .wsf file examples, such as the ‘DSWhiteListReport.wsf’ example.

 

There are a few PowerShell examples there also, such as ASReportDevices.ps1 that you can look at.


--MD-API-------------------------------------------------------------
This list is for questions and discussions regarding MDAEMON's API.
To unsubscribe from this mailing list send an email to
md-api-unsubscribe@mdaemon.com .
--POWERED BY MDAEMON!------------------------------------------------

---------------------------------------------------------------------
These forums are provided by MDaemon Technologies for user-to-user 
support and discussion.  MDaemon staff members may participate in the 
forums periodically but please recognize that this is not the official
method of receiving technical support. To receive personal technical 
support please use the form here:
http://www.mdaemon.com/support/request_support.asp
---------------------------------------------------------------------

Keith Personett (apparently) - Nov 19, 2019 8:31 am (#8 Total: 13)  

via email  

Photo of Author
Keith Personett
Newbie
Newbie
Posts: 76

NP>> Trying the alternative logon delimiter '$' now [...] - and back to start... API returns an empty string again, nothing in the log, no XML in MdMgmtWS/ either.
NP>> Shouldn't authentication failures show up somewhere?

The With Info or Debug logging, the XmlApi logs every connection is receives from the ISAPI Host process, so if it is not showing anything in the log, the XMLAPI module is never even being called by the ISAPI Host Process (WorldClient.exe, w3wp.exe, whatever is running that service…).

 

When I get some time, I will look into the php module you referred me to.


--MD-API-------------------------------------------------------------
This list is for questions and discussions regarding MDAEMON's API.
To unsubscribe from this mailing list send an email to
md-api-unsubscribe@mdaemon.com .
--POWERED BY MDAEMON!------------------------------------------------

---------------------------------------------------------------------
These forums are provided by MDaemon Technologies for user-to-user 
support and discussion.  MDaemon staff members may participate in the 
forums periodically but please recognize that this is not the official
method of receiving technical support. To receive personal technical 
support please use the form here:
http://www.mdaemon.com/support/request_support.asp
---------------------------------------------------------------------



  (newer msg:5)All MessagesOldest ItemsOlder ItemsNewer ItemsNewest Items



 Content:

Read New | Search

 Guest:

Email to Admin



You are visiting as a Guest user.