cancel
Showing results for 
Search instead for 
Did you mean: 

Different results depending on access mechanism

flob
Champ in-the-making
Champ in-the-making
Hi all,

I'm experiencing a problem that slowly becomes a real pain to me.

I am using the following webscript to retrieve information about an object (assume I already logged in with admin:admin):
http://MYHOST.com:8080/alfresco/service/cmis/s/workspace:SpacesStore/i/62442fb2-2ffe-4e04-a9ea-0909b...

Whenever I access this script via Firefox or Chrome or whatever browser there may be, the result is correct, showing the latest version of that document in question, including all changes made to the metadata in the lifecycle of that document.

But, when I try to access the webscript on the command line by CURL or maybe even WGET
curl -uadmin:admin http://MYHOST.com:8080/alfresco/service/cmis/s/workspace:SpacesStore/i/62442fb2-2ffe-4e04-a9ea-0909b...
the result is the very first version of that document. The changes made to the metadata in Share are not reflected in the XML delivered to that request.

I can reproduce that all the time.

Please, could anyone give me a hint what (maybe trivial) error I'm running in?

Thanks a lot, best regard,

Flo B.
4 REPLIES 4

openpj
Elite Collaborator
Elite Collaborator
Have you tried checking the locale settings?
Maybe from the browser you are using a different locale.
Alfresco uses locale to create indexes that involve searches.

flob
Champ in-the-making
Champ in-the-making
Hi,

thanks for the hint.

All systems (Alfresco server and the Linux boxes invoking CURL) use en_US.UTF-8.
Only the windows machine on which the browser access to the webscript is successful uses de_DE

So I guess that can't be the solution?


Best regards,

Flo B.

mathwizard
Champ in-the-making
Champ in-the-making
Hello,
I had the same problem and it was the stupid language. In my OpenCmis code, I had


parameter.put(SessionParameter.LOCALE_ISO3166_COUNTRY, "");
parameter.put(SessionParameter.LOCALE_ISO639_LANGUAGE, "en");
parameter.put(SessionParameter.LOCALE_VARIANT, "US");

When I commented out these lines, everything started to work great.

Michael

flob
Champ in-the-making
Champ in-the-making
Hi mathwizard,

thanks for sharing your solution.

Indeed, that was the problem. I figured it out some weeks ago (sorry, I've forgotten to paste my solution).

If anyone is doing CMIS-Queries via PHP and CURL, be sure to include the following headers (change 'Accept-Language' according to your preferred language):


$this->curl = curl_init();
$headers = array('Accept-Language: de_DE', 'Cache-Control: max-age=0', 'Accept-Charset: utf-8');
curl_setopt($this->curl, CURLOPT_HTTPHEADER, $headers);

Best regards,

Florian