The actual operation should not matter (Create vs Set).
 
 
#!/apps/remdev/ars/ars/perl -w
#
# Test Remedy WebService
#
use Env;
use SOAP::Lite +trace => [ transport => \&SOAP_log ];
 
sub SOAP_log {
    # Assume Transport Logging Only
    my ($in) = @_;
    my $doubleLF = chr(10).chr(10);
    my $singleLF = chr(10);
    my($sName,$sVal) = split(/=/,$in,2);    
 
    while( my ($k, $v) = each %$in ) {
      if ( $k eq "_content" ) {
         $sVal = "$sName\n".$v;
         $sVal =~ s/$doubleLF/$singleLF/g;
         write_log ( $sVal );
      }
    }
 }
 
sub write_log {
#  my $arLogFile=$ENV{'ARCONFIGDIR'}."/tmp/fred_Remedy_SOAP.log";
   my $arLogFile="fred_Remedy_SOAP.log";
   my($message) = @_;
 
   $message="$message";
 
   chop(my $date = `date +'%a %b %e %Y %T'`);
   my $messagehead = "<PERL> <TID: 0> <RPC ID: 0> <Queue: 0> <Client-RPC: 0> 
<USER: perl> /* $date */ ";
 
   warn "Could not open logfile: $arLogFile\n" unless (open (LOGFILE, 
">>$arLogFile"));
   print LOGFILE "$messagehead $message\n";
   warn "Could not close logfile: $arLogFile\n" unless (close (LOGFILE));
}
 

my $USERNAME  = "USER";
my $PASSWORD  = "PASS";
 
my $arServer = "devars";
my $ServiceName  = "TestService";
my $RemedyURL    = 
"http://devtomcat/ars/services/ARService?server=".$arServer."&webService=".$ServiceName
 
<http://devtomcat/ars/services/ARService?server=".$arServer."&webService=".$ServiceName>
 ;
my $RemedyNS     = "urn:".$ServiceName;
 
my $RecordID = "TST000001290066";
my $StatusTxt = "Success";
my $UpdateDate = "2006-11-17T20:35:11";
 
my $soap = SOAP::Lite
    -> proxy($RemedyURL)
    -> ns($RemedyNS,'ns1')
    -> autotype(0)
    -> readable(1);
 
my $som = $soap->OpSet(
       SOAP::Header->name('AuthenticationInfo' => \SOAP::Header->value(
       SOAP::Header->name('userName' => $USERNAME),
       SOAP::Header->name('password' => $PASSWORD) )),
                 SOAP::Data->name('RecordID'   => $RecordID ),
                 SOAP::Data->name('txtStatus'  => $StatusTxt ),
                 SOAP::Data->name('StatusTime' => $UpdateDate ) );
 
#print $som; 

The subroutines in blue (SOAP_log and write_log) are used to log the 
HTTP:Request and HTTP:Response data to a file in a human readable format. To 
disable this logging change the use statement from:  use SOAP::Lite +trace => [ 
transport => \&SOAP_log ]; to use SOAP::Lite;
 
Fred
 
 
________________________________

From: Action Request System discussion list(ARSList) [mailto:[EMAIL PROTECTED] 
On Behalf Of Frank Caruso
Sent: Thursday, May 24, 2007 1:02 PM
To: [email protected]
Subject: Re: SOAP OpSet


** That handles an OpCreate only. I have tried using pieces of that script for 
an OpSet but am having no luck.



On 5/24/07, Jarl Grøneng < [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> > 
wrote: 

        From an earier post:
        
        
------------------------------------------------------------------------ 
        
        There is a SOAP::Lite example of how to consume a Remedy Web services
        in the Developer community. (not a CGI, but that is really not related
        to the question. Really.)
        
        Utility -->  Development --> Web Service Perl Test Client 
        
        --
        Carey Matthew Black
        -----------------------------------------------------------------------
        
        On 5/24/07, Frank Caruso <[EMAIL PROTECTED]> wrote: 
        > ** Looking for an example of consuming a Remedy Web Service using 
Perl and
        > SOAP::Lite.
        > Specifically looking for an OpSet example.
        >
        > Thank you
        >
        >
        > --
        > Frank Caruso 
        > Specific Integration, Inc.
        >  Senior Remedy Engineer, ITIL Foundation Certified
        > www.specificintegration.com
        > 703-376-1249 __20060125_______________________This posting 
        > was submitted with HTML in it___
        
        
_______________________________________________________________________________
        UNSUBSCRIBE or access ARSlist Archives at www.arslist.org 
ARSlist:"Where the Answers Are"
        




-- 
Frank Caruso
Specific Integration, Inc.
Senior Remedy Engineer, ITIL Foundation Certified
www.specificintegration.com
703-376-1249 __20060125_______________________This posting was submitted with 
HTML in it___ 

_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org ARSlist:"Where the 
Answers Are"

Reply via email to