POE::Component::Server::SOAP is a bolt-on component that can publish event handlers via SOAP over HTTP. Currently, this module only supports SOAP/1.1 requests, work will be done in the future to support SOAP/1.2 requests. The HTTP server is done via POE::Component::Server::SimpleHTTP.

This is a boolean value, controlling whether Server::SOAP will check for this value in the Headers and Fault if it is present. This will default to true.

SIMPLEHTTP

This allows you to pass options to the SimpleHTTP backend. One of the real reasons is to support SSL in Server::SOAP, yay! To learn how to use SSL, please consult the POE::Component::Server::SimpleHTTP documentation. Of course, you could totally screw up things, just use this with caution :)

You must pass a hash reference as the value, because it will be expanded and put in the Server::SimpleHTTP->new() constructor.

Events

There are only a few ways to communicate with Server::SOAP.

ADDMETHOD

This event accepts four arguments:
- The intended session alias
- The intended session event
- The public service name ( not required -> defaults to session alias )
- The public method name ( not required -> defaults to session event )
Calling this event will add the method to the registry.
NOTE: This will overwrite the old definition of a method if it exists!

DELMETHOD

This event accepts two arguments:
- The service name
- The method name
Calling this event will remove the method from the registry.
NOTE: if the service now contains no methods, it will also be removed.

DELSERVICE

This event accepts one argument:
- The service name
Calling this event will remove the entire service from the registry.

DONE

This event accepts only one argument: the SOAP::Response object we sent to the handler.
Calling this event implies that this particular request is done, and will proceed to close the socket.
The content in $response->content() will be automatically serialized via SOAP::Lite's SOAP::Serializer
NOTE: This method automatically sets some parameters:
- HTTP Status = 200 ( if not defined )
- HTTP Header value of 'Content-Type' = 'text/xml'
To get greater throughput and response time, do not post() to the DONE event, call() it!
However, this will force your program to block while servicing SOAP requests...

RAWDONE

This event accepts only one argument: the SOAP::Response object we sent to the handler.
Calling this event implies that this particular request is done, and will proceed to close the socket.
The only difference between this and the DONE event is that the content in $response->content() will not
be serialized and passed through intact to the SOAP envelope. This is useful if you generate the xml yourself.
NOTE:
- The xml content does not need to have a <?xml version="1.0" encoding="UTF-8"> header
- In SOAP::Lite, the client sees '<foo>54</foo><bar>89</bar>' as '54' only!
The solution is to enclose the xml in another name, i.e. '<data><foo>54</foo><bar>89</bar></data>'
- If the xml is malformed or is not escaped properly, the client will get terribly confused!
It will be inserted here:
...<soap:Body><namesp4:TestResponse xmlns:namesp4="http://localhost:32080/">YOURSTUFFHERE</namesp4:TestResponse></soap:Body>...

FAULT

This event accepts five arguments:
- the HTTP::Response object we sent to the handler
- SOAP Fault Code ( not required -> defaults to 'Server' )
- SOAP Fault String ( not required -> defaults to 'Application Faulted' )
- SOAP Fault Detail ( not required )
- SOAP Fault Actor ( not required )
Again, calling this event implies that this particular request is done, and will proceed to close the socket.
Calling this event will generate a SOAP Fault and return it to the client.
NOTE: This method automatically sets some parameters:
- HTTP Status = 500 ( if not defined )
- HTTP Header value of 'Content-Type' = 'text/xml'
- HTTP Content = SOAP Envelope of the fault ( overwriting anything that was there )

RAWFAULT

This event accepts only one argument: the SOAP::Response object we sent to the handler.
Calling this event implies that this particular request is done, and will proceed to close the socket.
The only difference between this and the FAULT event is that you are given freedom to create your own xml for the
fault. It will be passed through intact to the SOAP envelope. Be sure to read the SOAP specs :)
This is very similar to the RAWDONE event, so go read the notes up there!
It will be inserted here:
...<soap:Body>YOURSTUFFHERE</soap:Body>...

CLOSE

This event accepts only one argument: the SOAP::Response object we sent to the handler.
Calling this event will proceed to close the socket, not sending any output.

STARTLISTEN

Starts the listening socket, if it was shut down

STOPLISTEN

Simply a wrapper for SHUTDOWN GRACEFUL, but will not shutdown Server::SOAP if there is no more requests

SHUTDOWN

Without arguments, Server::SOAP does this:
Close the listening socket
Kills all pending requests by closing their sockets
Removes it's alias
With an argument of 'GRACEFUL', Server::SOAP does this:
Close the listening socket
Waits for all pending requests to come in via DONE/FAULT/CLOSE, then removes it's alias

Processing Requests

if you're new to the world of SOAP, reading the documentation by the excellent author of SOAP::Lite is recommended! It also would help to read some stuff at http://www.soapware.org/ -> they have some excellent links :)

Now, once you have set up the services/methods, what do you expect from Server::SOAP? Every request is pretty straightforward, you just get a Server::SOAP::Response object in ARG0.

The Server::SOAP::Response object contains a wealth of information about the specified request:
- There is the SimpleHTTP::Connection object, which gives you connection information
- There is the various SOAP accessors provided via Server::SOAP::Response
- There is the HTTP::Request object
Example information you can get:
$response->connection->remote_ip() # IP of the client
$response->soaprequest->uri() # Original URI
$response->soapmethod() # The SOAP method that was called
$response->soapbody() # The arguments to the method

Probably the most important part of SOAP::Response is the body of the message, which contains the arguments to the method call. The data in the body is a hash, for more information look at SOAP::Lite -> SOAP::Deserializer.

I cannot guarantee what will be in the body, it is all up to the SOAP serializer/deserializer. I can provide some examples:

SEE ALSO

AUTHOR

Apocalypse <apocal@cpan.org>

I took over this module from Rocco Caputo. Here is his stuff:

POE::Component::Server::SOAP is Copyright 2002 by Rocco Caputo. All
rights are reserved. POE::Component::Server::SOAP is free software;
you may redistribute it and/or modify it under the same terms as Perl
itself.
Rocco may be contacted by e-mail via rcaputo@cpan.org.

COPYRIGHT AND LICENSE

Copyright 2009 by Apocalypse

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

Module Install Instructions

To install POE::Component::Server::SOAP, simply copy and paste either of the commands in to your terminal