Thank you David for your explanation. I also have same understanding
however not able to find exact method/module which is not converting into
map.

I identified router.xqy (line 67) and request.xqy where the conversion is
happening and setting map to the request.

Might be good to open a ticket in the github/roxy and see if I get some
resolution.

However I am attaching the router.xqy and request.xqy for your reference.
if possible please take a look and suggest some resolution.

Could you please help me to get the link of the APIs that have modified as
you said in your comments? OR Should we look into release notes?

Thank you for your time and help.

Regards,
Indrajeet

On Tue, Apr 28, 2015 at 8:16 PM, David Lee <[email protected]> wrote:

>  This is probably best addressed by filing an issue on the Roxy github
> issue tracker.
>
>
>
> https://github.com/marklogic/roxy
>
>
>
> Roxy is a community/developer supported product.
>
>
>
> I suspect the issue is due to the (not backwards compatible, but
> documented) change to many JSON related API's in MarkLogic.
>
>
>
> The JSON API's have been converted to work directly with the native JSON
> data types in ML8.
>
>
>
> All of the internal MarkLogic libraries and apps have been updated as well
> to adjust to this change.   Exactly where in Roxy this is breaking I don't
> know, but the errors suggest is likely due to the ML8 changes in JSON.
>
>
>
> Happy to help with any specific questions on the changes to ML APIs.
>
>
>
> -David
>
>
>
>
>
>
>
>
>
>
> -----------------------------------------------------------------------------
>
> David Lee
> Lead Engineer
> *Mark**Logic* Corporation
> [email protected]
> Phone: +1 812-482-5224
>
> Cell:  +1 812-630-7622
> www.marklogic.com
>
>
>
> *From:* [email protected] [mailto:
> [email protected]] *On Behalf Of *Indrajeet Verma
> *Sent:* Tuesday, April 28, 2015 10:15 AM
> *To:* MarkLogic Developer Discussion
> *Subject:* [MarkLogic Dev General] JSON sending in the request body is
> not being converted into map:map in ML8 using roxy however working fine
> with ML6
>
>
>
> Hi,
>
>
>
> Please help us if you have encountered same kind of problem.
>
>
>
> We are upgrading ML6 to ML8 and using roxy as well. The roxy is customized
> based on the customer requirement.
>
>
> For one of the REST request "/setcache", we are sending below data to
> cache and that is being converted into map (key value pair)
>
> ML6-
>
> Request in Body-
> -----------------------
>
> {"USERSESSION:a57e7e98cae8a7857285cd9a66de813f|4/28/2015 9:48:14
> PM":{"user":"<user-profile
> wk-pid=\"USR-b740cbc5-5e27-8b1c-d97a-1329625f6b39\"><docType>Users</docType><username
> type=\"string\">USR-b740cbc5-5e27-8b1c-d97a-1329625f6b39</username><userId
> type=\"string\">[email protected]</userId><email type=\"string\">
> [email protected]</email><userStatus
> type=\"string\">Active</userStatus><defaultContentCollection>ALL</defaultContentCollection><role
> type=\"string\">user</role><trialEndDate type=\"string\"/><activationDate
> type=\"string\">2013-12-25</activationDate><phoneNumber
> type=\"string\"/><sendWelcomeEmail type=\"string\"/><additionalEmail
> type=\"string\"/><filingContent
> type=\"string\">Allowed</filingContent><firstName
> type=\"string\">John</firstName><lastName
> type=\"string\">Doe</lastName><orgCode
> type=\"string\">WK001</orgCode><orgName
> type=\"string\">LoadRunner</orgName><salesTerritory
> type=\"string\"/><password>5f4dcc3b5aa765d61d8327deb882cf99</password><pw>password</pw><countOfLoggedIn>11</countOfLoggedIn><created>2014-07-11T11:05:11.589-05:00</created><createdBy
> type=\"string\">System</createdBy><modified>2014-07-11T11:05:11.589-05:00</modified><modifiedBy>
> [email protected]</modifiedBy></user-profile>",
> "session":"<session wk-pid=\"a57e7e98cae8a7857285cd9a66de813f|4/28/2015
> 9:48:14
> PM\"><username>USR-b740cbc5-5e27-8b1c-d97a-1329625f6b39</username><created>2015-04-28T17:48:14.661+05:30</created><expiration>2015-04-28T21:48:14.661+05:30</expiration><currenttime>2015-04-28T17:48:14.661+05:30</currenttime><valid>false</valid></session>"}}
>
> Converted into below map using ML6-
> --------------------------------------------------
>
> map:map(<map:map xmlns:xs="http://www.w3.org/2001/XMLSchema"; xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance";
>
> xmlns:map="http://marklogic.com/xdmp/map";><map:entry
> key="USERSESSION:97f7d8ec0b5bba928cb025bd1d4d28d4|4/28/2015 9:57:24
> PM"><map:value><map:map><map:entry key="user"><map:value><user-profile
> wk-pid="USR-59fb4f7d-de03-1e37-a23c-5c3d71552eaa"><username>USR-59fb4f7d-de03-1e37-a23c-5c3d71552eaa</username><docType>Users</docType><userId
> type="string">[email protected]</userId><firstName
> type="string">shruti</firstName><lastName
> type="string">jauhari</lastName><orgCode
> type="string">FORD-101</orgCode><orgName type="string">Ford Motor
> Company</orgName><filingContent
> type="string">Allowed</filingContent><userStatus
> type="string">Active</userStatus><trialEndDate
> type="string">2018-12-31</trialEndDate><role
> type="string">user</role><telephoneNumber 
> type="string">212-555-1212</telephoneNumber><salesTerritory
> type="string">Northeast</salesTerritory><sendWelcomeEmail
> type="string">False</sendWelcomeEmail><defaultContentCollection
> type="string">default</defaultContentCollection><additionalEmail
> type="string">[email protected]</additionalEmail><password>5f4dcc3b5aa765d61d8327deb882cf99</password><pw>password</pw><countOfLoggedIn>11</countOfLoggedIn><created>2015-04-22T15:37:32.151+05:30</created><createdBy>USR-2fe944cc-013e-5b5a-0dba-7e98c3ffab00</createdBy><modified>2015-04-22T15:37:32.151+05:30</modified><modifiedBy>USR-2fe944cc-013e-5b5a-0dba-7e98c3ffab00</modifiedBy></user-profile></map:value></map:entry><map:entry
> key="session"><map:value><session
> wk-pid="97f7d8ec0b5bba928cb025bd1d4d28d4|4/28/2015 9:57:24
> PM"><username>USR-59fb4f7d-de03-1e37-a23c-5c3d71552eaa</username><created>2015-04-28T17:57:24.34+05:30</created><expiration>2015-04-28T21:57:24.34+05:30</expiration><currenttime>2015-04-28T17:57:24.34+05:30</currenttime><valid>false</valid></session></map:value></map:entry></map:map></map:value></map:entry></map:map>)
>
> ML8 -
> -------
> Input and converted output is same. i.e. without map:
>
> {"USERSESSION:a57e7e98cae8a7857285cd9a66de813f|4/28/2015 9:48:14
> PM":{"user":"<user-profile
> wk-pid=\"USR-b740cbc5-5e27-8b1c-d97a-1329625f6b39\"><docType>Users</docType><username
> type=\"string\">USR-b740cbc5-5e27-8b1c-d97a-1329625f6b39</username><userId
> type=\"string\">[email protected]</userId><email type=\"string\">
> [email protected]</email><userStatus
> type=\"string\">Active</userStatus><defaultContentCollection>ALL</defaultContentCollection><role
> type=\"string\">user</role><trialEndDate type=\"string\"/><activationDate
> type=\"string\">2013-12-25</activationDate><phoneNumber
> type=\"string\"/><sendWelcomeEmail type=\"string\"/><additionalEmail
> type=\"string\"/><filingContent
> type=\"string\">Allowed</filingContent><firstName
> type=\"string\">John</firstName><lastName
> type=\"string\">Doe</lastName><orgCode
> type=\"string\">WK001</orgCode><orgName
> type=\"string\">LoadRunner</orgName><salesTerritory
> type=\"string\"/><password>5f4dcc3b5aa765d61d8327deb882cf99</password><pw>password</pw><countOfLoggedIn>11</countOfLoggedIn><created>2014-07-11T11:05:11.589-05:00</created><createdBy
> type=\"string\">System</createdBy><modified>2014-07-11T11:05:11.589-05:00</modified><modifiedBy>
> [email protected]</modifiedBy></user-profile>",
> "session":"<session wk-pid=\"a57e7e98cae8a7857285cd9a66de813f|4/28/2015
> 9:48:14
> PM\"><username>USR-b740cbc5-5e27-8b1c-d97a-1329625f6b39</username><created>2015-04-28T17:48:14.661+05:30</created><expiration>2015-04-28T21:48:14.661+05:30</expiration><currenttime>2015-04-28T17:48:14.661+05:30</currenttime><valid>false</valid></session>"}}
>
> I suspect roxy router.xqy and request.xqy are creating some issues however
> not able to identify the issue yet.
>
> Please suggest the fix for the same.
>
> Other errors in Errorlog.txt-
> -------------------------------------
>
> 2015-04-28 17:11:18.302 Notice: FilingsTool: Expecting map
> (INVALID-PARAMS):
> 2015-04-28 17:11:18.302 Notice: FilingsTool: in
> /app/controllers/setcache.xqy, at 29:22,
> 2015-04-28 17:11:18.302 Notice: FilingsTool: in xdmp:function(fn:QName("
> http://marklogic.com/roxy/controller/setcache","main";),
> "/app/controllers/setcache.xqy")() [1.0-ml]
> 2015-04-28 17:11:18.302 Notice: FilingsTool: $params =
> document{text{"{"USERSESSION:3aa2eb094d15d973e355d54812cf5720|4/28/2015
> 8:..."}}
> 2015-04-28 17:11:18.302 Notice: FilingsTool: $e = <error:error
> xsi:schemaLocation="http://marklogic.com/xdmp/error error.xsd" xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance"; xmlns:error="
> http://marklogic.com/xdmp/error
> "><error:code>XDMP-UNEXPECTED</error:code><error:name>err:XPST0003...</error:error>
> 2015-04-28 17:11:18.302 Notice: FilingsTool: in /app/lib/router.xqy, at
> 97:16,
> 2015-04-28 17:11:18.302 Notice: FilingsTool: in router:route() [1.0-ml]
> 2015-04-28 17:11:18.302 Notice: FilingsTool: $x = ()
> 2015-04-28 17:11:18.302 Notice: FilingsTool: $valid-request = fn:true()
> 2015-04-28 17:11:18.302 Notice: FilingsTool: in /app/restful-router.xqy,
> at 20:0 [1.0-ml]
>
>
>
> Regards,
>
> Indrajeet
>
> _______________________________________________
> General mailing list
> [email protected]
> Manage your subscription at:
> http://developer.marklogic.com/mailman/listinfo/general
>
>

Attachment: setcache.xqy
Description: Binary data

Attachment: request.xqy
Description: Binary data

Attachment: router.xqy
Description: Binary data

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

Reply via email to