Showing posts with label web services. Show all posts
Showing posts with label web services. Show all posts

Sunday, August 11, 2013

Test Harness for REST Services

You don't have to write one to have a GUI client to test your REST API/services layer. You can use Chrome plug-in Advance REST Client here :

https://chrome.google.com/webstore/detail/advanced-rest-client/hgmloofddffdnphfgcellkdfbfbjeloo

If you're having trouble with JSON posts, maybe this can help.

http://stackoverflow.com/questions/11688608/how-to-test-express-node-rest-api-backend-with-advanced-rest-client-or-postman


Monday, April 30, 2012

LinkedIn API Requires Content-Type Request Header Set When Doing POST

I am not sure why LinkedIn API which does a HTTP POST request requires Content-Type for it to work. Otherwise, you will be receiving a 401 Unauthorized response which is kinda annoying. I suppose they can't support content-type inferencing or it is not feasible due to performance overhead or even security because they both support POST payload of XML and of JSON format.

So If you are POSTing for JSON, you need to make sure that you have the following HTTP Header,

Content-Type: application/json

If you have XML as a POST payload then use,

Content-Type: text/xml

If for whatever reason you have interchanged them, it will throw a bad request status code 400 and say that it cannot be parsed. Hope this will help someone as it had me scratching longer than I expected.

Sunday, April 3, 2011

Disable Zend_Layout and Zend_View

Disabling Zend Layout

$layout = Zend_Layout::getMvcInstance();
if ($layout) {
    $layout->disableLayout();
}

Prevent Zend_View From Rendering in the Current Action / State

$this->_helper->viewRenderer->setNoRender();
Note: Put the above code post-bootstrap of the front-controller. Meaning you should put them through a Controller Plugin or [your_zend_controller]::init() or [your_zend_controller]::preDispatch() methods. This is because at the bootstrap level, the layout and views objects are still out of scope or not yet instantiated. They become available after the routerShutdown() method of the front controller.

 What do you use them for?

Tuesday, April 27, 2010

Introduction to Service-Oriented Architecture

Service-Oriented Architecture have been a discussion even as early as late 90s. This system architecture is meant to expose macro-level services that can be consumed by business directly instead of the micro-level software components like classes. It also encompasses abilities of being able to distribute and aggregate services from different topographical locations through the internet. Imagine a system similar to previous software architectures and technologies like modular programming, component-based design, object-oriented programming etc, except that it can be distributed across different technologies, platforms, network and location given that they should have common interfaces promoting interoperability.