8.0

Table Of Contents
setprefs
Sets server preferences.
Namespace
setprefs
Response
QuarkXPress Server responds with the message "Preferences successfully set."
Alerts
Incorrect
administration realm
user name and
password.
HTTP Error #401
This alert is displayed when the wrong administrator user
name and password are specified.
What to do: Identify the correct user name and password that
were set in the server configuration, and then resubmit
setprefs with the correct user name and password.
Logs
If the request is successfully processed, a transaction success message is written to
the QuarkXPress Server Transaction Log file. The transaction entry consists of the
date and time of the request, request type, type of response produced by the
server, size of the response returned in bytes, and client IP address.
The following is a sample of a transaction entry:
1/13/2006 16:04:28 - setprefs - Type: text/plain - Size: 29 - Client: 127.0.0.1
If an alert is displayed, an error message is written to the QuarkXPress Server
error log file.
The following is a sample of an error log entry:
8/3/2005 17:49:23 - Error - Error Code: 10022 - Incorrect administration realm
user name and password.
Example GET
URL
http://localhost:8080/setprefs?CacheSize=200
Example, Object
Model
Request Object Name : GetPreferencesRequest
sdk.QRequestContext rc = new sdk.QRequestContext();
if(!this.DocumentSettings1.documentName.Text.Equals(""))
rc.documentName = this.DocumentSettings1.documentName.Text;
NameValueParam nameValueParam = new NameValueParam();
nameValueParam.paramName = this.pref1.Text;
nameValueParam.textValue = this.prefvalue1.Text;
SetPreferencesRequest request = new SetPreferencesRequest();
request.serverpreferences = new NameValueParam[]{nameValueParam};
rc.request = request;
//Create the service and call it with QRequestContext object
QManagerSDKSvcService svc = new QManagerSDKSvcService();
sdk.QContentData qc = svc.processRequest(rc);
Notes
How can I set a preference with setprefs?
First issue the getprefs request handler. gstprefs returns the server preferences in
the form of XML. Note the XML tags of the server preferences you want to
modify. Submit the setprefs request for the preferences you want to modify. For
example, suppose you want to turn off Memory Caching. First submit a getprefs
request to the server. In the XML obtained by getprefs, note that the memory
caching tag is "AllowMemoryCaching". Now submit this setprefs request to the
server: http://localhost:8080/setprefs?AllowMemoryCaching=false
Page 205