<html><body><div style="font-family: times new roman, new york, times, serif; font-size: 12pt; color: #000000"><div>Hi Anton,</div><div><br></div><div>first of all sorry for the late answer.</div><div><br></div><div>In my case search works fine. I tried both samples (query-all-users.xml adn query-all-accounts.xml) and the result was the list of the users and shadows existing in midPoint. I used these curl commands (stated also in the <a data-mce-href="https://wiki.evolveum.com/display/midPoint/REST+API" href="https://wiki.evolveum.com/display/midPoint/REST+API" target="_blank">wiki</a>):</div><div><h5 id="RESTAPI-Search%28allaccounts%29" style="margin: 20px 0px 0px; color: #3d3d3d; font-size: 14px; line-height: 20px; font-family: Arial, sans-serif; background-color: #ffffff;" data-mce-style="margin: 20px 0px 0px; color: #3d3d3d; font-size: 14px; line-height: 20px; font-family: Arial, sans-serif; background-color: #ffffff;">Search (all accounts)</h5><p style="margin: 0px; color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; background-color: #ffffff;" data-mce-style="margin: 0px; color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; background-color: #ffffff;">curl.exe --user <a href="http://administrator:5ecr3t/" class="external-link" rel="nofollow" style="color: #326ca6; text-decoration: none;" data-mce-href="http://administrator:5ecr3t/" data-mce-style="color: #326ca6; text-decoration: none;">administrator:5ecr3t</a> -H "Content-Type: application/xml" -X POST<a href="http://localhost:8080/midpoint/model/rest/shadows/search" class="external-link" rel="nofollow" style="color: #326ca6; text-decoration: none;" data-mce-href="http://localhost:8080/midpoint/model/rest/shadows/search" data-mce-style="color: #326ca6; text-decoration: none;">http://localhost:8080/midpoint/model/rest/shadows/search</a> -d @pathToMidpointGit\samples\rest\query-all-accounts.xml</p><h5 id="RESTAPI-Search%28allusers%29" style="margin: 20px 0px 0px; color: #3d3d3d; font-size: 14px; line-height: 20px; font-family: Arial, sans-serif; background-color: #ffffff;" data-mce-style="margin: 20px 0px 0px; color: #3d3d3d; font-size: 14px; line-height: 20px; font-family: Arial, sans-serif; background-color: #ffffff;">Search (all users)</h5><p style="margin: 0px; color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; background-color: #ffffff;" data-mce-style="margin: 0px; color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; background-color: #ffffff;">curl.exe --user <a rel="nofollow" style="color: #326ca6;" data-mce-style="color: #326ca6;">administrator:5ecr3t</a> -H "Content-Type: application/xml" -X POST<a href="http://localhost:8080/midpoint/model/rest/shadows/search" class="external-link" rel="nofollow" style="color: #326ca6; text-decoration: none;" data-mce-href="http://localhost:8080/midpoint/model/rest/shadows/search" data-mce-style="color: #326ca6; text-decoration: none;">http://localhost:8080/midpoint/model/rest/users/search</a> -d @pathToMidpointGit\samples\rest\query-all-users.xml</p><p style="margin: 0px; color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; background-color: #ffffff;" data-mce-style="margin: 0px; color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; background-color: #ffffff;"><br></p><p style="margin: 0px; color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; background-color: #ffffff;" data-mce-style="margin: 0px; color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; background-color: #ffffff;">According to the attached error it seems that maybe the xml was not properly loaded, please check if you didn't forget the '@' before the path to the sample. E.g. if your midPoint repository is in the C:\Users\midPoint\git-repo the curl command should looks like <br><br><span style="color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; background-color: #ffffff;" data-mce-style="color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; background-color: #ffffff;">curl.exe --user </span><a rel="nofollow" style="font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; color: #326ca6;" data-mce-style="font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; color: #326ca6;">administrator:5ecr3t</a><span style="color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; background-color: #ffffff;" data-mce-style="color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; background-color: #ffffff;"> -H "Content-Type: application/xml" -X POST</span><a href="http://localhost:8080/midpoint/model/rest/shadows/search" class="external-link" rel="nofollow" style="font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; color: #326ca6; text-decoration: none;" data-mce-href="http://localhost:8080/midpoint/model/rest/shadows/search" data-mce-style="font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; color: #326ca6; text-decoration: none;">http://localhost:8080/midpoint/model/rest/users/search</a><span style="color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; background-color: #ffffff;" data-mce-style="color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; background-color: #ffffff;"> -d <span style="color: rgb(204, 153, 255);"><strong>@</strong></span>C:\Users\midPoint\git-repo\samples\rest\query-all-users.xml</span><br></p><p style="margin: 0px; color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; background-color: #ffffff;" data-mce-style="margin: 0px; color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; background-color: #ffffff;"><span style="color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; background-color: #ffffff;" data-mce-style="color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; background-color: #ffffff;"><br></span></p><p style="margin: 0px; color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; background-color: #ffffff;" data-mce-style="margin: 0px; color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; background-color: #ffffff;"><span style="color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; background-color: #ffffff;" data-mce-style="color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; background-color: #ffffff;">And if it is possible, please check your server-side log as well. There should be better description and also the reason for the error.</span></p><p style="margin: 0px; color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; background-color: #ffffff;" data-mce-style="margin: 0px; color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; background-color: #ffffff;"><span style="color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; background-color: #ffffff;" data-mce-style="color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; background-color: #ffffff;"><br></span></p><p style="margin: 0px; color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; background-color: #ffffff;" data-mce-style="margin: 0px; color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; background-color: #ffffff;"><span style="color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; background-color: #ffffff;" data-mce-style="color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; background-color: #ffffff;">In the case, you have still some problems with REST calls, let me know. </span></p><p style="margin: 0px; color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; background-color: #ffffff;" data-mce-style="margin: 0px; color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; background-color: #ffffff;"><span style="color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; background-color: #ffffff;" data-mce-style="color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; background-color: #ffffff;"><br></span></p><p style="margin: 0px; color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; background-color: #ffffff;" data-mce-style="margin: 0px; color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; background-color: #ffffff;"><span style="color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; background-color: #ffffff;" data-mce-style="color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; background-color: #ffffff;">Best Regards,</span></p><p style="margin: 0px; color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; background-color: #ffffff;" data-mce-style="margin: 0px; color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; background-color: #ffffff;"><span style="color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; background-color: #ffffff;" data-mce-style="color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; background-color: #ffffff;">Katarina Valalikova</span></p></div><div><br></div><hr id="zwchr"><div style="color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><b>From: </b>midpoint@mybtinternet.com<br><b>To: </b>midpoint@lists.evolveum.com<br><b>Sent: </b>Wednesday, July 15, 2015 4:39:25 PM<br><b>Subject: </b>[midPoint] REST query internal error (500)<br><div><br></div>Hi Guys,<br><div><br></div>  Have tried for the first time to use the REST API and am running into internal error with user and account query.<br>  Am using the xml from the samples (midPoint 3.1.1): query-all-users.xml and query-all-accounts.xml. The former<br>  is used verbatim and the second I have substituted one of my resource OIDs. Both fails on seemingly the same<br>  issue ... see below.<br><div><br></div># AO: -----------------------------------------------------------------------------------------------#<br>2015-07-15 14:51:04,386 [] [http-bio-127.0.0.1-8080-exec-207] WARN (org.apache.cxf.phase.PhaseInterceptorChain): Interceptor for {http://impl.model.midpoint.evolveum.com/}ModelRestService has thrown exception, unwinding now<br>Caused by: org.xml.sax.SAXParseException: Content is not allowed in prolog.<br>        ... 55 common frames omitted<br>2015-07-15 14:51:04,387 [] [http-bio-127.0.0.1-8080-exec-207] WARN (org.apache.cxf.phase.PhaseInterceptorChain): Exception in handleFault on interceptor org.apache.cxf.jaxrs.interceptor.JAXRSDefaultFaultOutInterceptor@30a58fb8<br>org.apache.cxf.interceptor.Fault: Error parsing XML document Content is not allowed in prolog.<br>        ... 44 common frames omitted<br>Caused by: org.xml.sax.SAXParseException: Content is not allowed in prolog.<br>        ... 55 common frames omitted<br>org.apache.cxf.interceptor.Fault: Error parsing XML document Content is not allowed in prolog.<br>        ... 44 common frames omitted<br>Caused by: org.xml.sax.SAXParseException: Content is not allowed in prolog.<br>        ... 55 common frames omitted<br><div><br></div># AO: -----------------------------------------------------------------------------------------------#<br>2015-07-15 14:59:57,891 [] [http-bio-127.0.0.1-8080-exec-208] WARN (org.apache.cxf.phase.PhaseInterceptorChain): Interceptor for {http://impl.model.midpoint.evolveum.com/}ModelRestService has thrown exception, unwinding now<br>Caused by: org.xml.sax.SAXParseException: Content is not allowed in prolog.<br>        ... 55 common frames omitted<br>2015-07-15 14:59:57,892 [] [http-bio-127.0.0.1-8080-exec-208] WARN (org.apache.cxf.phase.PhaseInterceptorChain): Exception in handleFault on interceptor org.apache.cxf.jaxrs.interceptor.JAXRSDefaultFaultOutInterceptor@30a58fb8<br>org.apache.cxf.interceptor.Fault: Error parsing XML document Content is not allowed in prolog.<br>        ... 44 common frames omitted<br>Caused by: org.xml.sax.SAXParseException: Content is not allowed in prolog.<br>        ... 55 common frames omitted<br>org.apache.cxf.interceptor.Fault: Error parsing XML document Content is not allowed in prolog.<br>        ... 44 common frames omitted<br>Caused by: org.xml.sax.SAXParseException: Content is not allowed in prolog.<br>        ... 55 common frames omitted<br><div><br></div><br>  Have also tried get object and test object REST calls, both works ...<br><div><br></div>Regards,<br>  Anton<br><div><br></div><br><div><br></div><br><div><br></div>_______________________________________________<br>midPoint mailing list<br>midPoint@lists.evolveum.com<br>http://lists.evolveum.com/mailman/listinfo/midpoint<br></div><div><br></div></div></body></html>