Foren

Subir Archivo via Web services

thumbnail
Alexis Araya, geändert vor 10 Jahren.

Subir Archivo via Web services

Junior Member Beiträge: 37 Beitrittsdatum: 08.10.13 Neueste Beiträge
Hola,

he logrado subir un archivo via webservice a la servicio documental, incluso asignar el tipo de documento,
pero no he logrado enviar la metadata del archivo.
El servicio web es

api/secure/axis/Portlet_DL_DLAppService?wsdl

y el metodo

addFileEntry

El cliente esta hecho en PHP.

$userName = "demo@liferay";
 $clientOptions = array(
    'login' => $userName,
    'password' => 'demo123');

   $client = new SoapClient(
        "http://server12:8081/api/secure/axis/Portlet_DL_DLAppService?wsdl",
        $clientOptions);

$serviceContext = array(
'addCommunityPermissions'=>NULL,
'addGroupPermissions'=>  NULL,
'addGuestPermissions'=> NULL,
'assetCategoryIds'=>NULL,
'assetEntryVisible'=>NULL,
'assetLinkEntryIds'=>14059,
'assetTagNames'=>NULL,
'attributes'=>array("fileEntryTypeId"=>14059,"texto1598"=>"WA600"),
'command'=>NULL,
'commandAdd'=>NULL,
'commandUpdate'=>NULL,
'communityPermissions'=>NULL,
'companyId'=>NULL,
'createDate'=>NULL,
 'currentURL'=>NULL,
'deriveDefaultPermissions'=>NULL,
'expandoBridgeAttributes'=>NULL,
 'failOnPortalException'=>NULL,
'guestPermissions'=>NULL,
'guestOrUserId'=>NULL,
'guestPermissions'=>NULL,
 'headers'=>NULL,
'indexingEnabled'=>NULL,
'languageId'=>NULL,
'layoutFullURL'=>NULL,
'layoutURL'=>NULL,
'modifiedDate'=>NULL,
'pathMain'=>NULL,
'plid'=>NULL,
'portalURL'=>NULL,
'portletPreferencesIds'=>NULL,
'scopeGroupId'=>'10179',
'signedIn'=>NULL,
'userAgent'=>NULL,
'userDisplayURL'=>NULL,
'userId'=>10195,
'uuid'=>NULL,
'workflowAction'=>NULL
);
$repositoryId = 10179;
$folderId = 0;
$sourceFileName = "ed_reporte_OP_WA600_20131105.pdf";
$mimeType = "application/pdf";
$title = "";
$description = "Reporte Operacional WA600";
$changeLog = "";
$bytes = file_get_contents("ed_reporte_OP_WA600_20131105.pdf");

$liferay_resultx = $client->__soapCall( "addFileEntry", array(
    $repositoryId,$folderId,$sourceFileName,$mimeType,
        $title,$description,$changeLog,$bytes,$serviceContext
));


Como comente sube el archivo y lo asigna correctamente al tipo de documento, pero no le puedo asignar la metadata requerida para ese tipo de documento.

Saludos y Gracias