XML : SOAP::Lite Perl Module Sends Wrong SOAP Envelope Namespace

I am having problems writing a SOAP/XML client to talk to an API provided by a company called Domainbox. I am writing the client in Perl using the SOAP::Lite Module/Library. I am getting the following error message:

Possible SOAP version mismatch: Envelope namespace http://schemas.xmlsoap.org/soap/envelope/ was unexpected. Expecting http://www.w3.org/2003/05/soap-envelope.

This is because the library is sending the SOAP Envelope using a SOAP 1.1 Namespace and the server expects SOAP 1.2.

But I cannot come up with a solution, I've tried explicitly setting $soap->soapversion('1.2'); in the SOAP::Lite object but this only affects the Envelope received in the response message, not the Envelope sent by the client.

The server is running ASP.net and doesn't seem to want to accept SOAP version 1.1 messages.

Querying the soapversion() method by default it returns version 1.1 and when I change it to 1.2 it returns 1.2 but internally it is clearly ignoring this somewhere.

The WSDL doesn't seem to define xmlns:soap or xmlns:soap12 properly but SOAP::Lite isn't using those Namespaces either. I would provide a link but I am not allowed to post more than two on here.

I tried also using the service() method of SOAP::Lite but that made no difference at all.

Here's the code I'm using:

  #!/usr/bin/perl -w  use strict;  use SOAP::Lite;  use Data::Dumper;    ### API Info  my $reseller = 'Removed';  my $username = 'Removed';  my $password  = 'Removed';    my $soap = SOAP::Lite->new(proxy => 'https://sandbox.domainbox.net/');  $soap->default_ns('https://sandbox.domainbox.net/');  $soap->soapversion('1.2');    my $header = SOAP::Header->new->attr({xmlns => 'https://sandbox.domainbox.net/'});    my $body = SOAP::Data->name('CheckDomainAvailability' => \SOAP::Data->value(              SOAP::Data->name('AuthenticationParameters' => \SOAP::Data->value(                  SOAP::Data->name('Reseller' => $reseller),                  SOAP::Data->name('Username' => $username),                  SOAP::Data->name('Password' => $password),              )          )      )  );    $soap->on_action( sub { "https://sandbox.domainbox.net/" });  my $som = $soap->call('',  $header,  $body  );    die $som->faultstring if ($som->fault);  print $som->result, "\n";    #print Dumper($som);    

No comments:

Post a Comment