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

Question to use SOAP::Lite

Expand Messages
  • achan_work
    Hi, I would like to use SOAP::Lite to communicate with the web server, but I need to send the token to get the access. Does anyone know how to set up in
    Message 1 of 2 , Oct 8, 2004
    • 0 Attachment
      Hi,

      I would like to use SOAP::Lite to communicate with the web server,
      but I
      need to send the token to get the access. Does anyone know how to set
      up in
      SOAP::Lite? I have the following code, but I get the errorcode 1001,
      "Request must have exactly one security token" message back. Does
      anyone
      give me some hints? Thanks


      use SOAP::WSDL;
      use SOAP::Lite;

      my $soap=SOAP::WSDL->new( wsdl =>
      'http://172.16.230.101/ccws/ccws.asmx?WSDL' );

      $soap->proxy( 'http://172.16.230.101/ccws/ccws.asmx');

      $soap->wsdlinit;


      $soap->on_action(sub{'http://comverse-
      in.com/prepaid/ccws/RetrieveVoucherByB
      atchSerial'});

      $serializer = SOAP::Serializer->envelope(method => 'security',
      SOAP::Header->name(Security=>
      '')->attr({mustUnderstand=>'1'},
      {xmlns=>'http://schemas.xmlsoap.org/ws/2002/
      07/secext'}),
      SOAP::Header->name(UsernameToken =>
      '')->attr({xmlns=>'http://schemas.xmlsoap.org/ws/2002/07/utility'},
      {Id=>'SecurityToken-2b8987f9-37e4-47b1-9a4a-12415aef5735'}),
      SOAP::Header->name(Username => 'web'),
      SOAP::Header->name(Password =>
      'qwerty')->attr({'Type'=>'PasswordText'}),
      SOAP::Header->name(Nonce => '0AJuLu+MMip44x1Mv9S1fg=='),
      SOAP::Header->name(Created => '2004-09-17T21:05:38Z'),
      );

      my $som=$soap->call( 'RetrieveVoucherByBatchSerial',
      batchNumber => '77000',
      serialNumber => '7120408');


      if ($som->fault)
      {
      print "\nfaultdetail:\n";
      print $som->faultdetail;
      print "\nfaultcode:\n";
      print $som->faultcode;
      print "\nfaultstring:\n";
      print $som->faultstring;
      print "\nfaultactor:\n";
      print $som->faultactor;
      }
    • Karanth Srihari
      Hi achan_work, I am facing a similar problem, if you have managed to solve it can you please tell me how u solved it. Thanks ... set
      Message 2 of 2 , Oct 19, 2005
      • 0 Attachment
        Hi achan_work,

        I am facing a similar problem, if you have managed to solve it can
        you please tell me how u solved it.


        Thanks

        --- In soaplite@yahoogroups.com, "achan_work" <achan_work@y...> wrote:
        >
        >
        > Hi,
        >
        > I would like to use SOAP::Lite to communicate with the web server,
        > but I
        > need to send the token to get the access. Does anyone know how to
        set
        > up in
        > SOAP::Lite? I have the following code, but I get the errorcode 1001,
        > "Request must have exactly one security token" message back. Does
        > anyone
        > give me some hints? Thanks
        >
        >
        > use SOAP::WSDL;
        > use SOAP::Lite;
        >
        > my $soap=SOAP::WSDL->new( wsdl =>
        > 'http://172.16.230.101/ccws/ccws.asmx?WSDL' );
        >
        > $soap->proxy( 'http://172.16.230.101/ccws/ccws.asmx');
        >
        > $soap->wsdlinit;
        >
        >
        > $soap->on_action(sub{'http://comverse-
        > in.com/prepaid/ccws/RetrieveVoucherByB
        > atchSerial'});
        >
        > $serializer = SOAP::Serializer->envelope(method => 'security',
        > SOAP::Header->name(Security=>
        > '')->attr({mustUnderstand=>'1'},
        > {xmlns=>'http://schemas.xmlsoap.org/ws/2002/
        > 07/secext'}),
        > SOAP::Header->name(UsernameToken =>
        > '')->attr({xmlns=>'http://schemas.xmlsoap.org/ws/2002/07/utility'},
        > {Id=>'SecurityToken-2b8987f9-37e4-47b1-9a4a-12415aef5735'}),
        > SOAP::Header->name(Username => 'web'),
        > SOAP::Header->name(Password =>
        > 'qwerty')->attr({'Type'=>'PasswordText'}),
        > SOAP::Header->name(Nonce => '0AJuLu+MMip44x1Mv9S1fg=='),
        > SOAP::Header->name(Created => '2004-09-17T21:05:38Z'),
        > );
        >
        > my $som=$soap->call( 'RetrieveVoucherByBatchSerial',
        > batchNumber => '77000',
        > serialNumber => '7120408');
        >
        >
        > if ($som->fault)
        > {
        > print "\nfaultdetail:\n";
        > print $som->faultdetail;
        > print "\nfaultcode:\n";
        > print $som->faultcode;
        > print "\nfaultstring:\n";
        > print $som->faultstring;
        > print "\nfaultactor:\n";
        > print $som->faultactor;
        > }
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.