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

creating soap header and body

Expand Messages
  • mullangi.rm
    Hi, ... use SOAP::Lite +trace = [qw(transport debug)]; use SOAP::Lite service = file:/home/mover/thirdparty.wsdl ; my %domains = ( yahoo.com = 2000,
    Message 1 of 1 , Aug 6, 2004
    • 0 Attachment
      Hi,

      I am using the program:

      ---------------------------------------------------------------------
      use SOAP::Lite +trace => [qw(transport debug)];
      use SOAP::Lite service => 'file:/home/mover/thirdparty.wsdl';
      my %domains = (
      'yahoo.com' => 2000,
      'hotmail.com' => 3000,
      'aol.com' => 5000
      );

      my ($campaignID, $dateSent, $confirmationEmail) =
      (11, '111', 'a@...');
      my @elements;
      foreach my $domain (keys %domains) {
      push @elements, SOAP::Data->name('SentInfo' => \( SOAP::Data->name
      ('domain' => $domain), SOAP::Data->name('count'=>$domains{$domain})));
      }

      my $extraheader = SOAP::Header->name('AuthHeader' => ( SOAP::Data-
      >name('Username' => 'Joe'), SOAP::Data->name('Password' => 'pp')));

      my $data = SOAP::Data->name('UpdateSentCount' => ( SOAP::Data->name
      ('campaignID' => $campaignID), SOAP::Data->name('dateSent' =>
      $dateSent), SOAP::Data->name('sentInfo' => @elements), SOAP::Data-
      >name('confirmationEmail' => $confirmationEmail)));

      print UpdateSentCount($extraheader, $data);

      -------------------------------------------------------------------
      It generated a SOAP requset:

      <?xml version="1.0" encoding="UTF-8"?>
      <SOAP-ENV:Envelope xmlns:SOAP-
      ENC="http://schemas.xmlsoap.org/soap/encoding/"
      SOAP-
      ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
      xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
      xmlns:xsd="http://www.w3.org/1999/XMLSchema">
      <SOAP-ENV:Body>
      <UpdateSentCount xmlns="">
      <Username xsi:type="xsd:string">Joe</Username>
      <Password xsi:type="xsd:string">pp</Password>
      <campaignID xsi:type="xsd:int">11</campaignID>
      <dateSent xsi:type="xsd:int">111</dateSent>
      <SentInfo>
      <domain
      xsi:type="xsd:string">hotmail.com</domain>
      </SentInfo>
      <SentInfo>
      <count xsi:null="1"/>
      </SentInfo>
      <SentInfo>
      <domain xsi:type="xsd:string">aol.com</domain>
      </SentInfo>
      <SentInfo>
      <count xsi:null="1"/>
      </SentInfo>
      <SentInfo>
      <domain
      xsi:type="xsd:string">yahoo.com</domain>
      </SentInfo>
      <SentInfo>
      <count xsi:null="1"/>
      </SentInfo>
      <confirmationEmail
      xsi:type="xsd:string">a@...</confirmationEmail>
      </UpdateSentCount>
      </SOAP-ENV:Body>
      </SOAP-ENV:Envelope>




      -------------------------------------------------------------------

      This is wrong request. I want to generate a request that looks like
      the following:

      <?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:Header>
      <AuthHeader xmlns="http://.../thirdparty/">
      <Username>string</Username>
      <Password>string</Password>
      </AuthHeader>
      </soap:Header>
      <soap:Body>
      <UpdateSentCount xmlns="http://../thirdparty/">
      <campaignID>int</campaignID>
      <dateSent>dateTime</dateSent>
      <sentInfo>
      <SentInfo>
      <domain>string</domain>
      <count>int</count>
      </SentInfo>
      <SentInfo>
      <domain>string</domain>
      <count>int</count>
      </SentInfo>
      </sentInfo>
      <confirmationEmail>string</confirmationEmail>
      </UpdateSentCount>
      </soap:Body>
      </soap:Envelope>





      Please tell me how to fix my program.

      Thanks a lot for your advise
      Srini
    Your message has been successfully submitted and would be delivered to recipients shortly.