[otrs-cvs] GI/Kernel/GenericInterface/Transport/HTTP SOAP.pm, 1.21, 1.22

CVS commits notifications of OTRS.org cvs-log at otrs.org
Mon Jun 27 21:46:46 GMT 2011


Comments:
Update of /home/cvs/GI/Kernel/GenericInterface/Transport/HTTP
In directory lancelot:/tmp/cvs-serv30482/Kernel/GenericInterface/Transport/HTTP

Modified Files:
	SOAP.pm 
Log Message:
Synchronized package.

Author: cr

Index: SOAP.pm
===================================================================
RCS file: /home/cvs/GI/Kernel/GenericInterface/Transport/HTTP/SOAP.pm,v
retrieving revision 1.21
retrieving revision 1.22
diff -2 -u -d -r1.21 -r1.22
--- SOAP.pm	14 Jun 2011 16:14:25 -0000	1.21
+++ SOAP.pm	27 Jun 2011 21:46:41 -0000	1.22
@@ -4,5 +4,5 @@
 # --
 # $Id$
-# $OldId: SOAP.pm,v 1.32 2011/06/13 17:27:54 cr Exp $
+# $OldId: SOAP.pm,v 1.34 2011/06/27 20:01:52 cr Exp $
 # --
 # This software comes with ABSOLUTELY NO WARRANTY. For details, see
@@ -259,5 +259,6 @@
 
     my $Result = $TransportObject->ProviderGenerateResponse(
-        Data            => { # data payload for response, optional
+        Success => 1m
+        Data    => { # data payload for response, optional
             ...
         },
@@ -290,4 +291,20 @@
     }
 
+    my $OperationResponse = $Self->{Operation} . 'Response';
+
+    # check success param
+    if ( !$Param{Success} ) {
+
+        # create SOAP Fault structure
+        my $FaultString = $Param{ErrorMessage} || 'Unknown';
+        $Param{Data} = {
+            faultcode   => 'Server',
+            faultstring => $FaultString,
+        };
+
+        # override OperationResponse string to Fault to make the corect SOAP envelope
+        $OperationResponse = 'Fault';
+    }
+
     # prepare data
     my $SOAPResult;
@@ -315,5 +332,5 @@
 
     # create return structure
-    my @CallData = ( 'response', $Self->{Operation} . 'Response' );
+    my @CallData = ( 'response', $OperationResponse );
     if ($SOAPResult) {
         push @CallData, $SOAPResult;
@@ -563,7 +580,16 @@
     }
 
-    # check if we have response data for the specified operation in the soap result
     my $Body = $Deserialized->body();
-    if ( !exists $Body->{ $Param{Operation} . 'Response' } ) {
+
+    # check if we got a SOAP Fault message
+    if ( exists $Body->{'Fault'} ) {
+        return {
+            Success => 1,
+            Data => $Body->{'Fault'} || undef,
+        };
+    }
+
+    # check if we have response data for the specified operation in the soap result
+    elsif ( !exists $Body->{ $Param{Operation} . 'Response' } ) {
         return {
             Success => 0,


More information about the cvs-log mailing list