Changing Web Service Envelope

Moderator: crythias

Locked
ArielRivas
Znuny newbie
Posts: 11
Joined: 29 Sep 2013, 20:08
Znuny Version: 3.2.10
Real Name: Ariel Rivas-Micoud
Company: Softignition

Changing Web Service Envelope

Post by ArielRivas »

Hi there:

I am having an issue sending a Web Service to a remote system and I have tried just about every configuration I could find on the GUI, the SOAP.pm and the Invoker files but to no avail.

The namespace is being sent correctly in the header file and basic transport comunications is correct, however, the issue is that the namespace is also being passed within the body of the envelope as the following code illustrates:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">

<soap:Body>
<namesp1:soapActionName xmlns:namesp1="http://xmlns.example.com/unique/default/namespace/xxxxxxxxxxxxx">
<soap_request>
<Operation>Main XML Structure</Operation>
</soap_request>
</namesp1:soapActionName>
</soap:Body>
</soap:Envelope>
As the remote system does not expect the <namespxx:soapActionName xxxxxx> and its closing tag </namesp1:soapActionName> it sends the following error.

Code: Select all

<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>SOAP-ENV:Client</faultcode><faultstring>Failed to access class (soapActionName): Can't locate interact.pm in @INC (@INC contains: /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 . /etc/httpd) at (eval 4574) line 3.

My Invoker code is

Code: Select all

sub PrepareRequest {
    my ( $Self, %Param ) = @_;

    # get ticket data
    my %Ticket = $Self->{TicketObject}->TicketGet( TicketID => $Param{Data}->{TicketID} );

#    return {
#        Success => 1,
#        Data    => $Param{Data},
#    };

my $Data = {
	soap_request => {
	Operation => {
		group1 => {
			var1 => "bla1",
			var2 => "bla2",
			var3 => "bla3",
			var4 => "bla4",
			var5 => "bla5",
			var6 => "bla6",
		},
		group2 => {
			mainId => {
				varId1 => "someVar",
				varId2 => "otherVar",
			},
			details => {
				var_1 => "aaa",
				var_2 => "bbb",
				var_3 => "ccc",
				var_4 => "ddd",
				var_5 => "eee",
				var_6 => "fff",
				var_7 => "ggg",
				var_8 => "hhh",
				var_9 => "iii",
			},
		},
	},
	},
};
I have tried to figure out where this in constructed but I have not been able to find it. Can anyone help me or indicate what file and what I would need to change so that <namesp> tag does not get constructed within the <body> of the envelope?

Thank you very much for your help,

Ariel
Locked