{"action":"created","issue":{"url":"https://api.github.com/repos/wso2/msf4j/issues/320","repository_url":"https://api.github.com/repos/wso2/msf4j","labels_url":"https://api.github.com/repos/wso2/msf4j/issues/320/labels{/name}","comments_url":"https://api.github.com/repos/wso2/msf4j/issues/320/comments","events_url":"https://api.github.com/repos/wso2/msf4j/issues/320/events","html_url":"https://github.com/wso2/msf4j/issues/320","id":187567475,"number":320,"title":"Location support in Response","user":{"login":"tharindu1st","id":6345931,"avatar_url":"https://avatars.githubusercontent.com/u/6345931?v=3","gravatar_id":"","url":"https://api.github.com/users/tharindu1st","html_url":"https://github.com/tharindu1st","followers_url":"https://api.github.com/users/tharindu1st/followers","following_url":"https://api.github.com/users/tharindu1st/following{/other_user}","gists_url":"https://api.github.com/users/tharindu1st/gists{/gist_id}","starred_url":"https://api.github.com/users/tharindu1st/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tharindu1st/subscriptions","organizations_url":"https://api.github.com/users/tharindu1st/orgs","repos_url":"https://api.github.com/users/tharindu1st/repos","events_url":"https://api.github.com/users/tharindu1st/events{/privacy}","received_events_url":"https://api.github.com/users/tharindu1st/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-06T15:20:08Z","updated_at":"2016-11-06T15:32:54Z","closed_at":null,"body":"We are going to use below snippets in order to do POST request with 201 response. We want to send the Created resource location through the Response. Once we implement that we came up with below stack trace.\r\n\r\n\r\n> WARN {org.wso2.msf4j.internal.MSF4JMessageProcessor} - Unmapped exception java.lang.UnsupportedOperationException\r\n        at org.wso2.msf4j.delegates.MSF4JResponse$Builder.location(MSF4JResponse.java:334)\r\n        at javax.ws.rs.core.Response.created(Response.java:699)\r\n        at org.wso2.carbon.apimgt.rest.api.publisher.impl.ApisApiServiceImpl.apisPost(ApisApiServiceImpl.java:260)\r\n        at org.wso2.carbon.apimgt.rest.api.publisher.ApisApi.apisPost(ApisApi.java:425)\r\n        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n        at java.lang.reflect.Method.invoke(Method.java:498)\r\n        at org.wso2.msf4j.internal.router.HttpMethodInfo.invoke(HttpMethodInfo.java:132)\r\n        at org.wso2.msf4j.internal.MSF4JMessageProcessor.dispatchMethod(MSF4JMessageProcessor.java:130)\r\n        at org.wso2.msf4j.internal.MSF4JMessageProcessor.receive(MSF4JMessageProcessor.java:72)\r\n        at org.wso2.carbon.transport.http.netty.listener.WorkerPoolDispatchingSourceHandler.lambda$publishToWorkerPool$12(WorkerPoolDispatchingSourceHandler.java:125)\r\n        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)\r\n        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)\r\n        at java.lang.Thread.run(Thread.java:745)\r\n\r\n[https://github.com/wso2/carbon-apimgt/blob/a94893c66473febc597b2895afe329ceccb1fbd3/components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher/src/main/java/org/wso2/carbon/apimgt/rest/api/publisher/impl/ApisApiServiceImpl.java#L260](url)"},"comment":{"url":"https://api.github.com/repos/wso2/msf4j/issues/comments/258688494","html_url":"https://github.com/wso2/msf4j/issues/320#issuecomment-258688494","issue_url":"https://api.github.com/repos/wso2/msf4j/issues/320","id":258688494,"user":{"login":"thusithathilina","id":7578389,"avatar_url":"https://avatars.githubusercontent.com/u/7578389?v=3","gravatar_id":"","url":"https://api.github.com/users/thusithathilina","html_url":"https://github.com/thusithathilina","followers_url":"https://api.github.com/users/thusithathilina/followers","following_url":"https://api.github.com/users/thusithathilina/following{/other_user}","gists_url":"https://api.github.com/users/thusithathilina/gists{/gist_id}","starred_url":"https://api.github.com/users/thusithathilina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thusithathilina/subscriptions","organizations_url":"https://api.github.com/users/thusithathilina/orgs","repos_url":"https://api.github.com/users/thusithathilina/repos","events_url":"https://api.github.com/users/thusithathilina/events{/privacy}","received_events_url":"https://api.github.com/users/thusithathilina/received_events","type":"User","site_admin":false},"created_at":"2016-11-06T15:32:54Z","updated_at":"2016-11-06T15:32:54Z","body":"ATM, MSF4J doesn't support the Response.location(). We will fix this in the next release. Until that, as a workaround, you can use the set the status code and location header manually.\r\n\r\ne.g.\r\nResponse.status(Response.Status.CREATED).header(HttpHeaders.LOCATION, \"http://localhost:8080/service/abc?page=2\").build();\r\n"}}
{"actor":{"display_login":"thusithathilina"}}