By using the API created in part 1, integration with CakePHP or any other site becomes really easy. As said in part 1, we want functionality to add posts on the site and some user management. For this I already had 2 models, ‘News’ and ‘Member’, these models do everything related to user management and news posts on the [...]
Ever wanted to set your own session id? Well, I did. I was creating a webservice where authentication would be done with a ‘token’. This token would simply be a random guid given to that user after he logged on with his username/password. Now, this random guid/string would be the session ID. That way, if the user does an action [...]
Ever wanted to split off functionality to a base class other then AppController? This is what was needed to prevent typing the same code over and over again in a project of mine. The app controller is great and all, but it’s just one class and you might want some functionality in only a part of your controllers. So lets [...]
When working with xml allot, you’ll find that this little ‘trick’ might come in handy. Editing large xml structures is a pain. So why not convert them to a nice array? It’s done like this: The xml: <PipeMsg> <Header> <Task>Logon</Task> <AuthenticationToken>sdfdg4-hkjty45-4544-sdfdsf4</AuthenticationToken> <CreationDstamp>54641215</CreationDstamp> </Header> <Body> <UserName>Crazy</UserName> <Password>cinderella </Password> </Body> </PipeMsg> Now convert to an array: $objXml = ‘the xml in the [...]