Hello,

I want to post some data to a webservice which is .NET powered.

The webservice's developer tell me the request should be:

POST /Service/IndicatorsService.asmx HTTP/1.1
Host: 192.168.1.100
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://tempuri.org/DataUpLoad";

<?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>
 <DataUpLoad xmlns="http://tempuri.org/";>
   <input>
     <User>string</User>
     <UserIP>string</UserIP>
     <NetType>string</NetType>
     <OS>string</OS>
     <Data>
       <DataUpLoadInputData>
         <INDICATORSNUMBER>decimal</INDICATORSNUMBER>
         <RECORDINGTIME>dateTime</RECORDINGTIME>
         <FVALUE>decimal</FVALUE>
         <Valid>string</Valid>
         <Info>string</Info>
       </DataUpLoadInputData>
       <DataUpLoadInputData>
         <INDICATORSNUMBER>decimal</INDICATORSNUMBER>
         <RECORDINGTIME>dateTime</RECORDINGTIME>
         <FVALUE>decimal</FVALUE>
         <Valid>string</Valid>
         <Info>string</Info>
       </DataUpLoadInputData>
     </Data>
   </input>
 </DataUpLoad>
 </soap:Body>
</soap:Envelope>


I wrote this script for requesting it:

use SOAP::Lite +trace => 'all';

my $soap = SOAP::Lite->new( proxy =>
'http://192.168.1.100/Service/IndicatorsService.asmx');
$soap->default_ns('http://tempuri.org/');
$soap->on_action(sub { join '', @_ });


my $method = SOAP::Data->name('DataUpLoad')
                     ->attr({xmlns => 'http://tempuri.org/'});
my @param = (
              SOAP::Data->name('INDICATORSNUMBER')->value('1010101010101210'),
              SOAP::Data->name('FVALUE')->value(50),
           );

my $run = $soap->call($method => @param);



But it run failed.
Can you help on this? Thanks.

Jeff.

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to