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

Re: [soaplite] How do I add a namespace to the soap header

Expand Messages
  • Paul Gallagher
    Hi Chris. Yes, overridding the serializer is the trick. Example: #!/usr/bin/perl -w use strict; #NB: SOAP::serializer- register_ns requires 0.65 use SOAP::Lite
    Message 1 of 5 , Oct 17, 2007
    • 0 Attachment
      Hi Chris. Yes, overridding the serializer is the trick. Example:

      #!/usr/bin/perl -w
      use strict;

      #NB: SOAP::serializer->register_ns requires 0.65
      use SOAP::Lite 0.65 +trace => 'debug';

      my $soap = SOAP::Lite
      ->proxy( 'http://localhost/blah/DummyService' );

      my $serializer = $soap->serializer();
      $serializer->register_ns( 'http://session.webservices.thefirm.uk', 'intf' );

      my $som = $soap->test();

      ===> generates request:

      <?xml version="1.0" encoding="UTF-8"?>
      <soap:Envelope xmlns:intf="http://session.webservices.thefirm.uk"
      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><test xsi:nil="true" /></soap:Body></soap:Envelope>


      On 10/15/07, oldfic4 <chris@...> wrote:
      > How do get soaplite to add the xmlns:intf ns to get the soap envelope
      > to look as below?
      >
      > <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
      > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      > xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      > xmlns:intf="http://session.webservices.thefirm.uk">
      >
      > Thanks
      >
      >
      >
      >
      >
      >
      > Yahoo! Groups Links
      >
      >
      >
      >
    Your message has been successfully submitted and would be delivered to recipients shortly.