-sub InformResponse {
- my ( $self, $state ) = @_;
- $self->xml( $state, sub {
- my ( $X, $state ) = @_;
- $X->InformResponse( $cwmp,
- $X->MaxEnvelopes( $cwmp, 1 )
- );
- });
+ confess "no ID in state ", dump( $state ) unless ( $state->{ID} );
+
+ #warn "state used to generate xml = ", dump( $state ) if $self->debug;
+
+ my $X = XML::Generator->new(':pretty');
+
+ return $X->Envelope( $soap, { 'soap:encodingStyle' => "http://schemas.xmlsoap.org/soap/encoding/" },
+ $X->Header( $soap,
+ $X->ID( $cwmp, { mustUnderstand => 1 }, $state->{ID} ),
+ $X->NoMoreRequests( $cwmp, $state->{NoMoreRequests} || 0 ),
+ ),
+ $X->Body( $soap, $closure->( $X, $state ) ),
+ );