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

with ->call() => $value is different from ->value( $value ) ?

Expand Messages
  • Jo Rhett
    Very simple question. Where SOAPAUTH is a Header object, this works: my $som = $soap- call( SOAP::Data- name( $method )- attr( $SAMAPI ) = $SOAPAUTH );
    Message 1 of 4 , Mar 25, 2010
    • 0 Attachment
      Very simple question. Where SOAPAUTH is a Header object, this works:

      my $som = $soap->call(
      SOAP::Data->name( $method )->attr( $SAMAPI ) => $SOAPAUTH
      );

      this does not:

      my $som = $soap->call(
      SOAP::Data->name( $method )->attr( $SAMAPI )->value( $SOAPAUTH )
      );

      Why not? What is the difference with the passed in value?

      --
      Jo Rhett
      Net Consonance : consonant endings by net philanthropy, open source and other randomness
    • Martin Busik
      Hi, ... the construct: SOAP::Data- name( $method )- attr( $SAMAPI ) = $SOAPAUTH is just a syntactical variant to: SOAP::Data- name( $method )- attr( $SAMAPI
      Message 2 of 4 , Mar 27, 2010
      • 0 Attachment
        Hi,

        > Very simple question. Where SOAPAUTH is a Header object,
        > this works:
        >
        > my $som = $soap->call(
        > SOAP::Data->name( $method )->attr( $SAMAPI ) => $SOAPAUTH
        > );
        >
        > this does not:
        >
        > my $som = $soap->call(
        > SOAP::Data->name( $method )->attr( $SAMAPI )->value(
        > $SOAPAUTH )
        > );
        >
        > Why not? What is the difference with the passed in value?

        the construct:

        SOAP::Data->name( $method )->attr( $SAMAPI ) => $SOAPAUTH

        is just a syntactical variant to:

        SOAP::Data->name( $method )->attr( $SAMAPI ), $SOAPAUTH


        Then SOAP::Lite recognizes SOAPAUTH as a Header object and serializes
        it in the SOAP:Header. The construct

        SOAP::Data->name( $method )->attr( $SAMAPI )->value( $SOAPAUTH

        instructs SOAP::Lite to put SOAPAUTH inside (->value) of the $method tag.

        HTH,
        Martin
      • Jo Rhett
        ... Clearly ;-) ... I guess it s not clear to me why there is a difference. Even more so since the documentation seems to indicate that they are equivalent
        Message 3 of 4 , Mar 29, 2010
        • 0 Attachment
          On Mar 27, 2010, at 2:04 PM, Martin Busik wrote:
          > the construct:
          >
          > SOAP::Data->name( $method )->attr( $SAMAPI ) => $SOAPAUTH
          > is just a syntactical variant to:
          > SOAP::Data->name( $method )->attr( $SAMAPI ), $SOAPAUTH
          >
          > Then SOAP::Lite recognizes SOAPAUTH as a Header object and serializes
          > it in the SOAP:Header.

          Clearly ;-)

          > The construct
          >
          > SOAP::Data->name( $method )->attr( $SAMAPI )->value( $SOAPAUTH
          >
          > instructs SOAP::Lite to put SOAPAUTH inside (->value) of the $method tag.


          I guess it's not clear to me why there is a difference. Even more so since the documentation seems to indicate that they are equivalent -- they indicate you can do it either way. But if they are not equivalent...

          --
          Jo Rhett
          Net Consonance : consonant endings by net philanthropy, open source and other randomness
        • Martin Busik
          Hi, ... I ll demonstrate it with a different example: $auth = SOAP::Header- name( aaa ); $param = SOAP::Data- name( ppp ); $proxy- call($method,$authm,$param)
          Message 4 of 4 , Apr 6 1:08 PM
          • 0 Attachment
            Hi,

            > I guess it's not clear to me why there is a difference.

            I'll demonstrate it with a different example:

            $auth = SOAP::Header->name("aaa");
            $param = SOAP::Data->name("ppp");

            $proxy->call($method,$authm,$param)

            is a variant where SOAP::Lite recognises the Header

            $auth = SOAP::Header->name("aaa");
            $param = SOAP::Data->name("ppp")->value($auth);

            $proxy->call($method,$param)

            is a variant where SOAP::Lite does not recognises the header, it is simply
            "not there".

            I suppose the reason for that behavior is, that SOAP::Header is a subclass
            of SOAP::Data, so
            you might use SOAP::Header everywhere you may use SOAP::Data. It does not
            work vice versa.

            I suppose (without checking the source code), that only the parameter list
            of the call() method
            is checked with respect to SOAP::Header. In contrast, the content of the
            supplied parameter is
            not checked (this makes in my opinion no sense).

            > Even more so since the documentation seems to indicate that
            > they are equivalent -- they indicate you can do it either
            > way. But if they are not equivalent...

            Which part of the documentation indicates that they are equivalent?

            Cheers,
            Martin
          Your message has been successfully submitted and would be delivered to recipients shortly.