EnablingJSONIN: Difference between revisions

m
fix code tags, add category
mNo edit summary
m (fix code tags, add category)
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
{{underconst}}
Here's how to generate there required  files for enabling JSON in your webservice.
Here's how to generate there required  files for enabling JSON in your webservice.


Line 9: Line 12:
Now you can write code like the following:
Now you can write code like the following:


<code lang="vdf">
<source lang="dataflex">
   ...
   ...
   
   
Line 35: Line 38:
         End
         End
     End_Procedure
     End_Procedure
</code>
</source>


oProduct is a traditional webservice using SOAP.
oProduct is a traditional webservice using SOAP.
Line 42: Line 45:
Now . Given the following structure definitions:
Now . Given the following structure definitions:


<code lang="vdf">
<source lang="dataflex">
   Struct meta
   Struct meta
     Boolean success
     Boolean success
Line 82: Line 85:
   End_Struct
   End_Struct


</code>
</source>
 
You will be able to send tAddProductRequest as JSON from the client side as the request parameter
 


Then you will be able to communicate with ExtJS 4 using the following model definition:
To parse the incoming request from  ExtJS 4 you could use the following model definition:


<code lang="javascript">
<source lang="javascript">
   Ext.regModel('Acme.Product', {
   Ext.regModel('Acme.Product', {
     idProperty: 'id',
     idProperty: 'id',
Line 109: Line 115:
  });
  });


</code>
</source>
 
 


You will be able to send tAddProductRequest as JSON from the client side as the request parameter
[[Category:JSON]]