| 1 | package W3C::SOAP::Header; | ||||||||||
| 2 | |||||||||||
| 3 | # Created on: 2012-05-23 14:32:39 | ||||||||||
| 4 | # Create by: dev | ||||||||||
| 5 | # $Id$ | ||||||||||
| 6 | # $Revision$, $HeadURL$, $Date$ | ||||||||||
| 7 | # $Revision$, $Source$, $Date$ | ||||||||||
| 8 | |||||||||||
| 9 | 5 | ▶ | use Moose; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | 5 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | 5 | ▶ | use Carp; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 12 | 5 | ▶ | use Scalar::Util; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 13 | 5 | ▶ | use List::Util; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 14 | #use List::MoreUtils; | ||||||||||
| 15 | 5 | ▶ | use Data::Dumper qw/Dumper/; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 16 | 5 | ▶ | use English qw/ -no_match_vars /; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 17 | |||||||||||
| 18 | |||||||||||
| 19 | 5 | our $VERSION = 0.13; | |||||||||
| 20 | |||||||||||
| 21 | 5 | has security => ( | |||||||||
| 22 | is => 'rw', | ||||||||||
| 23 | isa => 'W3C::SOAP::Header::Security', | ||||||||||
| 24 | predicate => 'has_security', | ||||||||||
| 25 | ); | ||||||||||
| 26 | |||||||||||
| 27 | 5 | has message => ( | |||||||||
| 28 | is => 'rw', | ||||||||||
| 29 | isa => 'W3C::SOAP::XSD', | ||||||||||
| 30 | predicate => 'has_message', | ||||||||||
| 31 | ); | ||||||||||
| 32 | |||||||||||
| 33 | sub to_xml { | ||||||||||
| 34 | 3 | ▶ | my ($self, $xml) = @_; | ||||||||
|
Subroutine
to_xml: called CC=4 SCAR=14.0
Pod
documented
| |||||||||||
| 35 | |||||||||||
| 36 | 3 | my $header = $xml->createElement('soapenv:Header'); | |||||||||
| 37 | |||||||||||
| 38 | 3 | ▶ | if ($self->has_security) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 39 | 0 | $header->appendChild($self->security->to_xml($xml)); | |||||||||
| 40 | } | ||||||||||
| 41 | 3 | ▶ | if ($self->has_message) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 42 | 1 | for my $node ( $self->message->to_xml($xml) ) { | |||||||||
| 43 | 1 | $header->appendChild($node); | |||||||||
| 44 | } | ||||||||||
| 45 | } | ||||||||||
| 46 | |||||||||||
| 47 | 3 | return $header; | |||||||||
| 48 | } | ||||||||||
| 49 | |||||||||||
| 50 | 5 | 1; | |||||||||
| 51 | |||||||||||
| 52 | __END__ | ||||||||||
| 53 | |||||||||||
| 54 | =head1 NAME | ||||||||||
| 55 | |||||||||||
| 56 | W3C::SOAP::Header - Object to create SOAP headers | ||||||||||
| 57 | |||||||||||
| 58 | =head1 VERSION | ||||||||||
| 59 | |||||||||||
| 60 | This documentation refers to W3C::SOAP::Header version 0.13. | ||||||||||
| 61 | |||||||||||
| 62 | =head1 SYNOPSIS | ||||||||||
| 63 | |||||||||||
| 64 | use W3C::SOAP::Header; | ||||||||||
| 65 | |||||||||||
| 66 | # create the XML | ||||||||||
| 67 | my $xml = $header->to_xml(); | ||||||||||
| 68 | |||||||||||
| 69 | =head1 DESCRIPTION | ||||||||||
| 70 | |||||||||||
| 71 | This object allows the construction SOAP headers. | ||||||||||
| 72 | |||||||||||
| 73 | =head1 SUBROUTINES/METHODS | ||||||||||
| 74 | |||||||||||
| 75 | =over 4 | ||||||||||
| 76 | |||||||||||
| 77 | =item C<to_xml ($xml)> | ||||||||||
| 78 | |||||||||||
| 79 | Coverts this object to XML | ||||||||||
| 80 | |||||||||||
| 81 | =back | ||||||||||
| 82 | |||||||||||
| 83 | =head1 DIAGNOSTICS | ||||||||||
| 84 | |||||||||||
| 85 | =head1 CONFIGURATION AND ENVIRONMENT | ||||||||||
| 86 | |||||||||||
| 87 | =head1 DEPENDENCIES | ||||||||||
| 88 | |||||||||||
| 89 | =head1 INCOMPATIBILITIES | ||||||||||
| 90 | |||||||||||
| 91 | =head1 BUGS AND LIMITATIONS | ||||||||||
| 92 | |||||||||||
| 93 | There are no known bugs in this module. | ||||||||||
| 94 | |||||||||||
| 95 | Please report problems to Ivan Wills - (ivan.wills@gmail.com) | ||||||||||
| 96 | |||||||||||
| 97 | Patches are welcome. | ||||||||||
| 98 | |||||||||||
| 99 | =head1 AUTHOR | ||||||||||
| 100 | |||||||||||
| 101 | Ivan Wills - (ivan.wills@gmail.com) | ||||||||||
| 102 | |||||||||||
| 103 | =head1 LICENSE AND COPYRIGHT | ||||||||||
| 104 | |||||||||||
| 105 | Copyright (c) 2012 Ivan Wills (14 Mullion Close, Hornsby Heights, NSW Australia 2077). | ||||||||||
| 106 | All rights reserved. | ||||||||||
| 107 | |||||||||||
| 108 | This module is free software; you can redistribute it and/or modify it under | ||||||||||
| 109 | the same terms as Perl itself. See L<perlartistic>. This program is | ||||||||||
| 110 | distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; | ||||||||||
| 111 | without even the implied warranty of MERCHANTABILITY or FITNESS FOR A | ||||||||||
| 112 | PARTICULAR PURPOSE. | ||||||||||
| 113 | |||||||||||
| 114 | =cut | ||||||||||