cancel
Showing results for 
Search instead for 
Did you mean: 

Locale en SOAP Header in Web Services

ssandruchi
Champ in-the-making
Champ in-the-making
Hello!

I want to define "locale" in a content created by web services api, regardless of which locale is set in the machine.

So, as it's described in "http://wiki.alfresco.com/wiki/Web_Service_SOAP_Header", I have added the Locale in SOAP Header in Repository Service:

               getRepositoryService().setHeader(new RepositoryServiceLocator().getServiceName().getNamespaceURI(),
                                                                             "LocaleHeader", new LocaleConfiguration("es_ES"));


However, this code hasn't any effect in the created content, and this appear with the locale that is set in machine.

I have checked that "QueryHeader" works perfectly, and the 'fetchSize' property is mapped in "org.alfresco.repo.webservice.axis.QueryConfigHandler" class to ALF_FETCH_SIZE property, that it's evaluated after in 'RepositoryWebService.query' method (with "Utils.getBatchSize(msgContext)").

I have already raised an issue (AR-1668) with this question, but I haven't got any comments.
1 REPLY 1

lesha-sha
Champ in-the-making
Champ in-the-making
hi ssandruchi!

Have you found any solution for this question?
I have the same problem. I use repository service to make a query and when use english strings like TEXT:'alfresco' everything works fine. But when I try to use my language (Russian) like this TEXT:'привет' I get nothing. I have content with appropriate russian string and in-build alfresco client search works fine for this russian string. Also I tried to use the massage below to make a query and it gives the same results (ok - for english, nothing - for russian)

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.alfresco.org/ws/service/repository/1.0" xmlns:ns1="http://www.alfresco.org/ws/headers/1.0" xmlns:ns2="http://www.alfresco.org/ws/model/content/1.0">
   <soapenv:Header>
      <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" soapenv:mustUnderstand="1">
         <wsu:Timestamp xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
            <wsu:Created>2009-01-20T17:05:10.609Z</wsu:Created>
            <wsu:Expires>2009-01-20T20:05:22.609Z</wsu:Expires>
         </wsu:Timestamp>
         <wsse:UsernameToken>
            <wsse:Username>admin</wsse:Username>
            <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">TICKET_37f13ccf99ad8417bbb9a84d60563138a23b608b</wsse:Password>
         </wsse:UsernameToken>
      </wsse:Security>
   </soapenv:Header>

   <soapenv:Body>           
   <ns:query>
         <ns:store>
            <ns2:scheme>workspace</ns2:scheme>
            <ns2:address>SpacesStore</ns2:address>                          
    </ns:store>      
         <ns:query>
            <ns2:language>lucene</ns2:language>
            <ns2:statement>TEXT:'привет'</ns2:statement>
         </ns:query>
         <ns:includeMetaData>false</ns:includeMetaData>
      </ns:query>
   </soapenv:Body>
</soapenv:Envelope>

Alfresco 2.1

Thanks in advance
Alexey