Hi Kalyani,
You can get the parameter value from init method ({$ctx:salesforce.timeout})
in the template. Instead of adding endpoints in different template, you can
add the endpoint in the template for blocking calls. The endpoint timeout
can be different between API methods and we need to adjust the timeout
value for some api methods. So we can include the endpoint configuration
inside the template rather than adding in common template.
<template name="salesforceEndPoint" xmlns="http://ws.apache.org/ns/synapse">
<parameter name="initialDuration" description="Initial timeout duration
of the API request."/>
<parameter name="progressionFactor"
description="Progress factor for timeout of the API
request."/>
<parameter name="maximumDuration"
description="Maximum duration for timeout of the API
request."/>
<parameter name="timeout" description="Timeout duration of the API
request."/>
<parameter name="responseAction"
description="It is used to specify the action to perform
once an endpoint has timed out."/>
<parameter name="errorCodes" description="It is used to specify one or
more error codes."/>
<call blocking="true">
<endpoint>
<default format="soap11">
<markForSuspension>
<errorCodes>-1</errorCodes>
</markForSuspension>
<suspendOnFailure>
<errorCodes>-1</errorCodes>
<initialDuration>2000</initialDuration>
<progressionFactor>1.0</progressionFactor>
<maximumDuration>3000</maximumDuration>
</suspendOnFailure>
<timeout>
<duration>{$ctx:salesforce.timeout}</duration>
<responseAction>fault</responseAction>
</timeout>
</default>
</endpoint>
</call>
</template>
Thanks,
Kathees
On Thu, Jun 16, 2016 at 1:58 PM, Kalyani Yogeswaranathan <[email protected]>
wrote:
> Hi Al,
>
> I am working on salesforce connector to add dynamic endpoint. For that
> I've wrote a separate template as [1] and calling this template within call
> mediator,
>
> It's working fine for blocking false when i call endpoint template, but
> it's not working for blocking true[2].
>
> [2]
>
> <call blocking="true">
> <endpoint name="EP"
>
> template="org.wso2.carbon.connector.salesforce.salesforceEndPoint">
> <parameter name="timeout" value="ctx:salesforce.timeout"/>
> </endpoint>
> </call>
>
> but if I add the whole endpoint[3], rather than calling endpoint template
> it's working fine.
>
> [3]
> <call blocking="true">
> <endpoint>
> <default format="soap11">
> <markForSuspension>
> <errorCodes>-1</errorCodes>
> </markForSuspension>
> <suspendOnFailure>
> <errorCodes>-1</errorCodes>
> <initialDuration>2000</initialDuration>
> <progressionFactor>1.0</progressionFactor>
> <maximumDuration>3000</maximumDuration>
> </suspendOnFailure>
> <timeout>
> <duration>{$ctx:salesforce.timeout}</duration>
> <responseAction>fault</responseAction>
> </timeout>
> </default>
> </endpoint>
> </call>
>
> Is there any other way to call endpoint template within call mediator with
> blocking true?
>
>
> [1]
>
> <template name="salesforceEndPoint" xmlns="http://ws.apache.org/ns/synapse">
> <parameter name="initialDuration" description="Initial timeout duration
> of the API request."/>
> <parameter name="progressionFactor"
> description="Progress factor for timeout of the API request."/>
> <parameter name="maximumDuration"
> description="Maximum duration for timeout of the API
> request."/>
> <parameter name="timeout" description="Timeout duration of the API
> request."/>
> <parameter name="responseAction"
> description="It is used to specify the action to perform once
> an endpoint has timed out."/>
> <parameter name="errorCodes" description="It is used to specify one or
> more error codes."/>
> <endpoint name="salesforce_endpoint">
> <default format="soap11">
> <markForSuspension>
> <errorCodes>-1</errorCodes>
> </markForSuspension>
> <suspendOnFailure>
> <errorCodes>-1</errorCodes>
> <initialDuration>2000</initialDuration>
> <progressionFactor>1.0</progressionFactor>
> <maximumDuration>3000</maximumDuration>
> </suspendOnFailure>
> <timeout>
> <duration>{$ctx:salesforce.timeout}</duration>
> <responseAction>fault</responseAction>
> </timeout>
> </default>
> </endpoint>
> </template>
>
>
> --
> Best Regards,
>
>
> *Kalyani Yogeswaranathan*
>
> *Associate software engineer*
> *WSO2 Inc.*
>
> *Mobile: 0776390284*
>
> _______________________________________________
> Dev mailing list
> [email protected]
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>
--
Kathees
Software Engineer,
email: [email protected]
mobile: +94772596173
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev