Hi Thusitha, Thanks a lot for the workarounds. If we consider above solution, we cannot hard code URLs like this as we may have reverse proxy, load balancer etc fronting this application. And the workaround you suggested on github issue is violating contract we made with swagger definition. For the moment we may use it as we do not have other solution as this is Blocker for us to move ahead. Lets fix this properly like other people do it.
Thanks, sanjeewa. On Sun, Nov 6, 2016 at 9:02 PM, Thusitha Thilina Dayaratne < [email protected]> wrote: > 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> > > -- *Sanjeewa Malalgoda* WSO2 Inc. Mobile : +94713068779 <http://sanjeewamalalgoda.blogspot.com/>blog :http://sanjeewamalalgoda.blogspot.com/ <http://sanjeewamalalgoda.blogspot.com/>
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
