Webservice API Options
duckie
Posted: Friday, November 03, 2006 9:06:37 AM
Rank: Devotee

Joined: 8/14/2006
Posts: 212
Niels Hartvig wrote:

I think we could have a key in the umbracoSettings.xml file: "EnableWebservices" and also add an additional setting on a user saying "Allow Webservice access". <snip> You could even have webservice only users, that have webservice access but not console (= umbraco web client) access.


Great idea :-)
...
Could you create a forum on codeplex? That way we could create several threads for each part/consideration in this project.

Signatures suck. No reason to have one.
hartvig
Posted: Friday, November 03, 2006 9:09:57 AM

Rank: Addict

Joined: 3/17/2008
Posts: 982
Location: Nyborg, Denmark
darrenferguson
Posted: Friday, November 03, 2006 9:52:11 AM
Rank: Devotee

Joined: 7/19/2006
Posts: 83

Before you go about re-inventing the wheel, I have quite a few webservices implemented already as part of an under development extension called courier.

I think it'd be good to have this as an official project that anyone can join in and co-dev on rather than everyone having their own webservices.




Darren Ferguson - http://www.darren-ferguson.com
duckie
Posted: Friday, November 03, 2006 10:08:05 AM
Rank: Devotee

Joined: 8/14/2006
Posts: 212
Darren F wrote:

Before you go about re-inventing the wheel, I have quite a few webservices implemented already as part of an under development extension called courier.


Sounds exciting.. Could you write some more info about it?


Signatures suck. No reason to have one.
darrenferguson
Posted: Friday, November 03, 2006 10:27:50 AM
Rank: Devotee

Joined: 7/19/2006
Posts: 83
Sure, apart from the stuff in /umbraco/webservices I have

[WebMethod]
public string Authenticate(String requestingHost, String encyptedUser, String encryptedPassword)

[WebMethod]
public XmlNode GetXslts(string Login, string Password)

[WebMethod]
public XmlNode GetXslt(String name, string Login, string Password)

[WebMethod]
public bool UpdateXslt(String name, string content, string Login, string Password)

[WebMethod]
public XmlNode GetStylesheets(string Login, string Password)

[WebMethod]
public XmlNode GetStylesheet(int Id, string Login, string Password)

[WebMethod]
public bool UpdateStylesheet(int Id, string content, string Login, string Password)

They are from different projects, but the idea was to have the authenticate method return an encrypted sid which would be passed to all other methods instead of the current user/password params.

The authentication piece includes an example of how to create a public/private key pair so the client and host can communicate securely.

If you'd like any of the source or any more details, please let me know.

Thanks.
Darren.

Darren Ferguson - http://www.darren-ferguson.com
duckie
Posted: Friday, November 03, 2006 12:27:03 PM
Rank: Devotee

Joined: 8/14/2006
Posts: 212
The authentication sound very interesting! ...

If its code you can make public, please post in on codeplex! Else mail it to me. web (at) dioder (dot) dk :)

Signatures suck. No reason to have one.
darrenferguson
Posted: Monday, November 06, 2006 11:32:02 AM
Rank: Devotee

Joined: 7/19/2006
Posts: 83
Hi,
Sorry for the delay.
I'll send it over this evening.
Busy times at the moment....

Darren.

Darren Ferguson - http://www.darren-ferguson.com
mrshrinkray
Posted: Saturday, December 09, 2006 4:15:56 PM

Rank: Aficionado

Joined: 8/4/2006
Posts: 108
Location: London
I'm writing a load of (webservice) methods at the moment to accomodate some missing features in the umbraco client.

This includes stuff like

AddMedia
AddDocument
UploadZip
UploadMedia
UploadLargeMedia (uses DIME)
UpdateDocumentTemplate
GetDocumentChildren
UpdateName
UpdateProperty
GetProperty
GetProperties

I was planning on using session based authentication where you get a ticket once you login. I can share the source if it's any help, I imagine about 1/2 of those you've already written though.



www.sloppycode.net
hartvig
Posted: Sunday, December 10, 2006 9:12:39 AM

Rank: Addict

Joined: 3/17/2008
Posts: 982
Location: Nyborg, Denmark
Chris,

Duckie/Anders Matthiesen have already made a great bunch of webservices with help from Darren Fergusson. They're a part of v3, but cleverly made as a separate project so it could be used with v2.1.x.

Info at codeplex here:
http://www.codeplex.com/umbraco/Wiki/View.aspx?title=Webservices
http://www.codeplex.com/umbraco/Project/ListThreads.aspx?ForumId=2173

If there's something missing and you want to join the development, let me and Anders know and I'll give you commit access to codeplex (even though it's in the 11th hour) :-)

/n


Jeeeez, did I really start this :-)
mrshrinkray
Posted: Sunday, December 10, 2006 2:35:49 PM

Rank: Aficionado

Joined: 8/4/2006
Posts: 108
Location: London
I'll be happy to help out if I'm needed. I was having problems with the Property and Template classes not being serializable with mine so it'd be good to use the official one instead. I have one suggestion for inclusion, and that's the method I use a lot which updates the template for a page and all children. I've pasted the code below (nb it does the update with the admin user)

Code:


/// <summary>
/// Updates the template for the specified document.
/// </summary>
/// <param name="docId">The ID of the document.</param>
/// <param name="templateId">The template to update the document with.</param>
/// <param name="deep">Whether to update all the document's children with this template.</param>
[WebMethod]
public void UpdateDocumentTemplate ( int docId, int templateId, bool deep )
{
    if ( deep )
    {
        ArrayList list = this.GetDocumentChildren( docId );
        for ( int i = 0; i < list.Count; i++ )
        {
            Document d = new Document( (int) list[i] );
            d.Template = templateId;
            d.Publish( new User( 0 ) );
        }
    }
    else
    {
        Document d = new Document( docId );
        d.Template = templateId;
        d.Publish( new User( 0 ) );
    }   
}

private ArrayList GetDocumentChildren ( int docId )
{
    Document doc = new Document( docId );
    Document[] children = doc.Children;
    ArrayList list = new ArrayList();

    if ( children.Length > 0 )
    {
        for ( int i = 0; i < children.Length; i++ )
        {
            if ( children[i].HasChildren )
            {
                list.AddRange( GetDocumentChildren( children[i].Id ) );
            }

            list.Add( children[i] );
        }
    }

    return list;
}


www.sloppycode.net
obender
Posted: Sunday, October 28, 2007 9:25:08 AM
Rank: Enthusiast

Joined: 2/20/2007
Posts: 16
hi, Where i can get the media uploader app, please send a link to 2@pcline.co.il, thanks
Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.