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

Uri in SOAPAction different from xmlns= argument later.

Expand Messages
  • Scarblac
    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
    Message 1 of 1 , Mar 21, 2006
    • 0 Attachment
      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"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
      <soap:Body>
      <GetLocations xmlns="http://tempuri.org/">
      <Request><SomeData>zzz</SomeData></Request>
      </GetLocations>
      </soap:Body>
      </soap:Envelope>

      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 },
      );
      $soap->autotype(0);

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

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


      Thank you for any help.

      Remco Gerlich
      BuyWays
      The Netherlands
    Your message has been successfully submitted and would be delivered to recipients shortly.