Working with .Text Web Services

Did you know that you have web service access to your blog? You can find it at http://weblogs.asp.net/yourblog/services/simpleblogservice.asmx. I've been experimenting with it for my new BlogStudio tool, and I wanted to inform you of a couple things you'll need to know to get it working.

In order to use the InsertPost method of the web service, you ALWAYS have to set the URL of the web service, no matter what the web service reference says. Why? Diving into the VS.NET generated code shows us.

<System.Diagnostics.DebuggerStepThroughAttribute(), _
System.ComponentModel.DesignerCategoryAttribute("code"), _
System.Web.Services.WebServiceBindingAttribute(Name:="SBS (Simple Blog Service)Soap", [Namespace]:="http://www.aspnetweblog.com/services/simpleblogservice/")> _
Public Class SBSSimpleBlogService
   
Inherits
System.Web.Services.Protocols.SoapHttpClientProtocol

    '<remarks/>
    Public Sub New
()
        MyBase
.New
        Dim urlSetting As String
= System.Configuration.ConfigurationSettings.AppSettings("BlogStudio.WebServices.DotText.SBS (Simple Blog Service)")
        If (Not (urlSetting) Is Nothing)
Then
            Me.Url = String
.Concat(urlSetting, "")
        Else
            Me
.Url = “http://weblogs.asp.net/Services/simpleblogservice.asmx“
        End
If
    End
Sub
.....
End Class

So, my web service call was always pointing to the non-existent "services" blog. It didn't start working until I used this code instead:

Dim Blog As New WebServices.DotText.SBSSimpleBlogService
Blog.Url = “
http://weblogs.asp.net/rmclaws/services/simpleblogservice.asmx“
Blog.InsertPost("username", "password", DateTime.Now.ToString, "Test Post", EntryPanel.SaveHtml)

There you have it. A simple way to add a post to your blog.

On a related note, I think it's really ridiculous that I could not find a decent WinForms HTML edit control. Why is it that none of them render formatting toolbars as an option? I guess FreeTextBox ruined me for other HTML controls. Oh well, I'm using the SandBar menu controls, and loving it. The only thing I can't do is pull the value out of a dropdown in the toolbar. Can't find the event to check for. Any ideas?

2 Comments

Comments have been disabled for this content.