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

Second Call of WebService fails

Expand Messages
  • as.aellen
    Hi all I m writing a soap::lite client. When this client calls the operation from a WebService the first time, it is successfull. The call works and also the
    Message 1 of 1 , Dec 20, 2010
    View Source
    • 0 Attachment

      Hi all

      I'm writing a soap::lite client. When this client calls the operation from a WebService the first time, it is successfull. The call works and also the result is correct. When the written client calls the same operation with the same data in the request, it generates following error on client side:

      "Element ':Data=HASH(0x1ac3684)' can't be allowed in valid XML message. Died. at C:/Perl/site/lib/SOAP/Lite.pm line 1412."


      Client Code fragment

      use strict;

      use SOAP::Lite;

      #use SOAP::Lite (+trace => [qw(transport debug parameters)]);   #Debug

      #use Data::Dumper;  #Debug

      #Variables

      #==========

      my ($soap, $request, $result);

      my ($scn, $action, $poname, $potype, $poiid, $parentpoiid, $cfsiid); #values for the WebService call to pass to CIA

      #Main

      #=====

      #WebService Definition

      #-----------------------------

      $soap = SOAP::Lite

        ->uri('http://www.swisscom.com/onecrm/potree/propagation')

        ->proxy('http://138.187.96.39:8199/Processes/NetCracker/OneCRM/ReplicateProductInventory/v01')  #Sys1 Sirius

         ->on_action(sub{"/Processes/NetCracker/OneCRM/ReplicateProductInventory"}) #define soapaction

        ->serializer(MySerializer->new);   #register serializer

      #Data for WebService Call

      #-----------------------------

      $scn = '1111';

      $action = 'Update';

      $poname = 'AccessAA';

      $potype = 'PO_AccessAA';

      $poiid = 'ALL:SUB:1111AccessAA';

      $parentpoiid = 'ALL:SUB:1111AA';

      $cfsiid = 'AC0.000.002.081';

      #WebService Call

      #---------------  

      #Call:

      #Attributes and namespace of the root method are set in a custom serializer.

      BEGIN {

        package MySerializer;

        @MySerializer::ISA = 'SOAP::Serializer';

        sub envelope {

          $_[2] = SOAP::Data->name($_[2])->attr({SCN => $scn})->uri('http://www.swisscom.com/onecrm/potree/propagation','')->prefix('');

          shift->SUPER::envelope(@_)

        }

      }

      #The child elements are constructed with SOAP::Data.

      $soap->autotype(0);

      $soap->readable(1);

      $request = SOAP::Data->name(

                                            POInstance => \SOAP::Data->value(

                                                                                            SOAP::Data->name(Name  => $poname),

                                                                                            SOAP::Data->name(Type  => $potype),                                  

                                                                                            SOAP::Data->name(POIID => $poiid),                                    

                                                                                            SOAP::Data->name(ParentPOIID => $parentpoiid),                  

                                                                                            SOAP::Data->name(CFSIID => $cfsiid),                                                                                              

                                                                                           ),

                                            )->attr({Action => $action});

                               

      foreach my $loopcount (1..2){

      print"looop $loopcount \n";                   

                               

      $result = $soap->CustomerAccount($request);

      }

      Read Result

      ..

      ..

      ..

      At the end I plan to call the WebService with different values of the variables. At the moment it is only a test loop.

       

      End Code

       

      Version
      soap::lite v0.712

      Thanks very much for your support.

      Kind regards

      Andres

       

       

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