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: 10)All MessagesOldest ItemsOlder ItemsNewer ItemsNewest Items

nils.petersen@psyma.com (apparently) - Nov 21, 2019 3:08 am (#11 Total: 13)  

via email  

Photo of Author
nils.petersen@p…
Novice
Novice
Posts: 147
On 20.11.2019 18:04, Keith Personett wrote:

I’ll look into the logging, but I believe that in those cases where you were not seeing log entries, it was likely hitting the wrong URL, so the xmlapi was never called. Which means it never had anything to log.


Actually, the API stopped working and the log stopped showing anything simultaneously after the 19.5.1 update. Only later I tried the samples with the wrong URL - shouldn't that show up somewhere as well, like in WDaemon.log or so?

Best
Nils

From: md-api@mdaemon.com [mailto:md-api@mdaemon.com] On Behalf Of Nils Petersen (nils.petersen@psyma.com)
Sent: Wednesday, November 20, 2019 10:59 AM
To: md-api List Member <md-api@mdaemon.com>
Subject: [md-api] XML API broken with 19.5.1?

 

On 19.11.2019 14:31, Keith Personett wrote:

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.


Now we're getting somewhere: I've got DSWhiteListReport.ps1 working - it also required

$Url = "https://mail.psyma.com:3002/MdMgmtWS"


If the /API bit is supposed to be a placeholder I didn't get it...

So obviously, the PHP call doesn't work any more, very likely due to the authentication changes that happened in 19.5.1.

I've traced the actual HTTP call from PHP using Wireshark and noticed that the CURLOPT_USERNAME doesn't appear to have any effect. The value isn't passed to the server and the call fails with a 401 - without being logged anywhere. (I guess CURLOPT_USERNAME is only used with some login methods, but that's poorly documented...)
I didn't really want to dive into the subtleties of PHP and cURL, so I just tried the CURLOPT_USERPWD to pass username@domain.tld:password - and that works!

YAY!

Thanks for your help, Keith. It seems, the API logging needs some fixing for authentication failures but all the rest was due to URL authentication not working any more and PHP/cURL header authenticaton not understood by me.

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
---------------------------------------------------------------------

 

 
 
--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
---------------------------------------------------------------------
--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
---------------------------------------------------------------------


--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:2)All MessagesOldest ItemsOlder ItemsNewer ItemsNewest Items



 Content:

Read New | Search

 Guest:

Email to Admin



You are visiting as a Guest user.