hi
i\'m trying to use perl to create a document in openkm; although my knowledge to OOP is limited i wrote the following (which is working UNTIL the creation part)
Document.pm looks like
Point is when sending the soap. .nothing comes in the soap call
look ..
actual soap call
i\'m trying to use perl to create a document in openkm; although my knowledge to OOP is limited i wrote the following (which is working UNTIL the creation part)
Code: Select all
---#!/usr/bin/perl
use strict;
use SOAP::Lite;
use Data::Dumper;
use MIME::Base64 qw(en_base64);
# local($/) = undef; # slurp
# print en_base64(<STDIN>);
use Document;
use SOAP::Lite +trace => qw (debug);
my $resp;
my $PartnersWS = SOAP::Lite->service(\'http://localhost:8080/OpenKM/OKMAuth?wsdl\');
my $token = $PartnersWS->login(\'admin\',\'admin\');
print \"---\";
my $buff=\"\";my $buf;
open(FILE, \"/var/log/wtmp\") or die \"$!\";
my $doc = new Document(\'/okm:root/testfolder/wtmp.txt2\',\'admin\');
my $file=$PartnersWS1->create($token,$doc,$buff);
my $res = $PartnersWS->logout($token);
Document.pm looks like
Code: Select all
--#!/usr/bin/perl
package Document;
sub new
{
my $class = shift;
my $self = {
path => shift,
author => shift,
};
bless $self, $class;
return $self;
}
sub setPath {
my ( $self, $path ) = @_;
$self->{path} = $path if defined($path);
return $self->{path};
}
sub getPath {
my( $self ) = @_;
return $self->{path};
}
1;
Point is when sending the soap. .nothing comes in the soap call
look ..
Code: Select all
----Dumper($doc)
$VAR1 = bless( {
\'author\' => \'admin\',
\'path\' => \'/okm:root/testfolder/wtmp.txt2\'
}, \'Document\' );
actual soap call
Code: Select all
can anyone please help me ?SOAP::Transport::HTTP::Client::send_receive: POST http://127.0.0.1:8080/OpenKM/OKMDocument HTTP/1.1
Accept: text/xml
Accept: multipart/*
Accept: application/soap
Content-Length: 6755
Content-Type: text/xml; charset=utf-8
SOAPAction: \"\"
<?xml version=\"1.0\" encoding=\"UTF-8\"?><soap:Envelope soap:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:tns=\"http://endpoint.ws.openkm.git.es/\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"><soap:Body><tns:create><arg0 xsi:type=\"xsd:string\">1129287567495677636285-19554898471</arg0>[color=#FF0000]<arg1 xsi:nil=\"true\" xsi:type=\"tns:document\" />[/color]<arg2 xsi:type=\"xsd:base64Binary\">QlFBQUFHcGVBQUF....</arg2></tns:create></soap:Body></soap:Envelope>