/[cwmp]/google/trunk/lib/CWMP/Methods.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /google/trunk/lib/CWMP/Methods.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 31 by dpavlin, Mon Jun 18 20:07:17 2007 UTC revision 32 by dpavlin, Mon Jun 18 23:52:41 2007 UTC
# Line 4  use strict; Line 4  use strict;
4  use warnings;  use warnings;
5    
6  use XML::Generator;  use XML::Generator;
7    use base qw/Class::Accessor/;
8    __PACKAGE__->add_accessor( qw/
9    debug
10    /);
11    
12  my $X = XML::Generator->new(':pretty');  =head1 NAME
13    
14    CWMP::Response - generate SOAP meesage for response
15    
16    =head2 METHODS
17    
18    =head2 new
19    
20      my $response = CWMP::Response->new({ debug => 1 });
21    
22    =cut
23    
24    sub new {
25            my $class = shift;
26            my $self = $class->SUPER::new( @_ );
27    
28            warn "created XML::Generator object" if $self->debug;
29    
30            return $self;
31    }
32    
 my $ns = [  
     encodingStyle => "http://schemas.xmlsoap.org/soap/encoding/",  
 ];  
33    
34  my $cwmp = [ cwmp => 'urn:dslforum-org:cwmp-1-0' ];  my $cwmp = [ cwmp => 'urn:dslforum-org:cwmp-1-0' ];
35  my $soap = [ soap => "http://schemas.xmlsoap.org/soap/envelope/" ];  my $soap = [ soap => "http://schemas.xmlsoap.org/soap/envelope/" ];
36    
37  print $X->Envelope( $soap, { 'soap:encodingStyle' => "http://schemas.xmlsoap.org/soap/encoding/" },  =head2 Inform
38          $X->Header( $soap,  
39                  $X->ID( $cwmp, { mustUnderstand => 1 }, 1234 ),    $response->Inform;
40          ),  
41          $X->Body( $soap,  =cut
42                  $X->InformResponse( $cwmp,  
43                          $X->MaxEnvelopes( $cwmp, 1 )  sub Inform {
44                  )          my $self = shift;
45          ),  
46  );          my $X = XML::Generator->new(':pretty');
47    
48            return $X->Envelope( $soap, { 'soap:encodingStyle' => "http://schemas.xmlsoap.org/soap/encoding/" },
49                    $X->Header( $soap,
50                            $X->ID( $cwmp, { mustUnderstand => 1 }, 1234 ),
51                    ),
52                    $X->Body( $soap,
53                            $X->InformResponse( $cwmp,
54                                    $X->MaxEnvelopes( $cwmp, 1 )
55                            )
56                    ),
57            );
58    }
59    
60    1;

Legend:
Removed from v.31  
changed lines
  Added in v.32

  ViewVC Help
Powered by ViewVC 1.1.26