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

null string: warning when reply

Expand Messages
  • Vincent Berger
    I want to reply a null string. (
    Message 1 of 3 , Apr 27, 2004
    • 0 Attachment
      I want to reply a null string.
      (<s-gensym3 xsi:type:"xsd:string" xsi:null="1")

      The code below return a warning:
      Use of uninitialized value in substitution (s///) at
      /usr/share/perl5/SOAP/Lite.pm line 367

      Here is the code for server side:
      #!/usr/bin/perl -w
      use SOAP::Transport::HTTP;
      my $Server = SOAP::Transport::HTTP::Daemon
      -> new (LocalPort => 9703,
      Reuse => 1
      )
      -> dispatch_to ("Interne")
      ;
      $Server->handle;

      package Interne;

      sub itest {
      return SOAP::Data
      ->type("string")
      ->value(undef)
      ;
      }


      It seems that SOAP::Utils::encode_data doesn't accept undef,
      as opposed to
      SOAP::Serializer::encode_object which converts undef -> null.

      But, may be, this way of replying a null string isn't the good one ?

      vinzo
    • eamick
      ... Have you tried using instead of undef for the value?
      Message 2 of 3 , Apr 27, 2004
      • 0 Attachment
        --- In soaplite@yahoogroups.com, Vincent Berger <vincent.berger@a...>
        wrote:
        > I want to reply a null string.
        > (<s-gensym3 xsi:type:"xsd:string" xsi:null="1")
        >
        > The code below return a warning:
        > Use of uninitialized value in substitution (s///) at
        > /usr/share/perl5/SOAP/Lite.pm line 367
        >
        > Here is the code for server side:
        > #!/usr/bin/perl -w
        > use SOAP::Transport::HTTP;
        > my $Server = SOAP::Transport::HTTP::Daemon
        > -> new (LocalPort => 9703,
        > Reuse => 1
        > )
        > -> dispatch_to ("Interne")
        > ;
        > $Server->handle;
        >
        > package Interne;
        >
        > sub itest {
        > return SOAP::Data
        > ->type("string")
        > ->value(undef)
        > ;
        > }

        Have you tried using "" instead of undef for the value?
      • Vincent Berger
        ... Unfortunately yes. It replies an empty string and not a null string. (... xsi:type= xsd:string / )
        Message 3 of 3 , Apr 27, 2004
        • 0 Attachment
          On Tue, 2004-04-27 at 15:06, eamick wrote:
          > --- In soaplite@yahoogroups.com, Vincent Berger <vincent.berger@a...>
          > wrote:
          > > I want to reply a null string.
          > > (<s-gensym3 xsi:type:"xsd:string" xsi:null="1")
          > >
          > > The code below return a warning:
          > > Use of uninitialized value in substitution (s///) at
          > > /usr/share/perl5/SOAP/Lite.pm line 367
          > >
          > > Here is the code for server side:
          > > #!/usr/bin/perl -w
          > > use SOAP::Transport::HTTP;
          > > my $Server = SOAP::Transport::HTTP::Daemon
          > > -> new (LocalPort => 9703,
          > > Reuse => 1
          > > )
          > > -> dispatch_to ("Interne")
          > > ;
          > > $Server->handle;
          > >
          > > package Interne;
          > >
          > > sub itest {
          > > return SOAP::Data
          > > ->type("string")
          > > ->value(undef)
          > > ;
          > > }
          >
          > Have you tried using "" instead of undef for the value?

          Unfortunately yes. It replies an empty string and not a null string.
          (... xsi:type="xsd:string"/>)
        Your message has been successfully submitted and would be delivered to recipients shortly.