Exchange Web Services with Delphi

I want to create an Exchange Web Services (EWS) client application using Delphi XE6.

I am using the THttpRio component with wsdl. How to set user credentials? In other languages, the THttpRio component equivalent has the Credentials property ( example ). But this is missing in the Delphi component.

The authentication mechanism (other than impersonation) is not part of ews wsdl. It is native to the SOAP layer.

Listing 1:

procedure TForm1.Button1Click( Sender: TObject);
var
   lESB        : ExchangeServicePortType;
   request       : GetServiceConfiguration;
   Impersonation : ExchangeImpersonation;
   RequestVersion: RequestServerVersion;
   MailboxCulture1: MailboxCulture;
   GetServiceConfigurationResult: GetServiceConfigurationResponse;
   ServerVersion : ServerVersionInfo;
begin
lESB := HTTPRIO1 as ExchangeServicePortType;
request         := GetServiceConfiguration.Create;
request.RequestedConfiguration := ArrayOfServiceConfigurationType.Create( 'UnifiedMessagingConfiguration');
Impersonation   := ExchangeImpersonation.Create;
RequestVersion  := RequestServerVersion.Create;
MailboxCulture1 := MailboxCulture.Create;
GetServiceConfigurationResult:= GetServiceConfigurationResponse.Create;
ServerVersion                := ServerVersionInfo.Create;
try
lESB.GetServiceConfiguration(
  request, Impersonation, RequestVersion, MailboxCulture1,
  GetServiceConfigurationResult, ServerVersion)
finally
  request.Free;
  Impersonation.Free;
  RequestVersion.Free;
  MailboxCulture1.Free;
  GetServiceConfigurationResult.Free;
  ServerVersion.Free
  end
end;

Listing 1 above shows an example of the code I have tried so far. The purpose of this function is to obtain server version information. HTTPRIO1 is a THTTPRIO component with default properties and is connected to the standard wsdl for EWS. This does not work because user credentials are not set.

?

+4
1

, ...

(1)

THTTPRio, UserName/Password HTTPWebNode - -.

THTTPReqResp UserName/Password .

TIdHTTP , -.

, , , , UserName Password THTTPRio THTTPReqResp. . TIdHTTP . , - , .

(2) EWS Soap?

, THTTPRio, . , THTTPRio . , , , , . (THTTPRio wsdl) ( ), , wsdl , node. Microsoft node , Delphi.

TIdHTTP , -.

- THTTPReqResp. wisdl. xml, Microsoft, , - .

(3) THTTPReqResp EWS

  • EWS UTF-8, UseUTF8InHeader: = True
  • InvokeOptions = [soIgnoreInvalidCerts, soAutoCheckAccessPointViaUDDI]
  • URL- URL- , .
  • SoapAction http://schemas.microsoft.com/exchange/services/2006/messages
  • .
  • EWS 1.1, 1.2, wnoSOAP12 WebNodeOptions.
  • MSDN . .

(4) XML.

XML-, , . ?

, :

  • . , , TPageProducer. , . PageProducer , n ( ), .
  • XSLT. . .

, , . , , , :

  • ( ).
  • XML- (IXMLNode ..), .
0

All Articles