
SOAP::Message - Really simple SOAP

Simple SOAP for the unwashed masses

use SOAP::Message;
## Procedural interface
# Make SOAP
my $message = SOAP::Message::create(
version => '1.1',
body => $xml_data,
);
# Receive SOAP
my ( $header,$body ) = SOAP::Message::parse( $incoming );
## OO interface
# Set some defaults up...
my $object = SOAP::Message->new( version => '1.2', prefix => 'SOAP' );
# Then just continue as normal...
my $message = $object->create( body => $body, header => $header );
# And for convenience...
my ( $header, $body ) = $object->parse( $incoming );

90% of using SOAP appears to be jumping through many hoops to do something pretty simple - putting an XML wrapper around another piece of XML, or removing the XML wrapper around a piece of XML.
That's all this package does. And not particularly cleverly. And that's all it wants to do. Chances are it handles everything you need it to.

Creates a new SOAP message. Accepts:
version - which can either be 1.1 or 1.2. Defaults to 1.1. This affects what the namespace will be:
http://schemas.xmlsoap.org/soap/envelope/ - 1.1 http://www.w3.org/2003/05/soap-envelope - 1.2
Optional.
body - which is the message body, and can be anything you fancy. Optional.
header - which is the header, and can be anything you want. Optional.
prefix - which is the prefix we use. Defaults to 'env'. Common examples soapenv, soap, env and so on. Optional. We don't perform any validation on this.
Returns a string containing your SOAP message.
Parses a SOAP message in a string. Returns a list containing the header and the body as strings.
Like parse(), but returns XML::XPath::Nodeset objects instead.
Accepts the same arguments as create(), and sets them as the defaults for subsequent calls to create.

Peter Sergeant - pete@clueball.com