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

SOAP::Lite client .net and complex post

Expand Messages
  • Eaton, Andy
    I think I have the opposite problem of Erica. I have a perl client and a dot net server. I am trying to push to a webservice written in .net that looks like
    Message 1 of 1 , Apr 30, 2004
    • 0 Attachment
      I think I have the opposite problem of Erica. I have a perl client and a
      dot net server. I am trying to push to a webservice written in .net
      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:Body>
      <QuickLogEntries xmlns="http://build.cec.wustl.edu/PFLog/pf.asmx">
      <entries>
      <logentry>
      <inip>string</inip>
      <outip>string</outip>
      <outport>int</outport>
      <proto>string</proto>
      <flagdate>string</flagdate>
      </logentry>
      <logentry>
      <inip>string</inip>
      <outip>string</outip>
      <outport>int</outport>
      <proto>string</proto>
      <flagdate>string</flagdate>
      </logentry>
      </entries>
      </QuickLogEntries>
      </soap:Body>
      </soap:Envelope>

      Sample perl code:
      print SOAP::Lite
      -> uri('http://build.cec.wustl.edu/PFLog/pf.asmx')
      -> on_action( sub { join '/',
      'http://build.cec.wustl.edu/PFLog/pf.asmx', $_[1] } )
      -> proxy('http://build.cec.wustl.edu/PFLog/pf.asmx')
      -> QuickLogEntries(SOAP::Data->name("entries" =>
      \SOAP::Data->name("Logentry" =>
      \SOAP::Data->value(SOAP::Data->name("inip" => $inip),
      SOAP::Data->name("outip" => $outip),
      SOAP::Data->name("outport" => $outport),
      SOAP::Data->name("proto" => $proto),
      SOAP::Data->name("flagdate" => $date)))))
      ->attr({xmlns => 'http://build.cec.wustl.edu/PFLog/pf.asmx'})
      ->result;
      The server returns the following:

      SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
      <SOAP-ENV:Body>
      <namesp1:QuickLogEntries
      xmlns:namesp1="http://build.cec.wustl.edu/PFLog/pf.asmx">
      <entries><Logentry><inip
      xsi:type="xsd:string">128.252.21.254</inip><outip
      xsi:type="xsd:string">172.16.8.43</outip><outport
      xsi:type="xsd:int">40</outport><proto
      xsi:type="xsd:string">A</proto><flagdate
      xsi:type="xsd:string">Apr+30+2004+9:15:50</flagdate></Logentry></entries
      >
      </namesp1:QuickLogEntries></SOAP-ENV:Body></SOAP-ENV:Envelope>

      The above errors out because of "namesp1:QuickLogEntries
      xmlns:namesp1="http://build.cec.wustl.edu/PFLog/pf.asmx">" namesp1 needs
      to be gone.

      This code puts slashes in the wrong places

      $soap = SOAP::Lite
      -> uri('http://build.cec.wustl.edu/PFLog/pf.asmx')
      -> on_action( sub { join '/',
      'http://build.cec.wustl.edu/PFLog/pf.asmx', $_[1] } )
      -> proxy('http://build.cec.wustl.edu/PFLog/pf.asmx');

      $method = SOAP::Data->name('QuickLogEntries')
      ->attr({xmlns=>'http://build.cec.wustl.edu/PFLog/pf.asmx'});

      @params = (
      SOAP::Data->name('entry')=>SOAP::Data->name('Logentry')=>SOAP::Data->nam
      e("inip" => "128.252.21.254"),
      SOAP::Data->name("outip" => "172.16.8.42"),
      SOAP::Data->name("outport" => "40"),
      SOAP::Data->name("proto" => "A"),
      SOAP::Data->name("flagdate" => "Apr+30+2004+10:20:50"));

      print $soap->call($method => @params)->result;

      Partial Server return with slashes.
      <QuickLogEntries
      xmlns="http://build.cec.wustl.edu/PFLog/pf.asmx"><entry/><Logentry/><ini
      p xsi:type="xsd:string">128.252.21.254</inip>

      I have seen documentation about how to collect complex data from a
      server but none on how to push to it. I am also wondering how to push
      several hundred of these requests with one call to the webserver.

      Thanks in advance,


      Andrew Eaton
    Your message has been successfully submitted and would be delivered to recipients shortly.