SOAP-Lite

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN


1.19 August 26, 2015
    ! #106665 Correct the version manually, no autoversioning, and the maintainer screwed up

1.18 August 25, 2015
    ! Fix a couple of cases where undefined values were being passed to functions [github/redhotpenguin]
    ! Do not set content_length for compressed request [github/bor]
    ! Add test for check return of send_receive(), add titles for some tests [github/bor]

1.17 July 30, 2015
    ! #106051 Fix utf8 encoding for CGI test (thanks cpan/ETHER for tips)

1.16 July 23, 2015
    ! Fix empty release. Note to self - do not release code when wife is in early labor

1.15 July 21, 2015
    + Preventing "billion laughs" exponential entity expansion attack [github/thilo-fester]

1.14 March 24, 2015
    + Add header and body tags [@bubi6608]
    ! Fixed typo in trace logging example [@oschwald]

README  view on Meta::CPAN

        The prefix itself has no meaning, but applications may wish to chose
        one explicitly to denote different versions of SOAP or the like.

    encprefix(QName)
            $client->encprefix('enc');

        This method is a shortcut for:

            $client->serializer->encprefix(QName);

        Gets or sets the namespace prefix for the encoding rules namespace.
        The default value is SOAP-ENC.

    While it may seem to be an unnecessary operation to set a value that
    isn't relevant to the message, such as the namespace labels for the
    envelope and encoding URNs, the ability to set these labels explicitly
    can prove to be a great aid in distinguishing and debugging messages on
    the server side of operations.

    encoding(encoding URN)
            $client->encoding($soap_12_encoding_URN);

        This method is a shortcut for:

            $client->serializer->encoding(args);

        Where the earlier method dealt with the label used for the
        attributes related to the SOAP encoding scheme, this method actually
        sets the URN to be specified as the encoding scheme for the message.
        The default is to specify the encoding for SOAP 1.1, so this is
        handy for applications that need to encode according to SOAP 1.2
        rules.

    typelookup
            $client->typelookup;

        This method is a shortcut for:

            $client->serializer->typelookup;

ReleaseNotes.txt  view on Meta::CPAN


NO ENTITY DECODING
SOAP::Lite uses XML::Parser::Lite which relies on Unicode support in Perl and
doesn't perform XML ENTITY decoding. 

LIMITED SUPPORT FOR MUSTUNDERSTAND and ACTOR ATTRIBUTES
SOAP::Lite does not currently heed the soap:mustUnderstand XML attribute, or
SOAP actor attributes. 

DOCUMENT-LITERAL SUPPORT
All literal encoding support for SOAP::Lite is marked EXPERIMENTAL, and it is
incomplete. Developers are encouraged to use this capability but should be
fore-warned.
As an alternative, SOAP::WSDL or XML::Compiled::SOAP may be used for 
document/literal bindings derived from WSDL definitions.

CLIENT SIDE WSDL SUPPORT
SOAP::Lites ability to consume a WSDL and generate the necessary message based
on that WSDL is improving, but it does not work with complex types.
As an alternative, SOAP::WSDL or XML::Compiled::SOAP may be used for 
document/literal bindings derived from WSDL definitions.

bin/SOAPsh.pl  view on Meta::CPAN

  perl SOAPsh.pl http://soap.4s4c.com/ssss4c/soap.asp http://simon.fell.com/calc doubler([10,20,30])
  > Ctrl-D (Ctrl-Z on Windows)

=head1 DESCRIPTION

SOAPsh.pl is a shell for making SOAP calls. It takes two parameters:
mandatory endpoint and optional uri (actually it will tell you about it
if you try to run it). Additional commands can follow.

After that you'll be able to run any methods of SOAP::Lite, like autotype,
readable, encoding, etc. You can run it the same way as you do it in
your Perl script. You'll see output from method, result of SOAP call,
detailed info on SOAP faulure or transport error.

For full list of available methods see documentation for SOAP::Lite.

Along with methods of SOAP::Lite you'll be able (and that's much more
interesting) run any SOAP methods you know about on remote server and
see processed results. You can even switch on debugging (with call
something like: C<on_debug(sub{print@_})>) and see SOAP code with
headers sent and received.

examples/WSDL/say_hello_rpcenc.wsdl  view on Meta::CPAN

       <output message="s0:sayHelloResponse" />
     </operation>
   </portType>

   <binding name="Service1Soap" type="s0:Service1Soap">
     <soap:binding transport="http://schemas.xmlsoap.org/soap/http"
         style="rpc" />
     <operation name="sayHello">
       <soap:operation soapAction="urn:HelloWorld#sayHello"/>
       <input>
         <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
       </input>
       <output>
         <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
       </output>
     </operation>
   </binding>
   <service name="HelloWorld">
     <port name="HelloWorldSoap" binding="s0:Service1Soap">
       <soap:address location="http://localhost:80/soap-wsdl-test/helloworld.pl" />
     </port>
   </service>
  </definitions>

examples/XML/customxml.pl  view on Meta::CPAN

  -> valueof('/Envelope/Body');

foreach my $portfolio ($d->Report->Request->Composition->PortfolioDistribution) {
  print $portfolio->type, " ", $portfolio->date, "\n";
  foreach my $row ($portfolio->Row) {
    print "  ", $row->Element, " ", $row->Value, "\n";
  }
}

__DATA__
<?xml version="1.0" encoding="UTF-8"?>
<Envelope version="1.1">
  <Header />
  <Body>
    <Report>
      <Header>
        <ClientRef />
        <FundCusip>61744J366</FundCusip>
        <SepAcctDesc />
      </Header>
      <Request>

examples/customschema.pl  view on Meta::CPAN

sub as_TickDirection { $_[1] }
sub as_Exchanges { $_[1] }

package main;

use SOAP::Lite;

$d = SOAP::Deserializer->new;
$d->xmlschemas->{'http://marketdata.earthconnect.net/encodedTypes'} = 'EncodedTypes';

$r = $d->deserialize(q!<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns="http://marketdata.earthconnect.net/"
xmlns:types="http://marketdata.earthconnect.net/encodedTypes"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">

<soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<tns:GetProfessionalQuoteResponse>
  <GetProfessionalQuoteResult href="#id1" />
</tns:GetProfessionalQuoteResponse>

<soapenc:Array id="id1" soapenc:arrayType="types:ProfessionalQuote[1]">
  <Item href="#id2" />
</soapenc:Array>

<types:ProfessionalQuote id="id2" xsi:type="types:ProfessionalQuote">
  <CompanyName xsi:type="xsd:string">EarthConnect Corporation</CompanyName>

examples/forms/style.html  view on Meta::CPAN

<html>
<head><title>SOAP::Lite POST Examples</title></head>
<body>

<h1>SOAP::Lite Examples</h1>
<hr>

<form action="http://services.soaplite.com/style.cgi" method="POST" enctype="multipart/form-data">
<input type="hidden" name="payload" value='<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3...
<input name="echo" value="37.5">
<input type="submit">
</form>

</html>

examples/oo-apache.pl  view on Meta::CPAN

# connect to service that described by Graham Glass:
# http://www-106.ibm.com/developerworks/library/ws-peer3/?dwzone=ws
# ---------------------------------------------------------------------

use SOAP::Lite;

my $invoice = bless {name => 'My invoice', amount => 41} => 'Invoice';

my $soap = SOAP::Lite
  -> proxy('http://localhost:8080/soap/servlet/rpcrouter')
  -> maptype({Invoice => 'urn:my_encoding'})
  -> uri('urn:demo2:purchasing');

$a = $soap->receive($invoice)->result;
print 'type: ', ref $a, "\n";
print '  name: ', $a->{name}, "\n";
print '  amount: ', $a->{amount}, "\n";

lib/SOAP/Constants.pm  view on Meta::CPAN


our $VERSION = '1.27'; # VERSION

use constant    URI_1999_SCHEMA_XSD    => "http://www.w3.org/1999/XMLSchema";
use constant    URI_1999_SCHEMA_XSI    => "http://www.w3.org/1999/XMLSchema-instance";
use constant    URI_2000_SCHEMA_XSD    => "http://www.w3.org/2000/10/XMLSchema";
use constant    URI_2000_SCHEMA_XSI    => "http://www.w3.org/2000/10/XMLSchema-instance";
use constant    URI_2001_SCHEMA_XSD    => "http://www.w3.org/2001/XMLSchema";
use constant    URI_2001_SCHEMA_XSI    => "http://www.w3.org/2001/XMLSchema-instance";
use constant    URI_LITERAL_ENC        => "";
use constant    URI_SOAP11_ENC         => "http://schemas.xmlsoap.org/soap/encoding/";
use constant    URI_SOAP11_ENV         => "http://schemas.xmlsoap.org/soap/envelope/";
use constant    URI_SOAP11_NEXT_ACTOR  => "http://schemas.xmlsoap.org/soap/actor/next";
use constant    URI_SOAP12_ENC         => "http://www.w3.org/2003/05/soap-encoding";
use constant    URI_SOAP12_ENV         => "http://www.w3.org/2003/05/soap-envelope";
use constant    URI_SOAP12_NOENC       => "http://www.w3.org/2003/05/soap-envelope/encoding/none";
use constant    URI_SOAP12_NEXT_ACTOR  => "http://www.w3.org/2003/05/soap-envelope/role/next";

use vars qw($NSMASK $ELMASK);

$NSMASK = '[a-zA-Z_:][\w.\-:]*';
$ELMASK = '^(?![xX][mM][lL])[a-zA-Z_][\w.\-]*$';

use vars qw($NEXT_ACTOR $NS_ENV $NS_ENC $NS_APS
    $FAULT_CLIENT $FAULT_SERVER $FAULT_VERSION_MISMATCH
    $HTTP_ON_FAULT_CODE $HTTP_ON_SUCCESS_CODE $FAULT_MUST_UNDERSTAND

lib/SOAP/Packager.pm  view on Meta::CPAN

# ======================================================================

package SOAP::Packager::MIME;

use strict;
use vars qw(@ISA);
@ISA = qw(SOAP::Packager);

sub BEGIN {
  no strict 'refs';
  for my $method ( qw(transfer_encoding env_id env_location) ) {
    my $field = '_' . $method;
    *$method = sub {
      my $self = shift;
      if (@_) { $self->{$field} = shift; return $self }
      return $self->{$field};
    }
  }
}

sub new {
    my ($classname) = @_;
    my $self = SOAP::Packager::new(@_);
    $self->{'_content_encoding'} = '8bit';
    $self->{'_env_id'}           = '<main_envelope>';
    $self->{'_env_location'}     = '/main_envelope';
    bless $self, $classname;
    $SOAP::Packager::SUPPORTED_TYPES->{"MIME::Entity"} = 1;
    return $self;
}

sub initialize_parser {
  my $self = shift;
  eval "require MIME::Parser;";

lib/SOAP/SOM.pod  view on Meta::CPAN

=item valueof(node)

    $res = $som->valueof('[1]');

When the SOAP::SOM object has matched a path internally with the match method, this method allows retrieval of the data within any of the matched nodes. The data comes back as native Perl data, not a class instance (see dataof). In a scalar context, ...

=item dataof(node)

    $resobj = $som->dataof('[1]');

Performs the same operation as the earlier valueof method, except that the data is left in its L<SOAP::Data> form, rather than being deserialized. This allows full access to all the attributes that were serialized along with the data, such as namespa...

=item headerof(node)

    $resobj = $som->headerof('[1]');

Acts much like dataof, except that it returns an object of the L<SOAP::Header> class (covered later in this chapter), rather than SOAP::Data. This is the preferred interface for manipulating the header entities in a message.

=item namespaceuriof(node)

    $ns = $som->namespaceof('[1]');

lib/SOAP/Serializer.pod  view on Meta::CPAN

=item response

The message being created is that of a response stemming from a RPC-style method call.

=item fault

For this specifier, the envelope being created is to transmit a fault.

=item freeform

This identifier is used as a general-case encoding style for messages that
don't fit into any of the previous cases. The arguments are encoded into the
envelope's Body tag without any sort of context sensitivity.

=back

Any value other than these four results in an error.

=item envprefix(optional value)

    $serialize->envprefix('env');

Gets or sets the prefix that labels the SOAP envelope namespace. This defaults to SOAP-ENV.

=item encprefix(optional value)

    $serialize->envprefix('enc');

Gets or sets the prefix that labels the SOAP encoding namespace. Defaults to SOAP-ENC.

=item soapversion(optional value)

    $serialize->soapversion('1.2');

If no parameter is given, returns the current version of SOAP that is being used as the basis for serializing messages. If a parameter is given, attempts to set that as the version of SOAP being used. The value should be either 1.1 or 1.2. When the S...

=item xmlschema(optional value)

    $serialize->xmlschema($xml_schema_1999);

Gets or sets the URN for the schema being used to express the structure of the XML generated by the serializer. If setting the value, the input must be the full URN for the new schema and is checked against the list of known SOAP schemas.

=item register_ns

The register_ns subroutine allows users to register a global namespace

lib/SOAP/Server.pod  view on Meta::CPAN

=item name

The name of the method to call.

=back

=item handle

    $server->handle($request_text);

Implements the main functionality of the serving process, in which the server takes an incoming request and dispatches it to the correct server-side subroutine. The parameter taken as input is either plain XML or MIME-encoded content (if MIME-encodin...

=item make_fault

    return $server->makefault($code, $message);

Creates a SOAP::Fault object from the data passed in. The order of arguments is: code, message, detail, actor. The first two are required (because they must be present in all faults), but the last two may be omitted unless needed.

=back

=head2 SOAP::Server::Parameters

lib/SOAP/Transport.pod  view on Meta::CPAN

    $client->send_recieve(%hash_table);

(Required for client classes only) When the SOAP::Lite objects attempt to send out requests, the means for doing so is to attempt to call this method on the object held within the SOAP::Transport object contained within the client itself. All clients...

=over

=item action

The URI specifying the action being performed, usually the result from the on_action hook on the client object.

=item encoding

The URI of the encoding scheme that governs the message being sent.

=item endpoint

The URI specifying the endpoint to which the message is being sent.

=item envelope

The XML content of the message to be sent. It is generally the return value of the envelope method from the L<SOAP::Serializer> object instance that the client object maintains.

=item parts

lib/SOAP/Utils.pod  view on Meta::CPAN

# ======================================================================

=pod

=head1 NAME

SOAP::Utils - a utility package for SOAP::Lite

=head1 DESCRIPTION

This class gives you access to a number of subroutines to assist in data formatting, encoding, etc. Many of the subroutines are private, and are not documented here, but a few are made public.

=head1 METHODS

=over

=item format_datetime

Returns a valid xsd:datetime string given a time object returned by Perl's localtime function. Usage:

    print SOAP::Utils::format_datetime(localtime);

t/01-core.t  view on Meta::CPAN

  $SIG{__WARN__} = sub { ; }; # turn off deprecation warnings
  $serialized = SOAP::Serializer->use_prefix(1)->uri("urn:Test")->method(
    'testMethod', SOAP::Data->name(test => 123)
  );
  ok($serialized =~ m!<soap:Body><namesp(\d):testMethod><test xsi:type="xsd:int">123</test></namesp\1:testMethod></soap:Body>!);

  # test 3 - turn ON default namespace
  $serialized = SOAP::Serializer->use_prefix(0)->uri("urn:Test")->method(
    'testMethod', SOAP::Data->name(test => 123)
  );
  ok($serialized =~ m!<soap:Envelope(?: xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"| xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"| xmlns:xsd="http://www.w3.org/2001/XMLSchema"| soap:encodingStyle="http://schemas.xmlsoap.org/soa...

}

{ # check use of default_ns, ns, and use_prefix
  # test 4
  $serialized = SOAP::Serializer->ns("urn:Test")->method(
    'testMethod', SOAP::Data->name(test => 123)
  );
  ok($serialized =~ m!<namesp(\d):testMethod><test xsi:type="xsd:int">123</test></namesp\1:testMethod>!);

t/013-array-deserialization.t  view on Meta::CPAN

my $som = SOAP::Deserializer->new->deserialize($xml);
my $result = $som->result();

ok (@$result == 2);
ok $result->[0]->isa('outer');
ok $result->[1]->isa('outer');
ok $result->[1]->{ kids }->[0]->isa('inner');
ok $result->[1]->{ kids }->[1]->isa('inner');

__DATA__
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
                  xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
                  xmlns:apachesoap="http://xml.apache.org/xml-soap"
                  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  xmlns:my="urn:MyNamespace"
                  soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
 <soapenv:Body>
  <my:response>
   <my:return href="#id0"/>
  </my:response>
  <multiRef id="id0" soapenc:root="0" xsi:type="apachesoap:Vector">
   <item href="#id1"/>
   <item href="#id5"/>
  </multiRef>
  <multiRef id="id1" soapenc:root="0" xsi:type="my:outer">
   <name xsi:type="xsd:string">a</name>

t/02-payload.t  view on Meta::CPAN

use SOAP::Lite;
$SIG{__WARN__} = sub { ; }; # turn off deprecation warnings

my($a, $s, $r, $serialized, $deserialized);

{ # check root, mustUnderstand
  print "root and mustUnderstand attributes with SOAP::Data test(s)...\n";

  $serialized = SOAP::Serializer->serialize(SOAP::Data->root(1 => 1)->name('rootandunderstand')->mustUnderstand(1));

  ok($serialized =~ m!<rootandunderstand( xsi:type="xsd:int"| soap:mustUnderstand="1"| soapenc:root="1"| xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"| xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"| xmlns:xsi="http://www.w3.org/2...
}

{ # check deserialization of envelope with result
  print "Deserialization of envelope with result test(s)...\n";

  $deserialized = SOAP::Deserializer->deserialize('<?xml version="1.0"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
	 xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
	 xmlns:xsd="http://www.w3.org/2001/XMLSchema"
	 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	 soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<soap:Body>
<m:doublerResponse xmlns:m="http://simon.fell.com/calc">
<nums xsi:type="soapenc:Array" soapenc:arrayType="xsd:int[5]">
<item xsi:type="xsd:int">20</item>
<item xsi:type="xsd:int">40</item>
<item xsi:type="xsd:int">60</item>
<item xsi:type="xsd:int">100</item>
<item xsi:type="xsd:int">200</item>
</nums>
</m:doublerResponse>

t/08-schema.t  view on Meta::CPAN


use SOAP::Lite;

my($a, $s, $r, $serialized, $deserialized);

{ # check deserialization of envelope with result
  print "Deserialization of envelope with result test(s)...\n";

  $deserialized = SOAP::Deserializer->deserialize('<?xml version="1.0"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
	 xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
	 xmlns:xsd="http://www.w3.org/2001/XMLSchema"
	 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<m:doublerResponse xmlns:m="http://simon.fell.com/calc">
<nums xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:int[5]">
<item xsi:type="xsd:int">20</item>
<item xsi:type="xsd:int">40</item>
<item xsi:type="xsd:int">60</item>
<item xsi:type="xsd:int">100</item>
<item xsi:type="xsd:int">200</item>
</nums>
</m:doublerResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
');

  ok($deserialized->result->[2] == 60);
  ok((my @array = $deserialized->paramsall) == 1);
  ok(ref $deserialized->body eq 'HASH'); # not blessed anymore since 0.51
}

{
  print "hex encoding test(s)...\n";

  $a = "\0 {a}\1";
  $serialized = SOAP::Serializer->serialize(SOAP::Data->type(hex => $a));

  ok($serialized =~ />00207B617D01</);
  ok(SOAP::Deserializer->deserialize($serialized)->root eq $a);
}

{
  print "Deserialization of 1999/2001 schemas test(s)...\n";

  foreach (split "\n", <<EOX) {
<i xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="SOAP-ENC:integer">12</i>
<i xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xsd:nonNegativeInteger">12</i>
<i xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xsd:anySimpleType">12</i>
<i xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xsd:anyType">12</i>
<i xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xsi:type="xsd:ur-type">12</i>
<SOAP-ENC:integer xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">12</SOAP-ENC:integer>
<i>12</i>
EOX
    $deserialized = SOAP::Deserializer->deserialize($_);
    ok($deserialized->root == 12);
  }

  eval { SOAP::Deserializer->deserialize('<i xmlns:xsd="http://www.w3.org/1999/XMLSchema" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xsi:type="xsd:something">12</i>') };
  ok($@ =~ m!Unrecognized type '\{http://www.w3.org/1999/XMLSchema\}something'!);

  eval { SOAP::Deserializer->deserialize('<i xmlns:xsd="http://some.thing.else/XMLSchema" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xsi:type="xsd:something">12</i>') };

t/Issues/rt53375.t  view on Meta::CPAN

use XML::Parser::Lite;

my $comment = '';
my $parser = new XML::Parser::Lite(
	Handlers => {
		Comment => sub { $comment .= $_[1]; },
	}
);

my $xml = <<'EOT';
<?xml version="1.0" encoding="UTF-8"?>
<!-- seed-viewer -->
<test>
</test>
EOT

eval {
    $parser->parse($xml);
};
ok(! $@);
is($comment, ' seed-viewer ');

$comment = '';
$xml = <<'EOT';
<?xml version="1.0" encoding="UTF-8"?>
<!-- seed_viewer -->
<test>
</test>
EOT
eval {
    $parser->parse($xml);
};
ok(! $@);
is($comment, ' seed_viewer ');

t/Issues/rt72836.t  view on Meta::CPAN


sub new {
    my ( $class ) = @_;
    my $self = bless {}, ref($class) || $class;
    $self;
}

sub do_something {
    my $self = shift;
    my $som = pop;
    #$som->context->serializer->encodingStyle(""); # does adding this affect the fix?
    return SOAP::Data->name(wotsit => "doofer");
}

package main;

use Test::More;
use SOAP::Lite;
eval { require Test::XML }
    or plan skip_all => 'Cannot test without Test::XML';

my $req11 = '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:Something"><soapenv:Header/><soapenv:Body><urn:do_something><stuff>things</stuff></urn:do_something></soapenv:Body></soapenv:Envelope>';

my $req12 = '<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope" xmlns:urn="urn:Something"><soapenv:Header/><soapenv:Body><urn:do_something><stuff>things</stuff></urn:do_something></soapenv:Body></soapenv:Envelope>';

my $expected_11 = '<?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" soap:encodingStyle="h...

my $expected_12 = '<?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenc="http://www.w3.org/2003/05/soap-encoding" xmlns:xsd="http://www.w3.org/2001/XMLSchema" soap:encodingStyle="htt...

my $t = DoThingsWithStuff->new;

my $s = SOAP::Server->new;
$s->dispatch_with({
    "urn:Something" => $t
});

my $res_11_1 = $s->handle($req11);
Test::XML::is_xml($res_11_1, $expected_11, "Got correct SOAP 1.1 response");

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 3.159 seconds using v1.00-cache-2.02-grep-82fe00e-cpan-1925d2aa809 )