W3C-SOAP

 view release on metacpan or  search on metacpan

META.json  view on Meta::CPAN

         "version" : "0.14"
      },
      "W3C::SOAP::Exception::HTTP" : {
         "file" : "lib/W3C/SOAP/Exception.pm",
         "version" : "0.14"
      },
      "W3C::SOAP::Exception::XML" : {
         "file" : "lib/W3C/SOAP/Exception.pm",
         "version" : "0.14"
      },
      "W3C::SOAP::Header" : {
         "file" : "lib/W3C/SOAP/Header.pm",
         "version" : "0.14"
      },
      "W3C::SOAP::Header::Security" : {
         "file" : "lib/W3C/SOAP/Header/Security.pm",
         "version" : "0.14"
      },
      "W3C::SOAP::Header::Security::Username" : {
         "file" : "lib/W3C/SOAP/Header/Security/Username.pm",
         "version" : "0.14"
      },
      "W3C::SOAP::Parser" : {
         "file" : "lib/W3C/SOAP/Parser.pm",
         "version" : "0.14"
      },
      "W3C::SOAP::Utils" : {
         "file" : "lib/W3C/SOAP/Utils.pm",
         "version" : "0.14"

META.yml  view on Meta::CPAN

    version: '0.14'
  W3C::SOAP::Exception::Doomed:
    file: lib/W3C/SOAP/Exception.pm
    version: '0.14'
  W3C::SOAP::Exception::HTTP:
    file: lib/W3C/SOAP/Exception.pm
    version: '0.14'
  W3C::SOAP::Exception::XML:
    file: lib/W3C/SOAP/Exception.pm
    version: '0.14'
  W3C::SOAP::Header:
    file: lib/W3C/SOAP/Header.pm
    version: '0.14'
  W3C::SOAP::Header::Security:
    file: lib/W3C/SOAP/Header/Security.pm
    version: '0.14'
  W3C::SOAP::Header::Security::Username:
    file: lib/W3C/SOAP/Header/Security/Username.pm
    version: '0.14'
  W3C::SOAP::Parser:
    file: lib/W3C/SOAP/Parser.pm
    version: '0.14'
  W3C::SOAP::Utils:
    file: lib/W3C/SOAP/Utils.pm
    version: '0.14'
  W3C::SOAP::WSDL:
    file: lib/W3C/SOAP/WSDL.pm

lib/W3C/SOAP/Client.pm  view on Meta::CPAN

use warnings;
use Carp qw/carp croak cluck confess longmess/;
use Scalar::Util;
use List::Util;
use Data::Dumper qw/Dumper/;
use English qw/ -no_match_vars /;
use LWP::UserAgent;
use Try::Tiny;
use XML::LibXML;
use W3C::SOAP::Exception;
use W3C::SOAP::Header;
use Moose::Util::TypeConstraints qw/duck_type/;

extends 'W3C::SOAP::Base';

our $VERSION = 0.14;
our $DEBUG_REQUEST_RESPONSE = $ENV{W3C_SOAP_DEBUG_CLIENT};

has location => (
    is       => 'rw',
    isa      => 'Str',

lib/W3C/SOAP/Header.pm  view on Meta::CPAN

package W3C::SOAP::Header;

# Created on: 2012-05-23 14:32:39
# Create by:  dev
# $Id$
# $Revision$, $HeadURL$, $Date$
# $Revision$, $Source$, $Date$

use Moose;
use warnings;
use Carp;

lib/W3C/SOAP/Header.pm  view on Meta::CPAN

use List::Util;
#use List::MoreUtils;
use Data::Dumper qw/Dumper/;
use English qw/ -no_match_vars /;


our $VERSION = 0.14;

has security => (
    is        => 'rw',
    isa       => 'W3C::SOAP::Header::Security',
    predicate => 'has_security',
);

has message => (
   is => 'rw',
   isa   => 'W3C::SOAP::XSD',
   predicate   => 'has_message',
);

sub to_xml {

lib/W3C/SOAP/Header.pm  view on Meta::CPAN


    return $header;
}

1;

__END__

=head1 NAME

W3C::SOAP::Header - Object to create SOAP headers

=head1 VERSION

This documentation refers to W3C::SOAP::Header version 0.14.

=head1 SYNOPSIS

   use W3C::SOAP::Header;

   # create the XML
   my $xml = $header->to_xml();

=head1 DESCRIPTION

This object allows the construction SOAP headers.

=head1 SUBROUTINES/METHODS

lib/W3C/SOAP/Header/Security.pm  view on Meta::CPAN

package W3C::SOAP::Header::Security;

# Created on: 2012-05-23 14:35:51
# Create by:  dev
# $Id$
# $Revision$, $HeadURL$, $Date$
# $Revision$, $Source$, $Date$

use Moose;
use warnings;
use Carp;

lib/W3C/SOAP/Header/Security.pm  view on Meta::CPAN


    return $sec;
}

1;

__END__

=head1 NAME

W3C::SOAP::Header::Security - Creates a SOAP Header WS-Security object

=head1 VERSION

This documentation refers to W3C::SOAP::Header::Security version 0.14.


=head1 SYNOPSIS

   use W3C::SOAP::Header::Security;

   # Brief but working code example(s) here showing the most common usage(s)
   # This section will be as far as many users bother reading, so make it as
   # educational and exemplary as possible.


=head1 DESCRIPTION


=head1 SUBROUTINES/METHODS

lib/W3C/SOAP/Header/Security/Username.pm  view on Meta::CPAN

package W3C::SOAP::Header::Security::Username;

# Created on: 2012-05-23 14:38:06
# Create by:  dev
# $Id$
# $Revision$, $HeadURL$, $Date$
# $Revision$, $Source$, $Date$

use Moose;
use warnings;
use Carp;
use DateTime;
use Time::HiRes qw/gettimeofday/;
use English qw/ -no_match_vars /;

extends 'W3C::SOAP::Header::Security';

our $VERSION = 0.14;
my $id = 0;

has username => (
    is       => 'rw',
    isa      => 'Str',
    required => 1,
);
has password => (

lib/W3C/SOAP/Header/Security/Username.pm  view on Meta::CPAN

    # Moose 2
    #return $uname_token;
}

1;

__END__

=head1 NAME

W3C::SOAP::Header::Security::Username - Creates a WS-Security User name object

=head1 VERSION

This documentation refers to W3C::SOAP::Header::Security::Username version 0.14.

=head1 SYNOPSIS

   use W3C::SOAP::Header::Security::Username;

   # Brief but working code example(s) here showing the most common usage(s)
   # This section will be as far as many users bother reading, so make it as
   # educational and exemplary as possible.


=head1 DESCRIPTION


=head1 SUBROUTINES/METHODS

lib/W3C/SOAP/WSDL.pm  view on Meta::CPAN

use Data::Dumper qw/Dumper/;
use English qw/ -no_match_vars /;
use Try::Tiny;

extends 'W3C::SOAP::Client';

our $VERSION = 0.14;

has header => (
    is        => 'rw',
    isa       => 'W3C::SOAP::Header',
    predicate => 'has_header',
    builder   => '_header',
);

sub _request {
    my ($self, $action, @args) = @_;
    my $meta      = $self->meta;
    my $method    = $self->_get_operation_method($action);
    my $operation = $method->wsdl_operation;
    my $resp;

lib/W3C/SOAP/WSDL.pm  view on Meta::CPAN

    my ($self, $xml) = @_;
    my %map
        = map {$_->name =~ /^xmlns:?(.*)$/; ($_->value => $1)}
        grep { $_->name =~ /^xmlns/ }
        $xml->firstChild->getAttributes;

    return $map{'http://schemas.xmlsoap.org/soap/envelope/'};
}

sub _header {
    return W3C::SOAP::Header->new;
}

1;

__END__

=head1 NAME

W3C::SOAP::WSDL - A SOAP WSDL Client object

t/00-load.t  view on Meta::CPAN

use strict;
use warnings;
use Test::More;

use_ok('W3C::SOAP');
use_ok('W3C::SOAP::Base');
use_ok('W3C::SOAP::Client');
use_ok('W3C::SOAP::Document');
use_ok('W3C::SOAP::Document::Node');
use_ok('W3C::SOAP::Exception');
use_ok('W3C::SOAP::Header');
use_ok('W3C::SOAP::Header::Security');
use_ok('W3C::SOAP::Header::Security::Username');
use_ok('W3C::SOAP::WSDL');
use_ok('W3C::SOAP::WSDL::Parser');
use_ok('W3C::SOAP::WSDL::Document');
use_ok('W3C::SOAP::WSDL::Document::Operation');
use_ok('W3C::SOAP::WSDL::Document::Service');
use_ok('W3C::SOAP::WSDL::Document::Node');
use_ok('W3C::SOAP::WSDL::Document::Binding');
use_ok('W3C::SOAP::WSDL::Document::Port');
use_ok('W3C::SOAP::WSDL::Document::Policy');
use_ok('W3C::SOAP::WSDL::Document::Message');

t/sec-username.t  view on Meta::CPAN

#!/usr/bin/perl

use strict;
use warnings;
use Test::More;
use Test::Warnings;
use W3C::SOAP::Header::Security::Username;
use XML::LibXML;
BEGIN {
    eval { require Test::XML };
    if ($@) {
        plan(skip_all => "Can't run with out Test::XML");
    }
    Test::XML->import;
};

xml();
done_testing();

sub xml {
    my $su = W3C::SOAP::Header::Security::Username->new(
        username => 'uname',
        password => 'secure',
    );
    my $xml = XML::LibXML->load_xml(string => <<'XML');
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soapenv:Header/>
    <soapenv:Body/>
</soapenv:Envelope>
XML



( run in 0.444 second using v1.01-cache-2.11-cpan-454fe037f31 )