Hi Aditya,
Since the JSON string is a constant, you can directly set it as the text of
a property mediator. Please refer below property mediator. You need to
properly escape the characters.
<property name="jsonConst"
scope="default"
type="STRING"
value="{ "Items":
{ "Book":
{ "Type":
"System.Int32" }, "Pencil": {
"Type": "System.Int32",
"Value": "10", "Original":
"10" }, "Table": {
"Type": "System.Int32",
"Value": "110", "Original":
"110" } } }"/>
Regards,
Vinod
On Mon, Jan 15, 2018 at 3:51 PM, aditya shivankar <
[email protected]> wrote:
> Respected sir,
>
> I want to assign a constant json to property without distrubing my payload
> how could I do this.
> So I cannot use payload factory to generate json as it will vanish my
> payload.
>
> I could achieve this by
> 1. assign payload to a property1
> 2. create new json in payload factory
> 3. assign new payload to property 2
> 4. assign old payload in property1 to current payload.
>
> But is there a direct way ?
>
> Could I do this without using payload factory.
>
> example of canstant json
> {
> "Items": {
> "Book": {
> "Type": "System.Int32"
> },
> "Pencil": {
> "Type": "System.Int32",
> "Value": "10",
> "Original": "10"
> },
> "Table": {
> "Type": "System.Int32",
> "Value": "110",
> "Original": "110"
> }
> }
> }
>
> I want to create a property in between the flow , with a initial value as
> above json like this.
>
>
> With Regards,
> Aditya
>
> _______________________________________________
> Dev mailing list
> [email protected]
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>
--
Vinod Kavinda
Senior Software Engineer
*WSO2 Inc. - lean . enterprise . middleware <http://www.wso2.com>.*
Mobile : +94 (0) 712 415544
Blog : http://soatechflicks.blogspot.com/
[image: http://wso2.com/signature]
<http://wso2.com/signature>
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev