{"action":"created","issue":{"url":"https://api.github.com/repos/wso2/product-ei/issues/510","repository_url":"https://api.github.com/repos/wso2/product-ei","labels_url":"https://api.github.com/repos/wso2/product-ei/issues/510/labels{/name}","comments_url":"https://api.github.com/repos/wso2/product-ei/issues/510/comments","events_url":"https://api.github.com/repos/wso2/product-ei/issues/510/events","html_url":"https://github.com/wso2/product-ei/issues/510","id":220177018,"number":510,"title":"[EI61] Restresource path should be send as the parent tag of the xml POST body","user":{"login":"sashikamw","id":14962228,"avatar_url":"https://avatars0.githubusercontent.com/u/14962228?v=3","gravatar_id":"","url":"https://api.github.com/users/sashikamw","html_url":"https://github.com/sashikamw","followers_url":"https://api.github.com/users/sashikamw/followers","following_url":"https://api.github.com/users/sashikamw/following{/other_user}","gists_url":"https://api.github.com/users/sashikamw/gists{/gist_id}","starred_url":"https://api.github.com/users/sashikamw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sashikamw/subscriptions","organizations_url":"https://api.github.com/users/sashikamw/orgs","repos_url":"https://api.github.com/users/sashikamw/repos","events_url":"https://api.github.com/users/sashikamw/events{/privacy}","received_events_url":"https://api.github.com/users/sashikamw/received_events","type":"User","site_admin":false},"labels":[{"id":571910115,"url":"https://api.github.com/repos/wso2/product-ei/labels/Not%20a%20bug","name":"Not a bug","color":"0e8a16","default":false}],"state":"open","locked":false,"assignee":{"login":"Subasinghe","id":10918035,"avatar_url":"https://avatars2.githubusercontent.com/u/10918035?v=3","gravatar_id":"","url":"https://api.github.com/users/Subasinghe","html_url":"https://github.com/Subasinghe","followers_url":"https://api.github.com/users/Subasinghe/followers","following_url":"https://api.github.com/users/Subasinghe/following{/other_user}","gists_url":"https://api.github.com/users/Subasinghe/gists{/gist_id}","starred_url":"https://api.github.com/users/Subasinghe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Subasinghe/subscriptions","organizations_url":"https://api.github.com/users/Subasinghe/orgs","repos_url":"https://api.github.com/users/Subasinghe/repos","events_url":"https://api.github.com/users/Subasinghe/events{/privacy}","received_events_url":"https://api.github.com/users/Subasinghe/received_events","type":"User","site_admin":false},"assignees":[{"login":"Subasinghe","id":10918035,"avatar_url":"https://avatars2.githubusercontent.com/u/10918035?v=3","gravatar_id":"","url":"https://api.github.com/users/Subasinghe","html_url":"https://github.com/Subasinghe","followers_url":"https://api.github.com/users/Subasinghe/followers","following_url":"https://api.github.com/users/Subasinghe/following{/other_user}","gists_url":"https://api.github.com/users/Subasinghe/gists{/gist_id}","starred_url":"https://api.github.com/users/Subasinghe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Subasinghe/subscriptions","organizations_url":"https://api.github.com/users/Subasinghe/orgs","repos_url":"https://api.github.com/users/Subasinghe/repos","events_url":"https://api.github.com/users/Subasinghe/events{/privacy}","received_events_url":"https://api.github.com/users/Subasinghe/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/wso2/product-ei/milestones/4","html_url":"https://github.com/wso2/product-ei/milestone/4","labels_url":"https://api.github.com/repos/wso2/product-ei/milestones/4/labels","id":2418703,"number":4,"title":"6.1.0","description":"","creator":{"login":"vinok88","id":1875994,"avatar_url":"https://avatars2.githubusercontent.com/u/1875994?v=3","gravatar_id":"","url":"https://api.github.com/users/vinok88","html_url":"https://github.com/vinok88","followers_url":"https://api.github.com/users/vinok88/followers","following_url":"https://api.github.com/users/vinok88/following{/other_user}","gists_url":"https://api.github.com/users/vinok88/gists{/gist_id}","starred_url":"https://api.github.com/users/vinok88/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vinok88/subscriptions","organizations_url":"https://api.github.com/users/vinok88/orgs","repos_url":"https://api.github.com/users/vinok88/repos","events_url":"https://api.github.com/users/vinok88/events{/privacy}","received_events_url":"https://api.github.com/users/vinok88/received_events","type":"User","site_admin":false},"open_issues":12,"closed_issues":55,"state":"open","created_at":"2017-03-29T09:06:50Z","updated_at":"2017-04-07T11:16:27Z","due_on":"2017-04-05T07:00:00Z","closed_at":null},"comments":1,"created_at":"2017-04-07T10:38:25Z","updated_at":"2017-04-07T11:53:29Z","closed_at":null,"body":"**Environment**\r\nSetup - 3 node cluster fronted by nginx\r\nOS -redhat6, redhat7, debian\r\nJAVA -jdk 1.8\r\nDB - oracle12c\r\nPack - 07/04/2017 snapshot + last shared patch\r\n\r\n**Steps**\r\n1. Create a datasource with rest resource POST method\r\n```\r\n<data disableLegacyBoxcarringMode=\"true\" enableBatchRequests=\"true\" enableBoxcarring=\"true\" name=\"mysqltest\" transports=\"http https local\">\r\n   <config enableOData=\"true\" id=\"persdb\">\r\n   </config>\r\n <query id=\"addperson\" useConfig=\"persdb\">\r\n      <sql>INSERT INTO Persons (PersonID,LastName,FirstName,Address,City) VALUES (:id,:Lname,:Fname,:Address,:city);</sql>\r\n      <param name=\"id\" sqlType=\"INTEGER\"/>\r\n      <param name=\"Lname\" sqlType=\"STRING\">\r\n         <validateLength maximum=\"20\" minimum=\"10\"/>\r\n      </param>\r\n      <param name=\"Fname\" sqlType=\"STRING\"/>\r\n      <param name=\"Address\" sqlType=\"STRING\">\r\n         <validateLength maximum=\"10\" minimum=\"5\"/>\r\n      </param>\r\n      <param name=\"city\" sqlType=\"STRING\"/>\r\n   </query>\r\n\r\n  <operation name=\"AddPerson\" returnRequestStatus=\"true\">\r\n      <call-query href=\"addperson\">\r\n         <with-param name=\"id\" query-param=\"id\"/>\r\n         <with-param name=\"Lname\" query-param=\"Lname\"/>\r\n         <with-param name=\"Fname\" query-param=\"Fname\"/>\r\n         <with-param name=\"Address\" query-param=\"Address\"/>\r\n         <with-param name=\"city\" query-param=\"testcity\"/>\r\n      </call-query>\r\n   </operation>\r\n\r\n   <resource method=\"POST\" path=\"test/addperson\">\r\n      <call-query href=\"addperson\">\r\n         <with-param name=\"id\" query-param=\"id\"/>\r\n         <with-param name=\"Lname\" query-param=\"Lname\"/>\r\n         <with-param name=\"Fname\" query-param=\"Fname\"/>\r\n         <with-param name=\"Address\" query-param=\"Address\"/>\r\n         <with-param name=\"city\" query-param=\"city\"/>\r\n      </call-query>\r\n   </resource>\r\n```\r\n\r\n2. Invoke the rest resource as below\r\n\r\n```\r\nPOST http://ei.wso2.com:80/services/mysqltest/test/addperson\r\n\r\nPOST data:\r\n<Person><id>110</id><Lname>samplencssssss</Lname><Fname>sirimannesir</Fname><Address>addressa</Address><city>citysample</city></Person>\r\n\r\n[no cookies]\r\n\r\nRequest Headers:\r\nConnection: keep-alive\r\ncontent-type: application/xml\r\nContent-Length: 135\r\nHost: ei.wso2.com:80\r\nUser-Agent: Apache-HttpClient/4.5.2 (Java/1.8.0_66)\r\n```\r\n\r\n**Observations**\r\n`\r\n<axis2ns47:DataServiceFault xmlns:axis2ns47=\"http://ws.wso2.org/dataservice\"><axis2ns47:ds_code>UNKNOWN_ERROR</axis2ns47:ds_code></axis2ns47:DataServiceFault>`\r\n\r\n```\r\nTID: [-1234] [] [2017-04-07 14:34:02,221] ERROR {org.apache.synapse.transport.passthru.ServerWorker} -  Error processing POST request for : /services/mysqltest/test/addperson {org.apache.synapse.transport.passthru.ServerWorker}\r\norg.apache.axis2.AxisFault: DS Fault Message: Input Message and _posttest_addperson Axis Operation didn't match.\r\nDS Code: UNKNOWN_ERROR\r\n\r\n\tat org.wso2.carbon.dataservices.core.DBUtils.createAxisFault(DBUtils.java:742)\r\n\tat org.wso2.carbon.dataservices.core.DBInOnlyMessageReceiver.invokeBusinessLogic(DBInOnlyMessageReceiver.java:58)\r\n\tat org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:110)\r\n\tat org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)\r\n\tat org.apache.synapse.transport.passthru.ServerWorker.processNonEntityEnclosingRESTHandler(ServerWorker.java:326)\r\n\tat org.apache.synapse.transport.passthru.ServerWorker.processEntityEnclosingRequest(ServerWorker.java:372)\r\n\tat org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:151)\r\n\tat org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)\r\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)\r\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)\r\n\tat java.lang.Thread.run(Thread.java:745)\r\n```\r\n\r\n\r\n**Note** - \r\n1. This issue did not observe when the payload is provided as below\r\n\r\n`<_posttest_addperson><id>115</id><Lname>updatedsamplenc</Lname><Fname>efgt</Fname><Address>addressa</Address><city>citysample</city></_posttest_addperson>`\r\n\r\n2. Verified this with DSS 351 pack as well. It accepts the payload without considering the parent xml tag. \r\nThis might become an issue for a migration scenario.\r\n\r\n```\r\nPOST http://10.100.11.26:9763/services/mysqltest/test/addperson\r\n\r\nPOST data:\r\n<Person><id>111</id><Lname>samplencssssss</Lname><Fname>sirimannesir</Fname><Address>addressa</Address><city>citysample</city></Person>\r\n\r\n[no cookies]\r\n\r\nRequest Headers:\r\nConnection: keep-alive\r\ncontent-type: application/xml\r\nContent-Length: 135\r\nHost: 10.100.11.26:9763\r\nUser-Agent: Apache-HttpClient/4.5.2 (Java/1.8.0_66)\r\n```\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/wso2/product-ei/issues/comments/292517211","html_url":"https://github.com/wso2/product-ei/issues/510#issuecomment-292517211","issue_url":"https://api.github.com/repos/wso2/product-ei/issues/510","id":292517211,"user":{"login":"sashikamw","id":14962228,"avatar_url":"https://avatars0.githubusercontent.com/u/14962228?v=3","gravatar_id":"","url":"https://api.github.com/users/sashikamw","html_url":"https://github.com/sashikamw","followers_url":"https://api.github.com/users/sashikamw/followers","following_url":"https://api.github.com/users/sashikamw/following{/other_user}","gists_url":"https://api.github.com/users/sashikamw/gists{/gist_id}","starred_url":"https://api.github.com/users/sashikamw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sashikamw/subscriptions","organizations_url":"https://api.github.com/users/sashikamw/orgs","repos_url":"https://api.github.com/users/sashikamw/repos","events_url":"https://api.github.com/users/sashikamw/events{/privacy}","received_events_url":"https://api.github.com/users/sashikamw/received_events","type":"User","site_admin":false},"created_at":"2017-04-07T11:53:29Z","updated_at":"2017-04-07T11:53:29Z","body":"If we are changing the validation we should add this to the documentation as we mentioned it for json [1]. Also we should update rest resource sample [2] with correct invocation details.\r\n\r\n[1] https://docs.wso2.com/display/EI600/Using+JSON+Messages+with+RESTful+Services\r\n[2] https://docs.wso2.com/display/EI600/REST-Style+Resources+Sample"}}
{"actor":{"display_login":"sashikamw"}}