WSO2::WSF::WSHeader - Create a WSHeader object.


WSO2-WSF-Perl documentation  | view source Contained in the WSO2-WSF-Perl distribution.

Index


NAME

Top

WSO2::WSF::WSHeader - Create a WSHeader object.

SYNOPSYS

Top

  my $header = new WSO2::WSF::WSHeader( { WSHEADER_OPTIONS } );

  my $header = new WSO2::WSF::WSHeader( { 'name' => 'person',
                                          'data' => 'Frodo',
                                          ...
                                        } );

  my $client = new WSO2::WSF::WSClient( { ...
                                          'inputHeaders' => [ $header ],
                                          ...
                                        } );

DESCRIPTION

Top

A WSMessage object can be used to store all the info in order to successfully consume a Web service. This could be passed to the request method after you create a WSClient object.

A WSHeader object can be used to hold a custom header element which could then be passed as an array to 'inputHeaders' option when creating a WSClient object.

WSHEADER_OPTIONS

Top

ns

Specify SOAP header's namespace URI.

nsprefix

Soap header's namespace prefix.

name

Soap header element's localname

data

If it's a single value give it as a string, if nested elements are need to be generated give an array of WSHeader objects.

# a single header element

  my $h1 = new WSO2::WSF::WSHeader( { 'name' => 'person',
                                      'data' => 'Frodo'
                                    } );

# header with child elements

  my $name = new WSO2::WSF::WSHeader( { 'name' => 'fullname',
                                        'data' => 'Frodo Baggins'
                                      } );

  my $age = new WSO2::WSF::WSHeader( { 'name' => 'age',
                                       'data' => 'Eleventy-one'
                                     } );

  my $h3 = new WSO2::WSF::WSHeader( { 'name' => 'person',
                                      'data' => [ $name, $age ]
                                    } );

mustUnderstand

Can contain either 'TRUE' or 'FALSE' values. Specifys whether to add mustUnderstand attribute to the Soap Header or not.

role

Can either be 1, 2 or 3. 1 - This will set the role to none, meaning if there are intermediary SOAP nodes they will not process the header. 2 - This will set the role to next, meaning the next SOAP node to receive the header must process it. 3 - This will set the role to ultimate receiver, meaning the last SOAP node to receive the SOAP header will process it.

SEE ALSO

Top

Look at WSO2::WSF::WSClient to see how to pass a WSHeader and create a custom header element.

AUTHOR

Top

WSO2 WSF/Perl Team

COPYRIGHT AND LICENSE

Top


WSO2-WSF-Perl documentation  | view source Contained in the WSO2-WSF-Perl distribution.