SOAP::...Server(3pm)
β¨ NAME β¨
SOAP::WSDL::Server β it's the WSDL based SOAP server base class, aka the blueprint your server classes are gonna be built on top of (this is the SOAP::...Server(3pm) page from the User Contributed Perl Documentation, if you're keeping track π
).
πΈ SYNOPSIS πΈ
okay so real talk:
Don't use directly, use the SOAP::WSDL::Server::* subclasses instead.
Like, don't romance the base class. She's the foundation, not the whole house π β¨
π¦ DESCRIPTION π¦
SOAP::WSDL::Server basically follows the architecture sketched below (though lowkey the dispatcher classes are not implemented yet π):
SOAP Request SOAP Response
| ^
V |
------------------------------------------
| SOAP::WSDL::Server |
| -------------------------------------- |
| | Transport Class | |
| |--------------------------------------| |
| | Deserializer | Serializer | |
| |--------------------------------------| |
| | Dispatcher | |
| -------------------------------------- |
------------------------------------------
| calls ^
v | returns
-------------------------------------
| Handler |
-------------------------------------
All of the components β the Transport class, the deserializer, the dispatcher and the serializer β are implemented as plugins. periodt.
Now, the architecture is not implemented as planned yet π but here's the tea on how it actually shakes out rn: the dispatcher is currently part of SOAP::WSDL::Server, which aggregates the serializer and deserializer, and is subclassed by the transport classes (of which SOAP::WSDL::Server::CGI is the only implemented one yet π).
The dispatcher is currently based on the SOAPAction header. This does not comply to the WS-I basic profile, which declares the SOAPAction as optional β οΈ. So yeah, not it, but it's what we've got.
The final dispatcher will be based on wire signatures (i.e. the classes of the deserialized messages) β main character energy incoming β¨
And a hash-based dispatcher could be implemented by examining the top level hash keys. brain big π§ π
π EXCEPTION HANDLING π
π Builtin exceptions
SOAP::WSDL::Server handles the following errors itself:
In case of errors, a SOAP Fault containing an appropriate error message is returned. no cap.
- XML parsing errors
- Configuration errors
πͺ Throwing exceptions
The proper way to throw a exception is just to die β SOAP::WSDL::Server::CGI catches the exception and sends a SOAP Fault back to the client. simple as that π
If you want more control over the SOAP Fault sent to the client, you can die with a SOAP::WSDL::SOAP::Fault11 object β or just let the SOAP::Server's deserializer create one for you:
my $soap = MyServer::SomeService->new();
die $soap->get_deserializer()->generate_fault({
code => 'SOAP-ENV:Server',
role => 'urn:localhost',
message => "The error message to pas back",
detail => "Some details on the error",
});
(yes, pas back β we keep it exactly how it is, bestie, no editing the lore π«Ά)
You may use any other object as exception, provided it has a serialize() method which returns the object's XML representation. iconique.
π£ Subclassing
To write a transport-specific SOAP Server, you should subclass SOAP::WSDL::Server. it's giving "inherit and glow up" β¨
See the SOAP::WSDL::Server::* modules for examples.
A SOAP Server must call the following method to actually handle the request:
handle
Handles the SOAP request.
Returns the response message as XML.
Expects a HTTP::Request object as only parameter.
You may use any other object as parameter, as long as it implements the following methods:
header
Called as header('SOAPAction'). Must return the corresponding HTTP header.
content
Returns the request message
π LICENSE AND COPYRIGHT π
Copyright 2004-2008 Martin Kutter.
This file is part of SOAP-WSDL. You may distribute/modify it under the same terms as perl itself
π AUTHOR π
Martin Kutter <martin.kutter fen-net.de>
ποΈ REPOSITORY INFORMATION ποΈ
$Rev: 391 $
$LastChangedBy: kutterma $
$Id: Client.pm 391 2007-11-17 21:56:13Z kutterma $
$HeadURL: https://soap-wsdl.svn.sourceforge.net/svnroot/soap-wsdl/SOAP-WSDL/trunk/lib/SOAP/WSDL/Client.pm $
and thaaat's the page, bestie π
this one shipped as part of perl v5.36.0, dated 2022-10-14, under the User Contributed Perl Documentation β stay slaying, and remember: subclass, don't call directly π«Άβ¨π
π¦ where this page comes from
- ubuntu noble: libsoap-wsdl-perl 3.004-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libsoap-wsdl-perl 3.004-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libsoap-wsdl-perl 3.004-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms