SOAPjr - SOAP without the bloat and JR (JSON-RPC) with proper error handling and file uploads


SOAPjr documentation  | view source Contained in the SOAPjr distribution.

Index


NAME

Top

SOAPjr - SOAP without the bloat and JR (JSON-RPC) with proper error handling and file uploads

VERSION

Top

Version 1.1.4

SYNOPSIS

Top

    Overview
    --------
    1. Receive request message
    2. Validate request message
    3. Process request message
    4. Create response message
    5. Configure response message
    6. Send response message 

    # The assumption is that this module will be used from within a perl script (or an apache request handler)
    # - use in the module
    use SOAPjr;

    # - create the SOAPjr server object
    # NOTE: This is the equivalent of jquery on the client side and may be created in the apache perl_startup.pl script so it's persistent
    my $server = SOAPjr->new($options);

    # 1. Receive request message
    # - your perl script is called either directly or as a handler
    # e.g. /SOAPjr.pl

    # 2. Validate request message
    # - create the inbound request object for this request
    my $request = $server->create_request($query_params_hashref, \%ENV);

    # - set any settings for this inbound request object
    $request->set({ OPTIONS => { "..." => "..." } });

    # 3. Process request message
    # This is where your development implementation happens
    # - process the request however you need to
    # ...

    # 4. Create response message
    # - then when you're ready you create a response object
    my $response = $self->create_response({ ENVELOPE => { "option1" => "XXX" } });

    # 5. Configure response message
    # - then set any of the response values
    $response->set({ HEAD => { "option1" => "DDD" }, BODY => { "option1" => "LLL" } });

    # 6. Add any errors you need to
    # - if your processing of $request creates any errors then just add them with $response->add_error()
    # e.g. 
    # $s = $r->add_error({
    #     context => "HEAD",
    #     property => "sid",
    #         error => {
    #         code => 401,
    #         message => "Invalid session ID"
    #     }
    # });
    # NOTE: $s (e.g. the return of add_error()) is a serialised_string of the current object after the error is added

    # 7. Send response message 
    # - then when you're done you send back your response
    my $send_result = $response->send({ HEAD => { "option1" => "DDD" }, BODY => { "option1" => "LLL" } });
    # or you can just get a serialised string of the object at any time using $response->output();

FUNCTIONS

Top

_init

Private method to enable inheritance via SOAPjr::base.

create_request

Public method to enable the creation of a SOAPjr request object.

create_response

Public method to enable the creation of a SOAPjr response object.

AUTHOR

Top

Rob Manson, <robman[at]cpan.org>

BUGS

Top

Please report any bugs or feature requests to bug-soapjr at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=SOAPjr. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

Top

You can find documentation for this module with the perldoc command.

    perldoc SOAPjr




You can also look for information at:

* SOAPjr.org

http://SOAPjr.org

* RT: CPAN's request tracker

http://rt.cpan.org/NoAuth/Bugs.html?Dist=SOAPjr

* AnnoCPAN: Annotated CPAN documentation

http://annocpan.org/dist/SOAPjr

* CPAN Ratings

http://cpanratings.perl.org/d/SOAPjr

* Search CPAN

http://search.cpan.org/dist/SOAPjr/

TODO

Top

Need to write t/ tests and add detailed documentation then replace t/pod-coverage.t.

Also need to create Server and Client modules ala JSON::RPC and more detailed example scripts.

ACKNOWLEDGEMENTS

Top

See http://SOAPjr.org/specs.html for further information on related RFC's and specifications.

COPYRIGHT & LICENSE

Top


SOAPjr documentation  | view source Contained in the SOAPjr distribution.