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

Help with complex type, return Header needed

Expand Messages
  • ggib23
    The following code segment: ################################################################# my $authinfo = SOAP::Data- name( Interface ) - attr({xmlns-
    Message 1 of 2 , Jun 23, 2003
    • 0 Attachment
      The following code segment:

      #################################################################
      my $authinfo = SOAP::Data->name('Interface')
      ->attr({xmlns-> 'http://www.newtrade.com/expedia/R14/header/',
      Name => 'ExpediaDirectConnect'});

      my $ack = SOAP::Data->name('Acknowledgement')
      ->attr({RequestId => '1234',TrackingId => '123456789'});

      my $retVal = SOAP::Header->name('Interface' => $ack,$authinfo );
      return $retVal;
      #################################################################

      produces a Soap Header message in the following form:

      <SOAP-ENV:Header>
      <Acknowledgement TrackingId="123456789" RequestId="1234"/>
      <Interface xmlns=
      "http://www.newtrade.com/expedia/R14/header/"
      Name="ExpediaDirectConnect"/>
      </SOAP-ENV:Header>

      #################################################################

      What I really need is for Interface node to be a child of
      Acknowledgement. How would I code that for that to happen?


      Desired Results:

      #################################################################
      <SOAP-ENV:Header>
      <Acknowledgement TrackingId="123456789" RequestId="1234">
      <Interface xmlns=
      "http://www.newtrade.com/expedia/R14/header/"
      Name="ExpediaDirectConnect"/>
      </Acknowledgement>
      </SOAP-ENV:Header>

      #################################################################

      Thanks for your time,

      Greg
    • perlmedian
      I am not really good at this but... shouldn t this: my $ack = SOAP::Data- name( Acknowledgement ) - attr({RequestId = 1234 ,TrackingId = 123456789 }); be
      Message 2 of 2 , Jun 23, 2003
      • 0 Attachment
        I am not really good at this but...

        shouldn't this:
        my $ack = SOAP::Data->name('Acknowledgement')
        ->attr({RequestId => '1234',TrackingId => '123456789'});


        be this:
        my $ack = SOAP::Data->name('Acknowledgement')
        ->attr({RequestId => '1234',TrackingId => '123456789'})
        ->value( SOAP::Header->name('Interface' => $ack,$authinfo ) );

        or is it this?:
        my $ack = SOAP::Data->name('Acknowledgement')
        ->attr({RequestId => '1234',TrackingId => '123456789'})
        ->value( \SOAP::Header->name('Interface' => $ack,$authinfo ) );



        --- In soaplite@yahoogroups.com, "ggib23" <ggib23@y...> wrote:
        > The following code segment:
        >
        > #################################################################
        > my $authinfo = SOAP::Data->name('Interface')
        > ->attr({xmlns-> 'http://www.newtrade.com/expedia/R14/header/',
        > Name => 'ExpediaDirectConnect'});
        >
        > my $ack = SOAP::Data->name('Acknowledgement')
        > ->attr({RequestId => '1234',TrackingId => '123456789'});
        >
        > my $retVal = SOAP::Header->name('Interface' => $ack,$authinfo );
        > return $retVal;
        > #################################################################
        >
        [SNIP]
        >
        > Desired Results:
        >
        > #################################################################
        > <SOAP-ENV:Header>
        > <Acknowledgement TrackingId="123456789" RequestId="1234">
        > <Interface xmlns=
        > "http://www.newtrade.com/expedia/R14/header/"

        > Name="ExpediaDirectConnect"/>
        > </Acknowledgement>
        > </SOAP-ENV:Header>
        >
        > #################################################################
        >
        > Thanks for your time,
        >
        > Greg
      Your message has been successfully submitted and would be delivered to recipients shortly.