Hi, Pavadai:

The data element takes only text, not an element as described in:

    http://docs.marklogic.com/xdmp:http-put

Try using xdmp:quote() to serialize the element payload, as in:

       <data>{xdmp:quote(
     <user-properties xmlns="http://marklogic.com/manage";>
    <user-name>MLuser</user-name>
    <password>MLpassword</password>
    </user-properties>
    )}</data>


Hoping that helps,


Erik Hennum


________________________________
From: [email protected] 
[[email protected]] on behalf of 
[email protected] [[email protected]]
Sent: Tuesday, December 27, 2016 4:33 AM
To: [email protected]
Subject: [MarkLogic Dev General] ML error on http-put

Hello Team,

I am getting an error as shown below while trying to execute the below http-put 
REST service. Can someone please confirm what is wrong here?

Code:

(: execute this against the security database :)
xquery version "1.0-ml";

   xdmp:http-put("http://localhost:8002/manage/v2/users/duraiDec/properties";,
     <options xmlns="xdmp:http">
       <authentication method="basic">
         <username>admin</username>
         <password>admin</password>
       </authentication>
       <data>
     <user-properties xmlns="http://marklogic.com/manage";>
    <user-name>MLuser</user-name>
    <password>MLpassword</password>
    </user-properties>
    </data>
     </options>  )

Error:

1.0-ml] XDMP-NOTSIMPLE: 
xdmp:http-put("http://localhost:8002/manage/v2/users/duraiDec/properties";, 
<options xmlns="xdmp:http"><authentication 
method="basic"><username>admin</username><passwo...</options>) -- Node does not 
have simple content: /*:options/*:data


Thanks,
Durai.

This e-mail and any files transmitted with it are for the sole use of the 
intended recipient(s) and may contain confidential and privileged information. 
If you are not the intended recipient(s), please reply to the sender and 
destroy all copies of the original message. Any unauthorized review, use, 
disclosure, dissemination, forwarding, printing or copying of this email, 
and/or any action taken in reliance on the contents of this e-mail is strictly 
prohibited and may be unlawful. Where permitted by applicable law, this e-mail 
and other e-mail communications sent to and from Cognizant e-mail addresses may 
be monitored.
_______________________________________________
General mailing list
[email protected]
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to