Loading ...
Sorry, an error occurred while loading the content.

5286Uri in SOAPAction different from xmlns= argument later.

Expand Messages
  • Scarblac
    Mar 21, 2006
      I need to implement a connection to a webservice from another company.
      I'm trying to setup SOAP::Lite so that it generates the right message
      to send to their service.

      Right now it's almost there, but not quite; they require the
      SOAPAction header to be, e.g., 'http://tempuri.org/GetLocations', but
      then the method call inside the XML needs to be '<GetLocations
      xmlns="http://tempuri.org/">'. So two different URIs.

      SOAP::Lite doesn't seem to allow this: I can set the URI, then the
      SOAPAction is correct but the xmlns in the method call is wrong; I can
      call the method with
      'call(SOAP::Data->name("GetLocations")->attr({xmlns =>
      'http://tempuri.org/'}), ...)' - but then the SOAPAction URI is reset
      as well.

      This is documented behavior; at least, the PerlDoc of the call()
      method says that the URI is reset also.

      Why is this? Does the SOAP spec say they need to be the same? Is this
      just a limitation of SOAP::Lite? Is there any way to do what I need it
      to do, or am I out of luck?

      For just a little more illustration of what I need, here's the request
      as the other company says it needs to be, URLs and details redacted:

      POST /zzz.asmx HTTP/1.1
      Host: zzz.zzz.nl
      Content-Type: text/xml; charset=utf-8
      Content-Length: length
      SOAPAction: "http://tempuri.org/GetLocations"

      <?xml version="1.0" encoding="utf-8"?>
      <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      <GetLocations xmlns="http://tempuri.org/">

      As you can see, SOAPAction URI is different from the GetLocations xmlns.

      This is my SOAP::Lite incantation, with excuses for the horrible
      layout in this edit box:

      my $soap = new SOAP::Lite(uri => 'http://tempuri.org/GetLocations',
      proxy => 'zzz.zzz.nl/zzz.asmx',
      on_action => sub { sprintf '"%s"',
      shift },

      my $response =
      $soap->call(SOAP::Data->name('GetLocations')->attr({xmlns =>
      'http://tempuri.org/'}), SOAP::Data->new->name('Request' =>

      SOAP::Data->new->name('SomeData' => zzz),

      Thank you for any help.

      Remco Gerlich
      The Netherlands