in reply to Reading the SOAP Request

https://metacpan.org/module/SOAP::Server#SOAP::Server::Parameters

My soap tips (I hate soap), SOAP::Lite is too much work, SOAP::Simple is less work (but its simple, when stuck go to XML::Compile::SOAP, more verbose, but you want verbose with SOAP ) ... its built on XML::Compile::SOAP/http://perl.overmeer.net/xml-compile/#doc , see my treasure trove of soap examples and lost knowledge,$soap->transport->add_handler("request_send", \&pp_dump );, http://cookbook.soaplite.com/, SOAP endpoint , Re^3: SOAP::Lite login setup, Re: I do not understand how to write a SOAP server., An XML Overview Towards Understanding SOAP, Re^3: SOAP::Lite and custom envelopes, The XML FIles: Understanding XML Namespaces, How to Call a .NET-based Web Service Using the SOAP::Lite Perl Library (don't use XML::Compile )

  • Comment on Re: Reading the SOAP Request (SOAP::Server::Parameters)

Replies are listed 'Best First'.
Re^2: Reading the SOAP Request (SOAP::Server::Parameters)
by hpham01 (Initiate) on Jul 31, 2013 at 07:01 UTC

    I think you can turn on debugging by:

    use SOAP::Lite 'trace', 'debug';

    When you execute it you, should be able to see the SOAP message for your debugging

      Well, that doesn't have much of anything to do with retrieving the request object
Re^2: Reading the SOAP Request (SOAP::Server::Parameters)
by markdibley (Sexton) on Jul 31, 2013 at 11:01 UTC

    Thanks for the pointer to

    https://metacpan.org/module/SOAP::Server#SOAP::Server::Parameters

    So, essentially all I have to do is add the following to the top of my module and it adds a SOAP::SOM object to the variables passed to any method called as a SOAP service.

    use vars qw(@ISA); @ISA = qw(Exporter SOAP::Server::Parameters);

    The additional variable allows access to the envelope which has a whole load of useful stuff in there including access to the request. And access to the request can be done like in the following example

    sub mymethod{ my $envelope = pop(@_); my $sample_id = $envelope->dataof("//sample_id")->value if(defined + $envelope->dataof("//sample_id")); my $match_id = $envelope->dataof("//match_id")->value if(defined $ +envelope->dataof("//match_id")); }

    This is great as that means I can do my own verifying of the request data.

    Thanks again for the pointer.