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

Cant figure out how to make the correct BODY

Expand Messages
  • jbenden76
    Hello, I ve been trying to build the XML below, but am having problems. I ve read the manual and searched the web and can not find/figure out my answer. Can
    Message 1 of 1 , Apr 2, 2003
    • 0 Attachment
      Hello,

      I've been trying to build the XML below, but am having problems.
      I've read the manual and searched the web and can not find/figure out
      my answer. Can anyone help? Thanks!

      I can not get the second namespace and the two separate peices of
      NS1:StoreMyAd and NS2:TMyAd


      End result:

      <?xml version="1.0"?>
      <SOAP-ENV:Envelope xmlns:SOAP-
      ENV="http://schemas.xmlsoap.org/soap/envelope/"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-
      ENC="http://schemas.xmlsoap.org/soap/encoding/">
      <SOAP-ENV:Body SOAP-
      ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:NS2="urn:CfeWebServIntf">

      <NS1:StoreMyAd xmlns:NS1="urn:CfeWebServIntf-ICfeWebServ">
      <Value href="#1"/>
      </NS1:StoreMyAd>
      <NS2:TMyAd id="1" xsi:type="NS2:TMyAd">
      <AccountNumber xsi:type="xsd:string">------</AccountNumber>
      <BillPhone xsi:type="xsd:string"></BillPhone>
      <Classification xsi:type="xsd:string">H0722</Classification>
      <FirstDate xsi:type="xsd:string">04/28/2003</FirstDate>
      <TheText xsi:type="xsd:string">Sample Text
      Sample Text
      Sample Text
      Sample Text
      </TheText>
      <NumberOfDays xsi:type="xsd:int">1</NumberOfDays>
      <SkipDateList xsi:type="xsd:string"></SkipDateList><TrialOnly
      xsi:type="xsd:boolean">True</TrialOnly><PassCode
      xsi:type="xsd:string">------</PassCode><CCNumber
      xsi:type="xsd:string"></CCNumber><CCExpireDate
      xsi:type="xsd:string"></CCExpireDate><CCHoldersName
      xsi:type="xsd:string"></CCHoldersName><NbrTearsheets
      xsi:type="xsd:string"></NbrTearsheets><PONumber
      xsi:type="xsd:string"></PONumber><GivenBy
      xsi:type="xsd:string"></GivenBy><Comments
      xsi:type="xsd:string"></Comments><Agency
      xsi:type="xsd:string"></Agency><Package
      xsi:type="xsd:string"></Package><EmailAddress
      xsi:type="xsd:string"></EmailAddress><BillLastName
      xsi:type="xsd:string"></BillLastName><BillFirstName
      xsi:type="xsd:string"></BillFirstName><BillMiddleInitial
      xsi:type="xsd:string"></BillMiddleInitial><BillStreet
      xsi:type="xsd:string"></BillStreet><BillCity
      xsi:type="xsd:string"></BillCity><BillState
      xsi:type="xsd:string"></BillState><BillZip
      xsi:type="xsd:string"></BillZip><CreateBox
      xsi:type="xsd:boolean">False</CreateBox><HoldBoxMail
      xsi:type="xsd:boolean">False</HoldBoxMail><BoxName
      xsi:type="xsd:string"></BoxName><BoxAttn
      xsi:type="xsd:string"></BoxAttn><BoxAddr
      xsi:type="xsd:string"></BoxAddr><BoxCity
      xsi:type="xsd:string"></BoxCity><BoxState
      xsi:type="xsd:string"></BoxState><BoxZipCode
      xsi:type="xsd:string"></BoxZipCode><BoxPhone
      xsi:type="xsd:string"></BoxPhone><BoxPhoneExt
      xsi:type="xsd:string"></BoxPhoneExt><AdNumber
      xsi:type="xsd:string"></AdNumber><Price
      xsi:type="xsd:string"></Price><NbrOfLines
      xsi:type="xsd:int">0</NbrOfLines><HNJText
      xsi:type="xsd:string"></HNJText><ErrorMsg
      xsi:type="xsd:string"></ErrorMsg><BoxNumber
      xsi:type="xsd:string"></BoxNumber></NS2:TMyAd></SOAP-ENV:Body></SOAP-
      ENV:Envelope>



      Here is the Perl code:



      #!/usr/bin/perl

      use SOAP::Lite outputxml => 1, readable => true, encoding => undef,
      trace;

      my $soap = SOAP::Lite
      -> uri('urn:CfeWebServIntf-ICfeWebServ')
      -> proxy('http://awebserver/cfesoap.exe/soap/icfewebserv');
      $soap->readable();

      my $method = SOAP::Data->name('StoreMyAd')
      -> attr({xmlns => 'urn:CfeWebServIntf-ICfeWebServ'});

      my @insideargs = (
      \SOAP::Data->name(Req =>
      SOAP::Data->name(AccountNumber => ------),
      SOAP::Data->name(Classification => 'H0722'),
      SOAP::Data->name(FirstDate => '04/27/2003'),
      SOAP::Data->name(NumberOfDays => 1)->type('int'),
      SOAP::Data->name(PassCode => '------'),
      SOAP::Data->name(TheText => "Sample Text\nSample Text\nSample
      Text\nSample Text"),
      SOAP::Data->name(TrialOnly => True)->type('boolean')
      ));

      $soap->maptype({'TMyAd' => 'urn:CfeWebServIntf'});

      $soap->call($method =>
      SOAP::Data->name(StoreMyAd =>
      \SOAP::Data->name(Value)->attr({ href => '#1' }) ),
      SOAP::Data->name('TMyAd')->type('TMyAd')->value
      (@insideargs)->attr({ "id " => "1" })
      );

      exit;
    Your message has been successfully submitted and would be delivered to recipients shortly.