The following is the complete Delphi code and instruction to blog to .Text (v0.95) using Web Services.

  1. New Application.
  2. Import WSDL from http://weblogs.asp.net/services/aspnetweblog.asmx?WSDL or http://yoursite/yourblog/services/aspnetweblog.asmx?WSDL
  3. Fix the GetASPNetWebLogApiSoap's defURL const: originally, it looks like http://yoursite/services/aspnetweblog.asmx?WSDL. Change it to http://yoursite/yourblog/services/aspnetweblog.asmx?WSDL, otherwise, it won't work properly.
  4. Drop a HTTPRIO on your main application form.
  5. Drop a button, and in the button's OnClick event, add the following declaration and code.

Note: The code doesn't post the blog to any categories.

var
  Intf: ASPNetWebLogApiSoap;
  AEntry: Entry;
  EntryID: Integer;
  Headers: ISOAPHeaders;
  AuthenticationInfo: BlogUser;
  ANow: TDateTime;
begin
  Intf := GetASPNetWebLogApiSoap(false, '', HTTPRIO1);
  AuthenticationInfo := BlogUser.Create;
  Headers := Intf as ISOAPHeaders;
  AuthenticationInfo.UserName := 'myusername';
  AuthenticationInfo.Password := 'mypassword';
  Headers.OwnsSentHeaders := true;
  Headers.Send(AuthenticationInfo);
  AEntry := Entry.Create;
  AEntry.PostType := BlogPost;
  ANow := Now;
  AEntry.DateCreated := DateTimeToXSDateTime(ANow);
  AEntry.DateUpdated := DateTimeToXSDateTime(ANow);
  AEntry.Author := 'Author Name';
  AEntry.Description := 'WSDL testing';  // Excerpt, may be left blank.
  AEntry.ParentID := -1; // should always be -1 for a new post
  AEntry.Email := ''; // may be left blank
  AEntry.IsActive := true; // doesn't work, use PostConfig
  AEntry.DisplayOnHomePage := true; // doesn't work, use PostConfig
  AEntry.IsXHMTL := false; // doesn't work, use PostConfig
  AEntry.Body := 'Hmm, experiment'; // HTML text here
  AEntry.AllowComments := true; // doesn't work, use PostConfig
  AEntry.Title := 'A Title';
  AEntry.PostConfig := 'IsActive DisplayOnHomePage AllowComments IncludeInMainSyndication IsAggregated';
  EntryID := Intf.InsertEntry(AEntry);
  AEntry.Free;
  Intf := nil;
end;