You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by "info@agentur-m3.de" <in...@agentur-m3.de> on 2015/02/22 11:48:31 UTC

ajax json response

Hello everyone!

Here is a question concerning an ajax request:

<service name="getNext" engine="java"
      location="org.ofbiz.pcomp.pCompServices" invoke="getNext">
    <description>get next</description>
   <!-- <auto-attributes mode="IN" entity-name="pcRating"
include="nonpk" optional="true" /> -->
 <attribute name="pcId" mode="IN" type="String" optional="true" />
 <attribute name="idX" mode="OUT" type="Integer" optional="false" />
 <attribute name="idY" mode="OUT" type="Integer" optional="false" />
</service>

    <request-map uri="getNext">
      <security https="true" auth="true"/>
      <event type="service" invoke="getNext"/>
      <response name="success" type="request" value="json"/>
      <response name="error" type="request" value="json"/>
    </request-map>


The request works fine and gives back correct values for idX and idY.

My question is, if the line
      <response name="success" type="request" value="json"/>

is correct (or if there is an better alternative), because
the return values are not json, but 2 x  plain integer.

The java function implementing the service returns this:

	 Map result = ServiceUtil.returnSuccess();
	 int idX = 5;
	 int idY = 6;
	 result.put("idX",idX);
	 result.put("idY",idY);
	 return result;

So is value="json" formally correct?

Thank you for your help!

Re: ajax json response

Posted by Jacques Le Roux <ja...@les7arts.com>.
Help yourself http://ofbiz.apache.org/mailing-lists.html

Jacques

Le 23/02/2015 04:46, Sumit Sabu a écrit :
> Remove my name from this mail chain.
>
> I am not a part of this   so called organisation   :   OFBIZ
>
> Remove my name.
>
> On Sun, Feb 22, 2015 at 4:18 PM, info@agentur-m3.de <in...@agentur-m3.de>
> wrote:
>
>> Hello everyone!
>>
>> Here is a question concerning an ajax request:
>>
>> <service name="getNext" engine="java"
>>        location="org.ofbiz.pcomp.pCompServices" invoke="getNext">
>>      <description>get next</description>
>>     <!-- <auto-attributes mode="IN" entity-name="pcRating"
>> include="nonpk" optional="true" /> -->
>>   <attribute name="pcId" mode="IN" type="String" optional="true" />
>>   <attribute name="idX" mode="OUT" type="Integer" optional="false" />
>>   <attribute name="idY" mode="OUT" type="Integer" optional="false" />
>> </service>
>>
>>      <request-map uri="getNext">
>>        <security https="true" auth="true"/>
>>        <event type="service" invoke="getNext"/>
>>        <response name="success" type="request" value="json"/>
>>        <response name="error" type="request" value="json"/>
>>      </request-map>
>>
>>
>> The request works fine and gives back correct values for idX and idY.
>>
>> My question is, if the line
>>        <response name="success" type="request" value="json"/>
>>
>> is correct (or if there is an better alternative), because
>> the return values are not json, but 2 x  plain integer.
>>
>> The java function implementing the service returns this:
>>
>>           Map result = ServiceUtil.returnSuccess();
>>           int idX = 5;
>>           int idY = 6;
>>           result.put("idX",idX);
>>           result.put("idY",idY);
>>           return result;
>>
>> So is value="json" formally correct?
>>
>> Thank you for your help!
>>

Re: ajax json response

Posted by Sumit Sabu <sa...@gmail.com>.
Remove my name from this mail chain.

I am not a part of this   so called organisation   :   OFBIZ

Remove my name.

On Sun, Feb 22, 2015 at 4:18 PM, info@agentur-m3.de <in...@agentur-m3.de>
wrote:

> Hello everyone!
>
> Here is a question concerning an ajax request:
>
> <service name="getNext" engine="java"
>       location="org.ofbiz.pcomp.pCompServices" invoke="getNext">
>     <description>get next</description>
>    <!-- <auto-attributes mode="IN" entity-name="pcRating"
> include="nonpk" optional="true" /> -->
>  <attribute name="pcId" mode="IN" type="String" optional="true" />
>  <attribute name="idX" mode="OUT" type="Integer" optional="false" />
>  <attribute name="idY" mode="OUT" type="Integer" optional="false" />
> </service>
>
>     <request-map uri="getNext">
>       <security https="true" auth="true"/>
>       <event type="service" invoke="getNext"/>
>       <response name="success" type="request" value="json"/>
>       <response name="error" type="request" value="json"/>
>     </request-map>
>
>
> The request works fine and gives back correct values for idX and idY.
>
> My question is, if the line
>       <response name="success" type="request" value="json"/>
>
> is correct (or if there is an better alternative), because
> the return values are not json, but 2 x  plain integer.
>
> The java function implementing the service returns this:
>
>          Map result = ServiceUtil.returnSuccess();
>          int idX = 5;
>          int idY = 6;
>          result.put("idX",idX);
>          result.put("idY",idY);
>          return result;
>
> So is value="json" formally correct?
>
> Thank you for your help!
>