Feedback

Coordinator
Dec 20, 2008 at 7:02 PM
Please give us any feedback and suggestions.

Do you need additional support?
Do you want to participate?

Jan 24, 2010 at 6:35 PM

I have downloaded the tutorial and upload all the files to my webadress at "wlw.bloggdesign.nu" but when I add that to the windows live writer I need to choose my blogprovider by myself.

Shouldnt this be done automaticly? It does run with Metaweblog API right?

Coordinator
Jan 24, 2010 at 8:14 PM

hi,

i looked at the link you gave:

and I could not find rds (wlw.bloggdesign.nu/rsd.xml) or wlwmanifest (wlw.bloggdesign.nu/wlwmanifest.xml) and address you gave is invalid.


 

Jan 24, 2010 at 8:51 PM

Oh sorry about that. Now the files are there again.

Can you please check it again?

Coordinator
Jan 24, 2010 at 8:56 PM

you have some errors here: http://wlw.bloggdesign.nu/xmlrpc.ashx

Jan 24, 2010 at 9:05 PM

There now the errors are gone.

And thanks for the quick replys. I really need this to get working so I thank you for your help.

Jan 24, 2010 at 9:06 PM
Edited Jan 24, 2010 at 9:06 PM

Btw, the url is now http://wlw.macroweb.se

edit: Sorry for the double post.

Coordinator
Jan 24, 2010 at 9:25 PM

i looked into fiddler and writer got nothing, only thing i could think about is this "eej" string, it is above header, technically it makes html document broken, maybe writer thinks about it like that, try removing that string from response from http://wlw.macroweb.se

Jan 24, 2010 at 9:28 PM

sure was that. thanks! :)

Now the blog is found automaticly. Sweet! But what should I do next?

I get the error "not yet implemented".

Should I write some code to load the blogposts into WLW now?

Coordinator
Jan 24, 2010 at 9:38 PM

np,

this error is thrown by your code and it is displayed in live writer. I did not see your code but assume that you have somewhere something like "throw new XmlRpcFaultException(0, "not yet implemented");"  

you should implement all the methods in template (including one that loads blogposts).

Jan 24, 2010 at 9:57 PM

Im using the xmlrpx.ashx and .cs from the template in Visual Studio so I think I already have the methods implemented. Or do I add something else to the code?

For example I have this in the code:

 

        [XmlRpcMethod("metaWeblog.newPost")]
        public string newPost(string blogid, string username, string password, Post content, bool publish)
        {
            #region MSWLWnewPost
            int userID = checkUser(username, password);
            if (userID != -1)
            {
                string returnMe = "null";
                //TODO: please complete this code!
                throw new XmlRpcFaultException(0, "not yet implemented 2");
                return returnMe;
            }
            else
            {
                throw new XmlRpcFaultException(0, "invalid user credentials");
            }
            #endregion
        }

 

 

Coordinator
Jan 24, 2010 at 10:08 PM

methods in template only contain functional siganture and some basic code, if you take a look here:

//TODO: please complete this code!
throw new XmlRpcFaultException(0, "not yet implemented 2");

it means that you need to complete the implementation of that method, implementation is highly specific to particular custom blog engine so it would be impossible to write such code (in template) that would fit to everyone.

In template method stub just emphasize that you should use some checkUser mechanism to autorize each method due to security reasons, because as live writer can "see" your methods so everyone else can.
My advice to you is to go step by step and complete the code. That extra stuff in method body is just to make sure you follow good practice, as for advanced devs method stub is as follows:
        [XmlRpcMethod("metaWeblog.newPost")]
public string newPost(string blogid, string username, string password, Post content, bool publish)
{
}

Jan 24, 2010 at 10:53 PM
Edited Jan 24, 2010 at 11:06 PM

Ah okej. But how do I complete this code? What code do I need to add and wich method is first called when it connects to the blog?

edit: To clearify I don't really get how and where I shall use the "newPost" method. I understand that this is the method for creating posts but do I have to call this by myself when the user is clicking a button inside the program? or is this method fired when the user saves their new post in the program?

Coordinator
Jan 25, 2010 at 8:48 AM
Edited Jan 25, 2010 at 8:49 AM
Good morning :)

in "newPost" method you should write something that will add a post to your weblog system, usually it is something like inserting rows to database.
"newPost" method is called by live writer when user saves newly created blog post in live writer.
first method is getUsersBlogs that returns list of blogs for specific user.

to verify the order of method call you could write unique "throw new XmlRpcFaultException(0, "not yet implemented 2");" throws in every method,
for example in new post put "throw new XmlRpcFaultException(0, "from newPost");"
please note that every method in template has throw that is not unique.
This way, by using live writer with your blog, you get exceptions that contains the information which method is called (and which one threw a exception),
so you can visualize the order of method calls.

Jan 25, 2010 at 11:47 AM
Edited Jan 25, 2010 at 11:54 AM

Thanks for that great reply. :)

Im have now written unique throws in every method but when I try to add my blog in live writer I get "not yet implemeted".

Im trying to figure out if the changes has been saved and uploaded correctly but it's very hard becuase even when I try to delete all content in "xmlrpc.ashx.cs" and upload it, I still can view the file "xmlrpc.ashx".

And speaking of that file, when I browse "xmlrpc.ashx" I can can see the text "The following methods are supported:" followed by all the mothods. Wich code is it that generates this text?

In getUsersBlogs I now have this code:

 

        [XmlRpcMethod("blogger.getUsersBlogs")]
        public UserBlog[] getUsersBlogs(string appKey, string username, string password)
        {
            #region MSWLWgetUsersBlogs
            UserBlog returnMe;
            //TODO: please complete this code!
            //NOTE: user credentials are not checked here because
            //      user's blog list is retrieved using username 
            //      and password as DB filters. Feel free to use 
            //      checkUser( ) method.
            throw new XmlRpcFaultException(0, "from getUsersBlogs");
            return new UserBlog[1] { returnMe };
            #endregion
        }

Shouldn't I get the error "from getUsersBlogs" now when I try to add my blog?

edit: And one more thing, I guess I have to write some code in "getUsersBlogs" that returns the users blogs but how should that code look like? I mean, the code that is returned to live writer does it need to have some special formating?

        [XmlRpcMethod("blogger.getUsersBlogs")]
        public UserBlog[] getUsersBlogs(string appKey, string username, string password)
        {
            #region MSWLWgetUsersBlogs
            UserBlog returnMe;
            //TODO: please complete this code!
            //NOTE: user credentials are not checked here because
            //      user's blog list is retrieved using username 
            //      and password as DB filters. Feel free to use 
            //      checkUser( ) method.
            throw new XmlRpcFaultException(0, "from getUsersBlogs");
            return new UserBlog[1] { returnMe };
            #endregion
          rr
Coordinator
Jan 25, 2010 at 12:22 PM

you are welcome :)

i checked your implementation and i can confirm that there is no change in fault messages, you are right there should be an error with "from getUsersBlogs" message,
perhaps you need recompile your code on site, or restart server (it may be using cached version oc xmlrpc) or restart app pool,

as for xmlrpc.ashx text, it is generated by asp.net because it is recognized as web service handler.

you are correct method response should be formatted so writer could recognize it. If you take a look at return type of getUsersBlogs, it is an array of UserBlog objects,
type UserObject is defined in MSWLWstructure region in template(3rd structure from top)

Jan 25, 2010 at 3:14 PM

I can't get the file to update so now im trying with another file in another folder.

First I've edited "rsd.xml" to the following:

<api name="MetaWeblog" blogID="2" preferred="true" apiLink="http://wlw.macroweb.se/2/xmlrpc.ashx"/><!--api record-->

So now it gets the xmlrpc.ashx file in the folder named "2".

When I made those changes I accidently removed the "CodeBehind=" text in "xmlrpc.ashx" so the first line is now:

 

<%@ WebHandler Language="C#"  Class="wlw.bloggdesign.nu.xmlrpc"%>

With this line of code live writer still found the page (but gave me the error) and I could navigate to it in my browser.

But becuase I've changed the domain from "bloggdesign.nu" to "macroweb.se" i then edited the line to:

<%@ WebHandler Language="C#"  Class="wlw.macroweb.se.xmlrpc"%>

But with this line I got the error "Could not create type 'wlw.macroweb.se.xmlrpc".

How come I get this error? I mean, I haven't even told the page wich code to use. Where exactly is this class located?

I tried searching for "wlw.bloggdesign.nu" in my old xmlrpc.ashx.cs but I didn't find anything.

Coordinator
Jan 25, 2010 at 3:31 PM

well put codebehind back in xmlrpc.ashx handler. class for codebehind is usually located in App_Code or in root it is based on your preference.

Jan 25, 2010 at 3:53 PM
Edited Jan 25, 2010 at 4:17 PM

yeah well I got to many errors so I desided to delete the files and create a new site from your template.

But as soon as I created the site from the template I get an error again when I try to browse the site.

The error now is "Could not load type 'wlw.macroweb.se._Default'.

When I got this I deleted the "inherit" line from page so it now looks like:

 

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs"%>

Now the site works but live writer tells me I get an 500 error and when I browse to xmlrpc.ashx I get the same darn error:

 

Could not create type 'wlw.macroweb.se.xmlrpc'.

Is this becuase I deleted the first code with "Inherits="wlw.macroweb.se._Default"?

And why did I get this error?

Sorry for being so a pain in the a** with all my errors. I thank you so much for not giving up on me. :) You are helping me tremendus!

 

edit: Now I got the updated exceptions to show up propertly. But I also chanced so the "xmlrpc.ashx" doesnt have a code-behind. All the code is now in the same file. When I did this I could remove the "inherits" code and then it worked. :)

So now I just need to figure out how to pass the information from getUsersBlogs to live writer. :) I look into that I get back to ya with the result.

Jan 25, 2010 at 4:20 PM

Oh and one more thing. In Visual Studio I removed the old "xmlrpc.ashx" file and then added the "new" one without the .cs file but it still shows as two files with code-behind but the .cs file has a yellow triangle on it saying it's missing.

I tried create a new generic handler but that also had code-behind enabled. is this something thas is set somewhere in the project that all handlers should have that?

Do you perhaps know how I can create a new handler without code-behind?

Coordinator
Jan 25, 2010 at 4:51 PM

it is not wise to delete generated code,

you are not pain in a**, i am glad if i can help,

you can create webservice handler in single file, like this:

<%@ WebHandler Language="C#" Class="SLHandler" %>
using System;
using System.Web;
using System.Net;

public class SLHandler
{
 //some code
}
file that contains upper code is named SLHandler.ashx (it is from my other project). You can do the same for xmlrpc.ashx if you like.

Feb 20, 2010 at 10:49 PM

The problem I was having was that the server wich is hosting my website didn't refresh my files as It should therefor I didn't see the changes I made. 

But atleast now im past this. :) Thanks a million for all your help geting me started.

Feb 24, 2013 at 5:04 AM
Hi there!

I did a brief overview of your project and you've accomplished a number of impressive feats, overall awesome :) This project seems to have quiet down a bit, also Windows Live Writer development from Microsoft's side appears to have fell by the way side. I'm very interested in the technology you've explored, which can still be extremely usefull in the absence of Live Writer, maybe even more so. I would like to become involved in your project, if the project is no longer active then I'd consider refactoring your work into a new direction.

Thanks and Regards,
Dewald Esterhuizen
Coordinator
Feb 25, 2013 at 9:09 PM
hi,

yes, this project is finished.
We are still open to continue working, what did you had in mind?

regards,
Boris