Client-Warning: Unsupported authentication scheme 'negotiate' Set-Cookie: exchangecookie=ea8a495701ec4aebbe718c3fd0c908ba; expires=Wed, 21-Jan-2015 13:00:21 GMT; path=/; HttpOnly X-Powered-By: ASP.NET 401 Unauthorized at C:\Perl Scripts\SpectrumemailGW.pl line 44. #### my $soap = $folder->soap; $soap->on_action( sub { MESSAGES_NS . "/$_[1]" }); # setup the schemas $soap->ns(TYPES_NS, 't'); $soap->default_ns(MESSAGES_NS); $soap->uri(MESSAGES_NS); # EWS does not like the encodingStyle attribute $soap->encodingStyle(""); my $method = SOAP::Data->name('DeleteItems') ->attr({xmlns => 'https://webmailNY.xxxx.com/ews'}); my @params = ( SOAP::Data->name('Message-ID' => $message_id)); $soap = SOAP::Lite->proxy('https://webmailNY.XXXX.com/ews/exchange.asmx'); sub SOAP::Transport::HTTP::Client::get_basic_credentials { return ('XXXX\gsa_spectrum_mb_read' => 'XXXX') }; print $soap-> SOAP::Lite::call($method => @params)->result; print 'end';