Hi Tharindu, 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.
e.g. Response.status(Response.Status.CREATED).header(HttpHeaders.LOCATION, "http://localhost:8080/service/abc?page=2").build(); Thanks Thusitha On Sun, Nov 6, 2016 at 8:57 PM, Tharindu Dharmarathna <[email protected]> wrote: > Hi All, > > > We are going to implement API Creation Flow in API Manager C5 with msf4j > 2.1.0. > > *Requirement* > Need to send 201 (Created) with Location for the Created API resource. > > *Issue* > > When we implement this and test we came across with below exception. > > WARN {org.wso2.msf4j.internal.MSF4JMessageProcessor} - Unmapped exception >> java.lang.UnsupportedOperationException >> at org.wso2.msf4j.delegates.MSF4JResponse$Builder.location(MSF4 >> JResponse.java:334) >> at javax.ws.rs.core.Response.created(Response.java:699) >> at org.wso2.carbon.apimgt.rest.api.publisher.impl.ApisApiServic >> eImpl.apisPost(ApisApiServiceImpl.java:260) >> at org.wso2.carbon.apimgt.rest.api.publisher.ApisApi.apisPost(A >> pisApi.java:425) >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce >> ssorImpl.java:62) >> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe >> thodAccessorImpl.java:43) >> at java.lang.reflect.Method.invoke(Method.java:498) >> at org.wso2.msf4j.internal.router.HttpMethodInfo.invoke(HttpMet >> hodInfo.java:132) >> at org.wso2.msf4j.internal.MSF4JMessageProcessor.dispatchMethod >> (MSF4JMessageProcessor.java:130) >> at org.wso2.msf4j.internal.MSF4JMessageProcessor.receive(MSF4JM >> essageProcessor.java:72) >> at org.wso2.carbon.transport.http.netty.listener.WorkerPoolDisp >> atchingSourceHandler.lambda$publishToWorkerPool$12(WorkerPoo >> lDispatchingSourceHandler.java:125) >> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPool >> Executor.java:1142) >> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoo >> lExecutor.java:617) >> at java.lang.Thread.run(Thread.java:745) > > > Is there any workaround available for this ? > > Github issue created as [1]. > > [1] - https://github.com/wso2/msf4j/issues/320 > > Thanks > > > *Tharindu Dharmarathna*Software Engineer > WSO2 Inc.; http://wso2.com > lean.enterprise.middleware > > mobile: *+94779109091 <%2B94779109091>* > -- Thusitha Dayaratne Software Engineer WSO2 Inc. - lean . enterprise . middleware | wso2.com Mobile +94712756809 Blog alokayasoya.blogspot.com About http://about.me/thusithathilina <http://wso2.com/signature>
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
