/[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 38 by dpavlin, Tue Jun 19 09:43:57 2007 UTC revision 48 by dpavlin, Tue Jun 19 20:02:36 2007 UTC
# Line 44  my $soap = [ soap => "http://schemas.xml Line 44  my $soap = [ soap => "http://schemas.xml
44  =cut  =cut
45    
46  sub Inform {  sub Inform {
47            my ( $self, $state ) = @_;
48            $self->xml( $state, sub {
49                    my ( $X, $state ) = @_;
50                    $X->InformResponse( $cwmp,
51                            $X->MaxEnvelopes( $cwmp, 1 )
52                    );
53            });
54    }
55    
56    =head2 GetRPCMethods
57    
58      $response->GetRPCMethods( $state );
59    
60    =cut
61    
62    sub GetRPCMethods {
63            my ( $self, $state ) = @_;
64            $self->xml( $state, sub {
65                    my ( $X, $state ) = @_;
66                    $X->GetRPCMethods();
67            });
68    };
69    
70    =head2 xml
71    
72    Used to implement methods which modify just body of soap message.
73    For examples, see source of this module.
74    
75    =cut
76    
77    sub xml {
78          my $self = shift;          my $self = shift;
79    
80          my $state = shift or confess "no state?";          my ( $state, $closure ) = @_;
81    
82            confess "no state?" unless ($state);
83            confess "no body closure" unless ( $closure );
84    
85          confess "no ID in state ", dump( $state ) unless ( $state->{ID} );          confess "no ID in state ", dump( $state ) unless ( $state->{ID} );
86    
# Line 56  sub Inform { Line 90  sub Inform {
90                  $X->Header( $soap,                  $X->Header( $soap,
91                          $X->ID( $cwmp, { mustUnderstand => 1 }, $state->{ID} ),                          $X->ID( $cwmp, { mustUnderstand => 1 }, $state->{ID} ),
92                  ),                  ),
93                  $X->Body( $soap,                  $X->Body( $soap, $closure->( $X, $state ) ),
                         $X->InformResponse( $cwmp,  
                                 $X->MaxEnvelopes( $cwmp, 1 )  
                         )  
                 ),  
94          );          );
95  }  }
96    

Legend:
Removed from v.38  
changed lines
  Added in v.48

  ViewVC Help
Powered by ViewVC 1.1.26