2 Replies Latest reply on May 19, 2017 12:13 PM by RaviNag

    rest web service input

    RaviNag

      Hi,

       

      I am trying to create a rest mvc web service using the component actor.

      i have defined a component with a method (createProducts)  which takes the custom object array (com.xxx.Product [ ] )  as input.

       

      I am defining the input and output for this method in the actor xml as mentioned below.

       

       

      <component id="compId" name="/com/xxx/ProductServices"

              method="createProducts" component-var="productsCreateService"

                  method-return-var="productsCreateStatus" >

               <input name="product" class-name="com.xxx.Product"  value="${objectParam.product}" />

                <output name="CreateProductsResult"  value="${productsCreateStatus}" />

            </component>

       

      json Input :

      {\"product\":

                     {\"atg-rest-class-type\":\"com.xxx.Product\",

                         \"atg-rest-values\":

                                                           [{\"atg-rest-class-type\":\"com.xxx.Product\",\"property1\":\"value1\",\"property2\":\"value2\"} ]

                        }

      }

       

      with above config and test call, i am getting the 500 error as

       

       

      Error code: 500

      : java.lang.NullPointerException

        at atg.rest.input.JSONInputCustomizer.instantiateObjectParameter(JSONInputCustomizer.java:294) [_REST_slib_satg-rest-1.0.jar:]

        at atg.rest.input.JSONInputCustomizer.produceMultivalueComponentObject(JSONInputCustomizer.java:610) [_REST_slib_satg-rest-1.0.jar:]

        at atg.rest.input.JSONInputCustomizer.processJSONMultiValue(JSONInputCustomizer.java:420) [_REST_slib_satg-rest-1.0.jar:]

        at atg.rest.input.JSONInputCustomizer.instantiateObjectParameter(JSONInputCustomizer.java:287) [_REST_slib_satg-rest-1.0.jar:]

       

      please let me know issue is with the configuration or json.

       

      Thanks,

      RaviNag