Hi David, Thanks for your response.
Yeh, I got the issue. I have to use xdmp:url-encode() function to pass the json string as structuredQuery. Now it's working fine for me. Regards, Asit Nautiyal From: [email protected] [mailto:[email protected]] On Behalf Of David Lee Sent: Sunday, January 27, 2013 7:04 PM To: MarkLogic Developer Discussion Subject: Re: [MarkLogic Dev General] Invalid URI format error using structuredQuery in ML 6.0 I tried this on a 6.0 (copy & pasting your exact text) and get past the URI format to a connection refused: My GUESS is that you might have funky quotes ... maybe something copy/pasted from MS/Word ? Not sure. But it definately parses fine for me on 6.0 server. [1.0-ml] SVC-SOCCONN: xdmp:http-get("http://localhost:9000/v1/search?structuredQuery={"query&quo...<http://localhost:9000/v1/search?structuredQuery=%7b"query&quo...>", <options xmlns="xdmp:http"><authentication method="basic"><username>admin</username><passwo...</options>) -- Socket connect error: connect 127.0.0.1:9000: Connection refused ----------------------------------------------------------------------------- David Lee Lead Engineer MarkLogic Corporation [email protected]<mailto:[email protected]> Phone: +1 812-482-5224 Cell: +1 812-630-7622 www.marklogic.com<http://www.marklogic.com/> From: [email protected]<mailto:[email protected]> [mailto:[email protected]] On Behalf Of [email protected]<mailto:[email protected]> Sent: Sunday, January 27, 2013 5:16 AM To: [email protected]<mailto:[email protected]> Subject: [MarkLogic Dev General] Invalid URI format error using structuredQuery in ML 6.0 Hi, When I am executing the below code, I am getting error " Invalid URI format" [1.0-ml] XDMP-URI: xdmp:http-get("http://localhost:9000/v1/search?structuredQuery={"query...<http://localhost:9000/v1/search?structuredQuery=%7b"query...>", <options xmlns="xdmp:http"><authentication method="basic"><username>hmhadmin</username><pas...</options>) --Invalid URI format: "http://localhost:9000/v1/search?structuredQuery={"query":{"term-query":{"text":"Complete"} }}&format=xml&collection=Resources&options=all-search<http://localhost:9000/v1/search?structuredQuery=%7b"query":%7b"term-query":%7b"text":"Complete"%7d }}&format=xml&collection=Resources&options=all-search>" Code : let $http-res := xdmp:http-get('http://localhost:9000/v1/search?structuredQuery={"query":{"term-query":{"text":"Complete"}}}&format=xml&collection=Resources&options=all-search', <options xmlns="xdmp:http"> <authentication method="basic"> <username>admin</username> <password>admin</password> </authentication> </options>) return $http-res My Requirement : I have to call MarkLogic 6.0 rest API's form a XQuery file using xdmp:http-get() method ,which contains above code. But i m getting Invalid URI format error. But when I am hitting the URL through browser "http://localhost:9000/v1/search?structuredQuery={<http://localhost:9000/v1/search?structuredQuery=%7b>"query":{"term-query":{"text":"Complete"}}}&format=xml&collection=Resources&options=all-search" its working fine. Also, when I am using string query for search its working fine for me as below code : let $http-res := xdmp:http-get('http://localhost:9000/v1/search?q=9780547894140&format=xml&collection=Resources&options=all-search', <options xmlns="xdmp:http"> <authentication method="basic"> <username>admin</username> <password>admin</password> </authentication> </options>) return $http-res I think, here the problem is only with json query when we are passing as structuredQuery to MarkLogic ML 6.0. So, Can you please provide me solution to resolve this Invalid URI format error.? Regards, Asit Nautiyal 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. 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.
_______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general
