Hi Erik,
Thanks for the reply. I should have included the -i output, pasted below here. 
The -d@"file.xml" is giving me the same error.  I tried PUT with -T and it is 
the same error.

--------------------------------------
HTTP/1.1 100 Continue

HTTP/1.1 401 Unauthorized
WWW-Authenticate: Digest realm="public", qop="auth", nonce="71b26b42ce73d7775681
883747251309", opaque="674933b58966e282"
Content-type: application/xml
Server: MarkLogic
Content-Length: 211
Connection: Keep-Alive
Keep-Alive: timeout=5

HTTP/1.1 100 Continue

HTTP/1.1 401 Unauthorized
WWW-Authenticate: Digest realm="public", qop="auth", nonce="fe39d77b4b9cc78ab8fe
bec5b03697de", opaque="60a9b228d360b84e"
Content-type: application/xml
Server: MarkLogic
Content-Length: 211
Connection: Keep-Alive
Keep-Alive: timeout=5

<rapi:error xmlns:rapi="http://marklogic.com/rest-api";><rapi:status-code>401</ra
pi:status-code><rapi:status>Failed Auth</rapi:status><rapi:message-code/><rapi:m
essage>Unauthenticated</rapi:message></rapi:error>
--------------------------------------

The -d error:

curl --anyauth --user admin:password -X PUT 
-d@"newopt.xml<mailto:-d@%22newopt.xml>"  -i  -H "Content-type:application/xml" 
http://mymldb:9006/v1/config/query/myopt   [tried POST as well].

HTTP/1.1 401 Unauthorized
WWW-Authenticate: Digest realm="public", qop="auth", nonce="730277ccf361064b9d3b
391ef8ece4e5", opaque="be4535a03df9cfa0"
Content-type: application/xml
Server: MarkLogic
Content-Length: 211
Connection: Keep-Alive
Keep-Alive: timeout=5

HTTP/1.1 401 Unauthorized
WWW-Authenticate: Digest realm="public", qop="auth", nonce="f09ec75c01b07f580956
89948218dc3e", opaque="054161eee75705d5"
Content-type: application/xml
Server: MarkLogic
Content-Length: 211
Connection: Keep-Alive
Keep-Alive: timeout=5

<rapi:error xmlns:rapi="http://marklogic.com/rest-api";><rapi:status-code>401</ra
pi:status-code><rapi:status>Failed Auth</rapi:status><rapi:message-code/><rapi:m
essage>Unauthenticated</rapi:message></rapi:error>


Thanks.

From: [email protected] 
[mailto:[email protected]] On Behalf Of Erik Hennum
Sent: Wednesday, May 13, 2015 6:51 PM
To: MarkLogic Developer Discussion
Subject: Re: [MarkLogic Dev General] Custom query option problem

Hi, Srinivas:

FWIW, I've always used the curl -d @file.xml option instead of the -T option.

However, when I tried -T locally, the only issue I ran into was with the POST.  
You
should use PUT if you are replacing the entire query options.

I notice you're using the -i option -- does the header output tell you anything?

Erik Hennum
________________________________
From: 
[email protected]<mailto:[email protected]>
 [[email protected]] on behalf of Yeditha, Srinivas 
[[email protected]]
Sent: Wednesday, May 13, 2015 3:23 PM
To: [email protected]<mailto:[email protected]>
Subject: [MarkLogic Dev General] Custom query option problem
Hi all,

We are trying to adjust the search options used by the REST API to add 
<transform-results apply="raw"/>. I have the below in opt.txt:

<options xmlns="http://marklogic.com/appservices/search";>
<transform-results apply="raw"/>
</options>


The below Curl command comes up with authentication error, although the admin 
user/password is correct. We can access admin console or qconsole or even make 
REST API calls using the same admin account.
curl --anyauth --user admin:password -X POST -T "opt.txt" -i  -H 
"Content-type:application/xml" http://mymldb:9006/v1/config/query/myopt
Myopt is the custom option name.
The above curl seems to be correct as it worked on another test database. The 
error is pasted below. Is there a way we can figure out why authentication is 
failing? It feels like we are locked out, but it doesn't make sense. Could 
anyone please help?
<rapi:error 
xmlns:rapi="http://marklogic.com/rest-api";><rapi:status-code>401</rapi:status-code><rapi:status>Failed
 
Auth</rapi:status><rapi:message-code/><rapi:message>Unauthenticated</rapi:message></rapi:error>


Thanks,
Srinivas Yeditha

_______________________________________________
General mailing list
[email protected]
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to