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

Wierd XML payload structure problem

Expand Messages
  • willyd61
    Hello, I am having an issue with a script running on a linux machine accessing a SSL Webservice remotely. Here is the payload that I need to send:
    Message 1 of 1 , Nov 7, 2006
    • 0 Attachment
      Hello,

      I am having an issue with a script running on a linux machine
      accessing a SSL Webservice remotely.

      Here is the payload that I need to send:
      ***********************************************************************
      <?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>
      <Logon xmlns="https://secure.datastarusa.com/">
      <UserName>string</UserName>
      <Password>string</Password>
      </Logon>
      </soap:Body>
      </soap:Envelope>
      ************************************************************************
      Here is what gets sent currently.

      <?xml version="1.0" encoding="UTF-8"?>
      <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
      <soap:Body>
      <Logon xmlns="https://secure.datastarusa.com/">
      <Logon>
      <UserName xsi:type="xsd:string">infobel</UserName>
      <Password xsi:type="xsd:string">test</Password>
      </Logon>
      </Logon>
      </soap:Body>
      </soap:Envelope>
      ********************************************************************

      Here is the source code for my script.

      #!/usr/local/bin/perl
      #use strict;
      use SOAP::Lite;
      use Getopt::Long;
      my $resulted = GetOptions ("debug" => \$DEBUG);

      if ($DEBUG) {
      eval "use SOAP::Lite +trace => 'debug';";
      } else {
      eval "use SOAP::Lite;";
      }

      # do not forget to specify the soapaction (on_action),
      # you will find it in the wsdl.
      # uri is the target namespace in the wsdl
      # proxy is the endpoint address
      my $soap = SOAP::Lite
      -> uri('https://secure.datastarusa.com/')
      -> on_action( sub { return
      '"https://secure.datastarusa.com/Logon"' } )
      ->
      proxy('https://secure.datastarusa.com/Engage/webservice/Security.asmx');

      # you must define the namespace used
      # in the wsdl, as an attribute to the
      # method Search without namespace prefix
      # for compatibility with .NET (document/literal)

      my $method = SOAP::Data->name('Logon')
      ->attr({xmlns => 'https://secure.datastarusa.com/'});

      # This adds additional layer of Logon Tag
      my $query =
      SOAP::Data
      ->name(Logon =>
      \SOAP::Data->value(
      SOAP::Data->name(UserName => 'string'),
      SOAP::Data->name(Password => 'string')));

      # make the call
      my $result = $soap->call($method => $query);
      #my $result = $soap->call($query);

      #if no error
      unless ($result->fault) {


      } else {
      # some error handling
      print join ', ',
      $result->faultcode,
      $result->faultstring,
      $result->faultdetail;
      }
    Your message has been successfully submitted and would be delivered to recipients shortly.