Re: Welcome Swapnil Shah as new PMC member!!

2020-09-27 Thread Deepak Dixit
Many many congrats Swapnil 

Kind Regards,
Deepak Dixit



On Sat, Sep 26, 2020 at 8:14 PM Pranay Pandey <
pranay.pan...@hotwaxsystems.com> wrote:

> Congratulations Swapnil!
> Best regards,
> Pranay Pandey
>
>
> On Sat, Sep 26, 2020 at 7:10 PM Swapnil Shah <
> swapnil.s...@hotwaxsystems.com>
> wrote:
>
> > Thank you everyone for your continuous support and kind wishes.
> >
> > Thanks,
> > Swapnil
> >
> > > -Original Message-
> > > From: Ashish Vijaywargiya 
> > > Sent: 18 September 2020 12:56
> > > To: dev@ofbiz.apache.org
> > > Subject: Welcome Swapnil Shah as new PMC member!!
> > >
> > > The OFBiz PMC has invited Swapnil Shah to become a member of the
> > committee
> > > and we are glad to announce that he has accepted the nomination.
> > >
> > > On behalf of the OFBiz PMC, welcome on board Swapnil!
> >
>


Re: REST input is a map?

2020-09-27 Thread Girish Vasmatkar
Hi Hans

Maps and Lists work quite well. There is a difference in how you send the
JSON to a service that's listed as GET vs (PUT, PATCH or POST).

Yours is probably GET and you need to send the JSON urlencoded.



Gets a product feature





 


curl -G -X  GET https://localhost:8443/rest/services/demoMapService
--data-urlencode 'inParams={"input":{"test":"just testing"}}' -H "Accept: ap

plication/json" -H "Authorization: Bearer $token" --insecure

Above cURL works if the service is defined as GET.
However, if it were defined as POST, you will be sending like this -



Gets a product feature







curl -X POST https://localhost:8443/rest/services/demoMapService -d
'{"input":{"test":"just testing"}}' -H "Content-Type: application/json" -H "

Accept: application/json" -H "Authorization: Bearer $token" --insecure

Best,
Girish
HotWax Systems

On Sun, Sep 27, 2020 at 5:34 PM Hans Bakker 
wrote:

> Hi Girish,
>
> did some more tests and it works well with strings as in- and output,
>
> how about Maps and Lists?
>
> i tried the following input: {"input":{"test":"just testing"}}
>
> and the service definition: 
>
> then the ofbiz log below
>
> can you have a look?
>
> Regards,
>
> Hans
>
> 2020-09-27 18:56:26,801 |jsse-nio-8443-exec-6
> |ObjectType|W| Exception thrown while converting type:
> org.apache.ofbiz.base.conversion.ConversionException: Could not convert
> just testing to Map:
>  at
> org.apache.ofbiz.base.conversion.CollectionConverters$StringToMap.convert(CollectionConverters.java:172)
>
> ~[main/:?]
>  at
> org.apache.ofbiz.base.conversion.CollectionConverters$StringToMap.convert(CollectionConverters.java:164)
>
> ~[main/:?]
>  at
> org.apache.ofbiz.base.util.ObjectType.simpleTypeOrObjectConvert(ObjectType.java:350)
>
> ~[main/:?]
>  at
> org.apache.ofbiz.service.ModelService.makeValid(ModelService.java:1589)
> ~[main/:?]
>  at
> org.apache.ofbiz.service.ModelService.makeValid(ModelService.java:1516)
> ~[main/:?]
>  at
> org.apache.ofbiz.service.ModelService.makeValid(ModelService.java:1503)
> ~[main/:?]
>  at
> org.apache.ofbiz.service.DispatchContext.makeValidContext(DispatchContext.java:190)
>
> ~[main/:?]
>  at
> org.apache.ofbiz.service.DispatchContext.makeValidContext(DispatchContext.java:162)
>
> ~[main/:?]
>  at
> org.apache.ofbiz.ws.rs.ServiceRequestProcessor.process(ServiceRequestProcessor.java:64)
>
> ~[main/:?]
>  at
> org.apache.ofbiz.ws.rs.resources.OFBizServiceResource.doGet(OFBizServiceResource.java:120)
>
> ~[main/:?]
>  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> ~[?:1.8.0_265]
>  at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>
> ~[?:1.8.0_265]
>  at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>
> ~[?:1.8.0_265]
>  at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_265]
>  at
> org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.lambda$static$0(ResourceMethodInvocationHandlerFactory.java:52)
>
> ~[jersey-server-2.31.jar:?]
>  at
> org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:124)
>
> [jersey-server-2.31.jar:?]
>  at
> org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:167)
>
> [jersey-server-2.31.jar:?]
>  at
> org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:176)
>
> [jersey-server-2.31.jar:?]
>  at
> org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:79)
>
> [jersey-server-2.31.jar:?]
>  at
> org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:469)
>
> [jersey-server-2.31.jar:?]
>  at
> org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:391)
>
> [jersey-server-2.31.jar:?]
>  at
> org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:80)
>
> [jersey-server-2.31.jar:?]
>  at
> org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:253)
> [jersey-server-2.31.jar:?]
>  at org.glassfish.jersey.internal.Errors$1.call(Errors.java:248)
> [jersey-common-2.31.jar:?]
>  at org.glassfish.jersey.internal.Errors$1.call(Errors.java:244)
> [jersey-common-2.31.jar:?]
>  at org.glassfish.jersey.internal.Errors.process(Errors.java:292)
> [jersey-common-2.31.jar:?]
>  at org.glassfish.jersey.internal.Errors.process(Errors.java:274)
> [jersey-common-2.31.jar:?]
>  at org.glassfish.jersey.internal.Errors.process(Errors.java:244)
> [jersey-common-2.31.jar:?]
>  at
> 

REST input is a map?

2020-09-27 Thread Hans Bakker

Hi Girish,

did some more tests and it works well with strings as in- and output,

how about Maps and Lists?

i tried the following input: {"input":{"test":"just testing"}}

and the service definition: 

then the ofbiz log below

can you have a look?

Regards,

Hans

2020-09-27 18:56:26,801 |jsse-nio-8443-exec-6 
|ObjectType    |W| Exception thrown while converting type:
org.apache.ofbiz.base.conversion.ConversionException: Could not convert 
just testing to Map:
    at 
org.apache.ofbiz.base.conversion.CollectionConverters$StringToMap.convert(CollectionConverters.java:172) 
~[main/:?]
    at 
org.apache.ofbiz.base.conversion.CollectionConverters$StringToMap.convert(CollectionConverters.java:164) 
~[main/:?]
    at 
org.apache.ofbiz.base.util.ObjectType.simpleTypeOrObjectConvert(ObjectType.java:350) 
~[main/:?]
    at 
org.apache.ofbiz.service.ModelService.makeValid(ModelService.java:1589) 
~[main/:?]
    at 
org.apache.ofbiz.service.ModelService.makeValid(ModelService.java:1516) 
~[main/:?]
    at 
org.apache.ofbiz.service.ModelService.makeValid(ModelService.java:1503) 
~[main/:?]
    at 
org.apache.ofbiz.service.DispatchContext.makeValidContext(DispatchContext.java:190) 
~[main/:?]
    at 
org.apache.ofbiz.service.DispatchContext.makeValidContext(DispatchContext.java:162) 
~[main/:?]
    at 
org.apache.ofbiz.ws.rs.ServiceRequestProcessor.process(ServiceRequestProcessor.java:64) 
~[main/:?]
    at 
org.apache.ofbiz.ws.rs.resources.OFBizServiceResource.doGet(OFBizServiceResource.java:120) 
~[main/:?]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
~[?:1.8.0_265]
    at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
~[?:1.8.0_265]
    at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
~[?:1.8.0_265]

    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_265]
    at 
org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.lambda$static$0(ResourceMethodInvocationHandlerFactory.java:52) 
~[jersey-server-2.31.jar:?]
    at 
org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:124) 
[jersey-server-2.31.jar:?]
    at 
org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:167) 
[jersey-server-2.31.jar:?]
    at 
org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:176) 
[jersey-server-2.31.jar:?]
    at 
org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:79) 
[jersey-server-2.31.jar:?]
    at 
org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:469) 
[jersey-server-2.31.jar:?]
    at 
org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:391) 
[jersey-server-2.31.jar:?]
    at 
org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:80) 
[jersey-server-2.31.jar:?]
    at 
org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:253) 
[jersey-server-2.31.jar:?]
    at org.glassfish.jersey.internal.Errors$1.call(Errors.java:248) 
[jersey-common-2.31.jar:?]
    at org.glassfish.jersey.internal.Errors$1.call(Errors.java:244) 
[jersey-common-2.31.jar:?]
    at org.glassfish.jersey.internal.Errors.process(Errors.java:292) 
[jersey-common-2.31.jar:?]
    at org.glassfish.jersey.internal.Errors.process(Errors.java:274) 
[jersey-common-2.31.jar:?]
    at org.glassfish.jersey.internal.Errors.process(Errors.java:244) 
[jersey-common-2.31.jar:?]
    at 
org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:265) 
[jersey-common-2.31.jar:?]
    at 
org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:232) 
[jersey-server-2.31.jar:?]
    at 
org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:680) 
[jersey-server-2.31.jar:?]
    at 
org.glassfish.jersey.servlet.WebComponent.serviceImpl(WebComponent.java:394) 
[jersey-container-servlet-core-2.31.jar:?]
    at 
org.glassfish.jersey.servlet.ServletContainer.serviceImpl(ServletContainer.java:386) 
[jersey-container-servlet-core-2.31.jar:?]
    at 
org.glassfish.jersey.servlet.ServletContainer.doFilter(ServletContainer.java:561) 
[jersey-container-servlet-core-2.31.jar:?]
    at 
org.glassfish.jersey.servlet.ServletContainer.doFilter(ServletContainer.java:502) 
[jersey-container-servlet-core-2.31.jar:?]
    at 
org.glassfish.jersey.servlet.ServletContainer.doFilter(ServletContainer.java:439) 
[jersey-container-servlet-core-2.31.jar:?]
    at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) 
[tomcat-catalina-9.0.37.jar:9.0.37]
    at