I am using ESB 4.8.0
My backend service is not accepting empty optional parameters. Means if
optional parameter is not supply then need to remove parameter name also
from URL encoding. 
For example

credentialFieldstypeName=IF_LOGIN&credentialFieldsame=LOGIN&credentialFieldsvalue=sha5.

Let’s says “credentialFieldsame” is optional on above URL then it’s need to
come as

credentialFieldstypeName=IF_LOGIN&credentialFieldsvalue=sha5

Means completely remove parameter. If we send like bellow it gives error

credentialFieldstypeName=IF_LOGIN&credentialFieldsame=&credentialFieldsvalue=sha5

it is not possible to use fileters as I have 6 optional parameters. Means 64
combinations!!!
Is there any way to do this? Means remove empty parameters when
x-www-form-urlencoding
Note: I am using json payload as cannot use xml I need to use "["  on
parameter names.
http method is POST

payload as follows

<payloadFactory media-type="json">
                        <format>
                                {
                                "SessionToken": "$1",
                                "userToken": "$2",
                                "SiteAccId": "$3",
                                }

                        </format>
                        <args>

                                <arg 
expression="get-property('uri.var.SessionToken')" />
                                <arg 
expression="get-property('uri.var.userToken')" />
                                <arg 
expression="get-property('uri.var.SiteAccId')" />
                        </args>
                </payloadFactory>

<property name="messageType" value="application/x-www-form-urlencoded"
                        scope="axis2" />




--
View this message in context: 
http://wso2-oxygen-tank.10903.n7.nabble.com/remove-empty-parameters-from-payload-http-post-json-tp91243.html
Sent from the WSO2 Development mailing list archive at Nabble.com.
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to